This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PUSHED] Fix go32-nat.c build fallout from to_detach constification.


Pedro Alves writes:
 > 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.

Headaches indeed.  Oh well.

I've pushed this to trunk and the 7.7 branch.

2014-01-15  Doug Evans  <dje@google.com>

	* dwarf2read.c (open_and_init_dwp_file): Use pulongest to print
	uint32_t.

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 90c60cd..71bbe96 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -10544,10 +10544,12 @@ open_and_init_dwp_file (void)
   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);
+	 pretty bizarre.  We use pulongest here because that's the established
+	 portability solution (e.g, we can use %u for uint32_t).  */
+      error (_("Dwarf Error: DWP file CU version %s doesn't match"
+	       " TU version %s [in DWP file %s]"),
+	     pulongest (dwp_file->cus->version),
+	     pulongest (dwp_file->tus->version), dwp_name);
     }
   dwp_file->version = dwp_file->cus->version;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]