From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28337 invoked by alias); 23 Dec 2002 23:07:49 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 28324 invoked from network); 23 Dec 2002 23:07:47 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by 209.249.29.67 with SMTP; 23 Dec 2002 23:07:47 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id gBNMewB29306 for ; Mon, 23 Dec 2002 17:40:58 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gBNN7Ya13402; Mon, 23 Dec 2002 18:07:34 -0500 Received: from localhost.localdomain (vpn50-19.rdu.redhat.com [172.16.50.19]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gBNN7YL05640; Mon, 23 Dec 2002 18:07:34 -0500 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id gBNN7So25752; Mon, 23 Dec 2002 16:07:28 -0700 Date: Mon, 23 Dec 2002 15:39:00 -0000 From: Kevin Buettner Message-Id: <1021223230728.ZM25751@localhost.localdomain> In-Reply-To: Andrew Cagney "Re: [PATCH] exec.c: print_section_info() format string fixes" (Dec 20, 6:51pm) References: <1021219190121.ZM13455@localhost.localdomain> <3E0366C3.10607@redhat.com> To: Andrew Cagney Subject: Re: [PATCH] exec.c: print_section_info() format string fixes Cc: gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-12/txt/msg00648.txt.bz2 On Dec 20, 6:51pm, Andrew Cagney wrote: > > On 64-bit targets, I found that the values printed by print_section_info() > > were not being printed in their entirety. I've just committed the patch > > below to fix this problem. > > > > As I look at it now, I see that the FIXME comment can go. I'll zap it > > in a moment. > > I don't think the problem is fixed, just improved. The 08l / 016l test > assumes that the address is <= 64 bits. Hence, I think some sort of > FIXME should remain (look for other similar cases). The bug database > contains a suggestion that a new function - > local_address_string_custom()(?) be added. Okay, I'll put some sort of FIXME back. > > * exec.c (print_section_info): Select a format string to use with > > local_hex_string_custom() based upon the value of TARGET_ADDR_BIT. > > > > > printf_filtered (" @ %s", > > - local_hex_string_custom ((unsigned long) p->the_bfd_section->filepos, "08l")); > > + local_hex_string_custom (p->the_bfd_section->filepos, "08l")); > > BTW, Is the above correct? Sort of. The cast is definitely not needed. I had originally thought that "016l" should also be used for this, but it makes the output a lot wider than I find desirable. Ideally, I guess we'd test to see how large the file is, and then pick a format string based upon that. I.e, if the file is bigger than 4GB, we'd use "016l" for the file position. But, since I've never seen an executable or shared library bigger than 4GB, I'm not particularly worried about it. However, I'll add a FIXME before that line noting the potential problem.