This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: fix GDB casts when pointers are not addresses
- To: Jim Blandy <jimb at cygnus dot com>
- Subject: Re: RFA: fix GDB casts when pointers are not addresses
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Thu, 05 Jul 2001 16:09:08 -0400
- Cc: gdb-patches at sources dot redhat dot com
- References: <20010628225704.9AB635E9CB@zwingli.cygnus.com> <3B43F7F6.3080902@cygnus.com> <npu20rmctc.fsf@zwingli.cygnus.com>
> Sure.
>
> $ cat pointer2.c
> #include <stdio.h>
>
> main ()
> {
> printf ("0x%x\n", (int) &main);
> }
> $ $CMitsuB/d10v-elf-gcc -g pointer2.c -o pointer2
> $ $CMitsuB/d10v-elf-run pointer2
> 0x5017
> $ $DD10v/gdb/gdb pointer2
> GNU gdb 2001-07-02-cvs (MI_OUT)
> Copyright 2001 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "--host=i686-pc-linux-gnu --target=d10v-elf"...
> (gdb) print (int) &main
> $1 = 16476
> (gdb) p/x (int) &main
> $2 = 0x405c
Is this before or after all the changes? My understanding of what you
were proposing was that it would output the same as for GCC vis:
$2 = 0x5017
> Sure. The patch includes a comment which is supposed to set this
> straight. What is it missing?
I was thinking more of doc/gdb.texinfo.
Andrew