From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6347 invoked by alias); 23 Dec 2002 23:39:19 -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 6339 invoked from network); 23 Dec 2002 23:39:18 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by 209.249.29.67 with SMTP; 23 Dec 2002 23:39:18 -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 gBNNCTB01346 for ; Mon, 23 Dec 2002 18:12:29 -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 gBNNd5a18931; Mon, 23 Dec 2002 18:39:05 -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 gBNNd4L06726; Mon, 23 Dec 2002 18:39:05 -0500 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id gBNNcxg26090; Mon, 23 Dec 2002 16:38:59 -0700 Date: Mon, 23 Dec 2002 15:53:00 -0000 From: Kevin Buettner Message-Id: <1021223233859.ZM26089@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/msg00649.txt.bz2 On Dec 20, 6:51pm, Andrew Cagney wrote: > 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 [...] With regard to the FIXME comments, I've just committed the following: * exec.c (print_section_info): Add FIXME comments regarding format string choices. Index: exec.c =================================================================== RCS file: /cvs/src/src/gdb/exec.c,v retrieving revision 1.25 diff -u -p -r1.25 exec.c --- exec.c 19 Dec 2002 19:02:57 -0000 1.25 +++ exec.c 23 Dec 2002 23:34:24 -0000 @@ -545,6 +545,7 @@ void print_section_info (struct target_ops *t, bfd *abfd) { struct section_table *p; + /* FIXME: "016l" is not wide enough when TARGET_ADDR_BIT > 64. */ char *fmt = TARGET_ADDR_BIT <= 32 ? "08l" : "016l"; printf_filtered ("\t`%s', ", bfd_get_filename (abfd)); @@ -560,6 +561,12 @@ print_section_info (struct target_ops *t { printf_filtered ("\t%s", local_hex_string_custom (p->addr, fmt)); printf_filtered (" - %s", local_hex_string_custom (p->endaddr, fmt)); + + /* FIXME: A format of "08l" is not wide enough for file offsets + larger than 4GB. OTOH, making it "016l" isn't desirable either + since most output will then be much wider than necessary. It + may make sense to test the size of the file and choose the + format string accordingly. */ if (info_verbose) printf_filtered (" @ %s", local_hex_string_custom (p->the_bfd_section->filepos, "08l"));