From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15699 invoked by alias); 15 Jan 2014 17:45:43 -0000 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 Received: (qmail 15689 invoked by uid 89); 15 Jan 2014 17:45:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Jan 2014 17:45:41 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0FHjcw4007223 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 15 Jan 2014 12:45:38 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s0FHjbv0031069; Wed, 15 Jan 2014 12:45:37 -0500 Message-ID: <52D6C940.3040008@redhat.com> Date: Wed, 15 Jan 2014 17:45:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Eli Zaretskii CC: gdb-patches@sourceware.org Subject: Re: [PUSHED] Fix go32-nat.c build fallout from to_detach constification. References: <52D6B91C.2030402@redhat.com> <83d2jt418x.fsf@gnu.org> In-Reply-To: <83d2jt418x.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-01/txt/msg00528.txt.bz2 On 01/15/2014 05:13 PM, Eli Zaretskii wrote: > /* The DWP file version is stored in the hash table. Oh well. */ > if (dwp_file->cus->version != dwp_file->tus->version) > { > /* Technically speaking, we should try to limp along, but this is > pretty bizarre. */ > error (_("Dwarf Error: DWP file CU version %d doesn't match" <<<<<< > " TU version %d [in DWP file %s]"), <<<<<<<<<<<<<<<<<<<<<< > dwp_file->cus->version, dwp_file->tus->version, dwp_name); > > So it really tries to format uint32_t values with %d. Wait, we've been through this before. See 21aa081e21da472e1e470d57770953c5e5c01477 (below). So, that should be adjusted to do pulongest instead. -------------- >From 21aa081e21da472e1e470d57770953c5e5c01477 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 23 May 2013 18:31:29 +0000 Subject: [PATCH] dwarf2read.c: Don't assume uint32_t is unsigned int on all hosts. Building gdb on GNU/Linux, for --host=i586-pc-msdosdjgpp, I get: ../../src/gdb/dwarf2read.c: In function 'create_dwp_hash_table': ../../src/gdb/dwarf2read.c:8626:7: error: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'uint32_t' [-Werror=format] ../../src/gdb/dwarf2read.c:8632:7: error: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'uint32_t' [-Werror=format] ../../src/gdb/dwarf2read.c: In function 'create_dwo_in_dwp': ../../src/gdb/dwarf2read.c:8754:6: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' [-Werror=format] ../../src/gdb/dwarf2read.c: In function 'open_and_init_dwp_file': ../../src/gdb/dwarf2read.c:9248:6: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Werror=format] ../../src/gdb/dwarf2read.c:9248:6: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format] And: $ grep uint32_t /usr/i586-pc-msdosdjgpp/sys-include/* /usr/i586-pc-msdosdjgpp/sys-include/stdint.h:typedef unsigned long uint32_t; As decided on the discussion at , use pulongest rather than PRIu32. Tested on F17. Also confirmed GDB still builds OK with --host=i686-w64-mingw32. gdb/ 2013-05-23 Pedro Alves * dwarf2read.c (create_dwp_hash_table, create_dwo_in_dwp) (open_and_init_dwp_file): Use %s/pulongest instead of %u for printing uint32_t variables. --- gdb/ChangeLog | 6 ++++++ gdb/dwarf2read.c | 18 +++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5baaf27..194fb85 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2013-05-23 Pedro Alves + * dwarf2read.c (create_dwp_hash_table, create_dwo_in_dwp) + (open_and_init_dwp_file): Use %s/pulongest instead of %u for + printing uint32_t variables. + +2013-05-23 Pedro Alves + * NEWS: Mention GDBserver range stepping support. 2013-05-23 Yao Qi diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index b819d3c..092a801 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -8960,15 +8960,15 @@ create_dwp_hash_table (struct dwp_file *dwp_file, int is_debug_types) if (version != 1) { - error (_("Dwarf Error: unsupported DWP file version (%u)" + error (_("Dwarf Error: unsupported DWP file version (%s)" " [in module %s]"), - version, dwp_file->name); + pulongest (version), dwp_file->name); } if (nr_slots != (nr_slots & -nr_slots)) { - error (_("Dwarf Error: number of slots in DWP hash table (%u)" + error (_("Dwarf Error: number of slots in DWP hash table (%s)" " is not power of 2 [in module %s]"), - nr_slots, dwp_file->name); + pulongest (nr_slots), dwp_file->name); } htab = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct dwp_hash_table); @@ -9087,9 +9087,9 @@ create_dwo_in_dwp (struct dwp_file *dwp_file, if (dwarf2_read_debug) { - fprintf_unfiltered (gdb_stdlog, "Reading %s %u/%s in DWP file: %s\n", + fprintf_unfiltered (gdb_stdlog, "Reading %s %s/%s in DWP file: %s\n", kind, - section_index, hex_string (signature), + pulongest (section_index), hex_string (signature), dwp_file->name); } @@ -9582,9 +9582,9 @@ open_and_init_dwp_file (void) { fprintf_unfiltered (gdb_stdlog, "DWP file found: %s\n", dwp_file->name); fprintf_unfiltered (gdb_stdlog, - " %u CUs, %u TUs\n", - dwp_file->cus ? dwp_file->cus->nr_units : 0, - dwp_file->tus ? dwp_file->tus->nr_units : 0); + " %s CUs, %s TUs\n", + pulongest (dwp_file->cus ? dwp_file->cus->nr_units : 0), + pulongest (dwp_file->tus ? dwp_file->tus->nr_units : 0)); } return dwp_file; -- 1.7.11.7