From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8304 invoked by alias); 13 Sep 2008 23:58:17 -0000 Received: (qmail 8295 invoked by uid 22791); 13 Sep 2008 23:58:17 -0000 X-Spam-Check-By: sourceware.org Received: from hiauly1.hia.nrc.ca (HELO hiauly1.hia.nrc.ca) (132.246.100.193) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 13 Sep 2008 23:57:42 +0000 Received: by hiauly1.hia.nrc.ca (Postfix, from userid 1000) id ADEF94E6A; Sat, 13 Sep 2008 19:57:40 -0400 (EDT) Subject: [PATCH] Fix hppa_linux_sigtramp_frame_unwind_cache To: gdb-patches@sourceware.org Date: Sat, 13 Sep 2008 23:58:00 -0000 From: "John David Anglin" Cc: randolph@tausq.org X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20080913235740.ADEF94E6A@hiauly1.hia.nrc.ca> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-09/txt/msg00307.txt.bz2 The main fix in this patch is to remove the pad increment of scptr. As far as I know, there is no pad field in the sigcontext struct between the general registers and the floating point registers. I also recorded the PSW and SAR registers. It might be a mistake to record the PSW value, but I believe the SAR register definitely needs to be recorded. Somewhat tested on hppa-linux but the gdb testsuite crashes 2.6.19.22. Ok? Dave -- J. David Anglin dave.anglin@nrc-cnrc.gc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6602) 2008-09-13 John David Anglin * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind_cache): Record HPPA_IPSW_REGNUM and HPPA_SAR_REGNUM values. Remove pad increment. Index: hppa-linux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/hppa-linux-tdep.c,v retrieving revision 1.31 diff -u -3 -p -r1.31 hppa-linux-tdep.c --- hppa-linux-tdep.c 21 Aug 2008 13:19:18 -0000 1.31 +++ hppa-linux-tdep.c 13 Sep 2008 22:51:35 -0000 @@ -227,7 +229,8 @@ hppa_linux_sigtramp_frame_unwind_cache ( /* Skip sc_flags. */ scptr += 4; - /* GR[0] is the psw, we don't restore that. */ + /* GR[0] is the psw. */ + info->saved_regs[HPPA_IPSW_REGNUM].addr = scptr; scptr += 4; /* General registers. */ @@ -237,9 +240,6 @@ hppa_linux_sigtramp_frame_unwind_cache ( scptr += 4; } - /* Pad. */ - scptr += 4; - /* FP regs; FP0-3 are not restored. */ scptr += (8 * 4); @@ -262,6 +262,9 @@ hppa_linux_sigtramp_frame_unwind_cache ( info->saved_regs[HPPA_PCOQ_TAIL_REGNUM].addr = scptr; scptr += 4; + info->saved_regs[HPPA_SAR_REGNUM].addr = scptr; + scptr += 4; + info->base = get_frame_register_unsigned (this_frame, HPPA_SP_REGNUM); return info;