Re: [rfa] mips heuristic_proc_start fix

Daniel Jacobowitz
2001-07-06T11:40:00Z

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;