From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21096 invoked by alias); 3 May 2008 23:43:51 -0000 Received: (qmail 21088 invoked by uid 22791); 3 May 2008 23:43:51 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 03 May 2008 23:43:33 +0000 Received: (qmail 5907 invoked from network); 3 May 2008 23:43:31 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 3 May 2008 23:43:31 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [PATCH] add-symbol-file not to print address truncated Date: Sat, 03 May 2008 23:52:00 -0000 User-Agent: KMail/1.9.9 Cc: Adam Nemet References: <18460.63329.752236.534872@localhost.localdomain> In-Reply-To: <18460.63329.752236.534872@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805040043.26994.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00152.txt.bz2 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