This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RFA: print addresses that are longer than pointers, take two


Jim Blandy wrote:
> 
> This is yet a third amendment to address printing in printcmd.c.
> 
> I recently made changes which allow GDB to handle architectures on
> which addresses are larger than pointers.  However, the code which
> Peter Schauer added to printcmd.c to handle unwanted sign extension
> assumes that addresses and pointers are the same size.
> 
> As it turns out, this masking is unnecessary when the value being
> printed is a genuine pointer; the sign extension won't occur, and the
> masking is unneeded.

There is an important question here.  How should GDB internally
represent an address obtained from C pointer values in memory when
TARGET_PTR_BIT (ie C pointer) < ``TARGET_CORE_ADDR_BIT''?  Should it
sign extend it (as some architectures do) or not as others do.

Yes this kind of goes back to the dreaded tx49, which I'm just starting
to untangle.  The mapping between CORE_ADDR <-> TARGET_PTR_BIT <->
symbol address needs to be clearly defined.  If I know what the behavour
is ment to be I can probably sort out the tx49 (and a few other) cases.

> This also rewrites the mask generation in a way which I think is
> overflow-free, without needing to pull the wool over the compiler's
> eyes.

Thanks :-)

	Andrew

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]