From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 512 invoked by alias); 4 Dec 2004 05:31:40 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 478 invoked from network); 4 Dec 2004 05:31:35 -0000 Received: from unknown (HELO arwen.tausq.org) (64.81.244.109) by sourceware.org with SMTP; 4 Dec 2004 05:31:35 -0000 Received: by arwen.tausq.org (Postfix, from userid 1000) id 49791111F42; Fri, 3 Dec 2004 21:31:32 -0800 (PST) Date: Sat, 04 Dec 2004 07:51:00 -0000 From: Randolph Chung To: gdb-patches@sources.redhat.com Cc: brobecker@adacore.com Subject: Re: [RFC/RFA/hppa] unwind pc in bottom frame using correct register Message-ID: <20041204053132.GR6359@tausq.org> Reply-To: Randolph Chung Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041204042049.GR16491@adacore.com> X-GPG: for GPG key, see http://www.tausq.org/gpg.txt User-Agent: Mutt/1.5.6+20040722i X-SW-Source: 2004-12/txt/msg00102.txt.bz2 > --- hppa-tdep.c 1 Dec 2004 06:54:56 -0000 1.183 > +++ hppa-tdep.c 4 Dec 2004 04:15:30 -0000 > @@ -2185,6 +2185,12 @@ hppa_unwind_dummy_id (struct gdbarch *gd > static CORE_ADDR > hppa_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) > { > + /* If unwinding the PC from the sentinel frame, then which register > + to read depends on the value of the status register. Use > + hppa_target_read_pc(), it knows where to get the PC. */ > + if (target_has_execution && frame_relative_level (next_frame) < 0) > + return hppa_target_read_pc (inferior_ptid); > + > return frame_unwind_register_signed (next_frame, HPPA_PCOQ_HEAD_REGNUM) & ~3; > } this is wrong... perhaps you can do: if (frame_unwind_register_signed (next_frame, HPPA_FLAG_REGNUM) & 2) pc = frame_unsigned_register_signed (next_frame, 31); else pc = frame_unsigned_register_signed (next_frame, HPPA_PCOQ_HEAD_REGNUM); pc &= ~3; return pc; this should work on corefiles too..... the bit about HPPA_FLAG_REGNUM seems to be an hpux specific thing. I think the syscall stub does something special so we try to return r31 instead of pcoqh. I haven't looked at this in detail... i don't like having two versions of essentially the same function either; Andrew mentioned in another email that this is a bug, but i didn't understand if he meant this is a core-gdb bug or a hppa-specific bug... randolph -- Randolph Chung Debian GNU/Linux Developer, hppa/ia64 ports http://www.tausq.org/