This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] add-symbol-file not to print address truncated
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Adam Nemet <anemet at caviumnetworks dot com>
- Date: Sun, 4 May 2008 00:43:26 +0100
- Subject: Re: [PATCH] add-symbol-file not to print address truncated
- References: <18460.63329.752236.534872@localhost.localdomain>
Hi Adam,
A Sunday 04 May 2008 00:38:09, Adam Nemet wrote:
> Usual issue, 32-bit host printing 64-bit target addresses incorrectly:
>
> $ ./gdb -q
> Setting up the environment for debugging gdb.
> No symbol table is loaded. Use the "file" command.
> (gdb) set mips abi n64
> (gdb) add-symbol-file s.o 0x1234567876543210
> add symbol table from file "s.o" at
> .text_addr = 0x76543210
> ^^^^^^^^^^
> (y or n) y
> Reading symbols from
> /home/anemet/src/mips64octeon-unknown-linux-gnu/gdb/s.o...(no debugging
> symbols found)...done.
> (gdb) info func
> All defined functions:
>
> Non-debugging symbols:
> 0x1234567876543210 f
>
>
> I decided to use the same function to print the address above that is used
> to print the symbols. This led me to move that code into its own function
> hex_string_addr. Then looked through gdb and found a few other places that
> used similar patterns to print 32- or 64-bit addresses. I changed those to
> use this function too. Since now addresses are zero padded relocate.exp
> needed adjustment.
>
Would paddr_nz (in utils.c) do the trick?
--
Pedro Alves