This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA]: printing symbols with > 32 bit addrs.
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: [RFA]: printing symbols with > 32 bit addrs.
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Wed, 28 Feb 2001 20:21:49 -0800
- CC: gdb-patches at sources dot redhat dot com, jimb at cygnus dot com, ezannoni at cygnus dot com, kevinb at cygnus dot com
- Organization: Red Hat
- References: <3A8C5BDF.97924160@cygnus.com> <3A8C6E18.290AB910@cygnus.com>
Andrew Cagney wrote:
>
> Michael Snyder wrote:
> >
> >
> >
> > ------------------------------------------------------------------------
> > Oddly enough, info functions seems to fail to print addresses of
> > non-debugging symbols when addresses are greater than 32 bits.
> > This patch seems a bit crude, so I'm wondering if anyone has
> > a better suggestion.
>
> And non portable :-)
>
> > 2001-02-15 Michael Snyder <msnyder@mvstp600e.cygnus.com>
> >
> > * symtab.c (print_msymbol_info): Print addresses > 32 bits.
>
> (Kevin B has a useful cheat sheet of the int->text functions that he
> posted). At a guess paddr().
OK, how about this modification?
2001-02-28 Michael Snyder <msnyder@mvstp600e.cygnus.com>
* symtab.c (print_msymbol_info): Print addresses by portable method
longest_local_hex_string_custom. Allow for 64-bit addresses.
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.31
diff -c -3 -p -r1.31 symtab.c
*** symtab.c 2001/02/27 21:57:09 1.31
--- symtab.c 2001/03/01 04:31:15
*************** print_symbol_info (namespace_enum kind,
*** 2652,2660 ****
static void
print_msymbol_info (struct minimal_symbol *msymbol)
{
! printf_filtered (" %08lx %s\n",
! (unsigned long) SYMBOL_VALUE_ADDRESS (msymbol),
! SYMBOL_SOURCE_NAME (msymbol));
}
/* This is the guts of the commands "info functions", "info types", and
--- 2652,2667 ----
static void
print_msymbol_info (struct minimal_symbol *msymbol)
{
! char *tmp;
!
! if (TARGET_ADDR_BIT <= 32)
! tmp = longest_local_hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol),
! "08l");
! else
! tmp = longest_local_hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol),
! "016l");
! printf_filtered ("%s %s\n",
! tmp, SYMBOL_SOURCE_NAME (msymbol));
}
/* This is the guts of the commands "info functions", "info types", and