From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Jacobowitz To: Andrew Cagney , gdb-patches@sources.redhat.com Subject: Re: [rfa] mips heuristic_proc_start fix Date: Fri, 06 Jul 2001 11:40:00 -0000 Message-id: <20010706114028.A6366@nevyn.them.org> References: <20010706112010.A5578@nevyn.them.org> <3B46030B.2010007@cygnus.com> <20010706113232.A6209@nevyn.them.org> X-SW-Source: 2001-07/msg00159.html On Fri, Jul 06, 2001 at 11:32:32AM -0700, Daniel Jacobowitz wrote: > On Fri, Jul 06, 2001 at 02:27:23PM -0400, Andrew Cagney wrote: > > > This one was fun to track down... I've been getting corrupt PC values off > > > the stack in backtraces, something which needs to be fixed elsewhere. The > > > interesting thing is that the PC I was reading was 0x2. Remember that > > > CORE_ADDR on MIPS is an unsigned 64-bit quantity. > > > > > > You mean ***SIGNED** right? > > Glarg. Yes, it's signed, of course! Let me peer at this for a moment > and see why the math was coming out wrong; the patch is correct, but > now it's not quite as obvious to me why :) No, I stand uncorrected: (gdb) ptype CORE_ADDR type = long long unsigned int It's sign extended as if it were signed, but the type itself is not! typedef BFD_HOST_U_64_BIT bfd_vma; typedef BFD_HOST_64_BIT bfd_signed_vma; and typedef bfd_vma CORE_ADDR; -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer