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


On Fri, Apr 28, 2000 at 10:36:33AM +1000, Andrew Cagney wrote:
> 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.

For what it's worth, GCC actually has a macro that controlls whether pointers
sign extend or zero extend.  It looks VMS and Windows NT on alpha sign extend,
while the d10v zero extends.

-- 
Michael Meissner, Cygnus Solutions, a Red Hat company.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482

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