This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: addresses and pointers may be different sizes while printing
- To: Jim Blandy <jimb at cygnus dot com>
- Subject: Re: RFA: addresses and pointers may be different sizes while printing
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Thu, 05 Jul 2001 16:22:12 -0400
- Cc: gdb-patches at sources dot redhat dot com
- References: <20010628223546.BDE7F5E9CB@zwingli.cygnus.com> <3B43F682.1040502@cygnus.com> <npwv5nmh6x.fsf@zwingli.cygnus.com>
> Andrew Cagney <ac131313@cygnus.com> writes:
>
>> Would you have an example illustrating the actual affect of this change?
>
>
> Sure. First, read the section ``Pointers Are Not Always Addresses''
> in doc/gdbint.texinfo. It actually uses the D10V as its running
> example.
gdb.texinfo? Do we need a gdb.base/harvard.exp?
> This patch only affects architectures where code addresses and
> pointers are different sizes, like the D10V. Without my larger D10V
> patch ("RFA: Remove D10V-specific code from arch-independent
> modules"), GDB represents all code pointers as 32 bit values, so this
> patch has no effect there, either.
I can imagine that. I was kind of assuming you're examples would be
pre/post all changes.
> (gdb) print main
> $1 = {int ()} 0x101405c <main>
> (gdb) print/x &main
> $2 = 0x405c
> (gdb)
then
> (gdb) print main
> $1 = {int ()} 0x101405c <main>
> (gdb) print/x &main
> $2 = 0x101405c
> (gdb)
to be 110% sure, all of:
(gdb) print main
(gdb) print &main
(gdb) print/x main
(gdb) print/x &main
end up displaying the same hex (CORE_ADDR) value?
Andrew