CORE_ADDR representation
Stan Shebs
stan@codesourcery.com
Thu Feb 18 05:42:00 GMT 2010
Daniel Jacobowitz wrote:
> This comes up again and again, and has at least three times in the
> past month with Jan's PIE patches. Is it time for us to have opaque
> arithmetic on target addresses?
>
Urgh. On the plus side, the months of busywork lets us avoid dealing
with the brain-strainingly hard problems. :-)
> This truncates the high bits. MIPS sign-extends pointers, even
> internally in CORE_ADDR, and this results in separate debug info files
> for MIPS executables being relocated off to la-la land.
Heh, I remember getting hosed that way by a MIPS in 1994...
> For instance, should we always internally sign-extend CORE_ADDR?
> Always internally zero-extend? Having it vary by target has been a
> recurring problem.
>
I would say to declare that CORE_ADDR is fundamentally 0..memtop, so it
should be unsigned and zero-extend.
Can unsigned->signed->diddle->unsigned be encapsulated for MIPS only?
Stan
More information about the Gdb
mailing list