This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

Re: [PATCH] add-symbol-file not to print address truncated


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


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