From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24939 invoked by alias); 3 Jan 2003 21:38:09 -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 24930 invoked from network); 3 Jan 2003 21:38:06 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by 209.249.29.67 with SMTP; 3 Jan 2003 21:38:06 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id D6B463DC2; Fri, 3 Jan 2003 16:37:54 -0500 (EST) Message-ID: <3E1602B2.6050205@redhat.com> Date: Fri, 03 Jan 2003 21:38:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.1) Gecko/20021211 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] exec.c: print_section_info() format string fixes References: <1021219190121.ZM13455@localhost.localdomain> <3E0366C3.10607@redhat.com> <1021223233859.ZM26089@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-01/txt/msg00091.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. thanks! Andrew > 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")); > >