From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6432 invoked by alias); 31 Oct 2006 19:41:56 -0000 Received: (qmail 6399 invoked by uid 22791); 31 Oct 2006 19:41:53 -0000 X-Spam-Check-By: sourceware.org Received: from e5.ny.us.ibm.com (HELO e5.ny.us.ibm.com) (32.97.182.145) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 31 Oct 2006 19:41:42 +0000 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e5.ny.us.ibm.com (8.13.8/8.12.11) with ESMTP id k9VJfcA6027428 for ; Tue, 31 Oct 2006 14:41:38 -0500 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay02.pok.ibm.com (8.13.6/8.13.6/NCO v8.1.1) with ESMTP id k9VJfax1229372 for ; Tue, 31 Oct 2006 14:41:36 -0500 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k9VJfaj0026429 for ; Tue, 31 Oct 2006 14:41:36 -0500 Received: from dufur.beaverton.ibm.com (dufur.beaverton.ibm.com [9.47.22.20]) by d01av04.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k9VJfZ62026330 for ; Tue, 31 Oct 2006 14:41:35 -0500 Subject: patch: signal trampoline frame cache corruption (repost?) From: PAUL GILLIAM Reply-To: pgilliam@us.ibm.com To: gdb-patches@sourceware.org Content-Type: multipart/mixed; boundary="=-DWmAYQw/XFJdTDlgHSOT" Date: Tue, 31 Oct 2006 19:41:00 -0000 Message-Id: <1162323227.3428.9.camel@dufur.beaverton.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.2 (2.2.2-5) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00320.txt.bz2 --=-DWmAYQw/XFJdTDlgHSOT Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 548 This might be a repost. Attached is a patch to fix some signal trampoline frame cache corruption that occurs on machines that have no FPU registers. The corruption was reported when running gdb 6.4 on a PowerPC 440. If a backtrace command was run after hitting a signal trampoline frame, the frame cache would become corrupted and GDB would SIGSEGV. I have checked the cvs head sources, and the code has moved, but has not been fixed. So I updated the patch to apply to cvs head. Ok to commit? (This is almost an obvious fix, isn't it?) --=-DWmAYQw/XFJdTDlgHSOT Content-Disposition: attachment; filename=fix-sigtramp-cache.patch Content-Type: text/x-patch; name=fix-sigtramp-cache.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 1049 --- gdb/ppc-linux-tdep.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) --- gdb-6.4.orig/gdb/ppc-linux-tdep.c +++ gdb-6.4/gdb/ppc-linux-tdep.c @@ -967,14 +967,16 @@ ppc_linux_sigtramp_cache (struct frame_i trad_frame_set_reg_addr (this_cache, tdep->ppc_cr_regnum, gpregs + 38 * tdep->wordsize); - /* Floating point registers. */ - for (i = 0; i < 32; i++) - { - int regnum = i + FP0_REGNUM; - trad_frame_set_reg_addr (this_cache, regnum, fpregs + i * tdep->wordsize); - } - trad_frame_set_reg_addr (this_cache, tdep->ppc_fpscr_regnum, - fpregs + 32 * tdep->wordsize); + if (ppc_floating_point_unit_p(gdbarch)) { + /* Floating point registers. */ + for (i = 0; i < 32; i++) + { + int regnum = i + FP0_REGNUM; + trad_frame_set_reg_addr (this_cache, regnum, fpregs + i * tdep->wordsize); + } + trad_frame_set_reg_addr (this_cache, tdep->ppc_fpscr_regnum, + fpregs + 32 * tdep->wordsize); + } trad_frame_set_id (this_cache, frame_id_build (base, func)); } --=-DWmAYQw/XFJdTDlgHSOT--