This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PUSHED] Fix go32-nat.c build fallout from to_detach constification.
- From: Doug Evans <dje at google dot com>
- To: Pedro Alves <palves at redhat dot com>, Eli Zaretskii <eliz at gnu dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 15 Jan 2014 13:25:22 -0800
- Subject: Re: [PUSHED] Fix go32-nat.c build fallout from to_detach constification.
- Authentication-results: sourceware.org; auth=none
- References: <52D6B91C dot 2030402 at redhat dot com> <83d2jt418x dot fsf at gnu dot org> <52D6C940 dot 3040008 at redhat dot com>
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;