Propose we release GDB 9.1 next weekend (Feb 01-02)

Simon Marchi simark@simark.ca
Tue Jan 28 17:16:00 GMT 2020


On 2020-01-28 11:53 a.m., Hannes Domani via gdb-patches wrote:
> I just noticed that gdbserver is a bit broken for x86_64-mingw (and I think
> it always was).>
> Reason for it is this part in gdbserver/server.c:
> 
>     document += string_printf
>       ("  <library name=\"%s\"><segment address=\"0x%lx\"/></library>\n",
>        dll.name.c_str (), (long) dll.base_addr);
> 
> (long) is always 32bit on Windows, so the upper bits are cut off.

Indeed.  That code went through several refactors, but originally it was introduced
by this 2007 commit:

  https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=255e7678a93693bd4d16cc3246442a1b8e11064e

which has this line:

  sprintf (p, "0x%lx", (long) dll->base_addr);

So I think the bug has been there forever.

> Fix seems simple:
> 
>      document += string_printf
> -      ("  <library name=\"%s\"><segment address=\"0x%lx\"/></library>\n",
> -       dll.name.c_str (), (long) dll.base_addr);
> +      ("  <library name=\"%s\"><segment address=\"0x%s\"/></library>\n",
> +       dll.name.c_str (), paddress (dll.base_addr));
> 
> I just tested it and this improves the debugging experience a lot.
> 
> But I guess this is probably too late for the release.

I don't think it so, we can always push fixes to the release branch.  This one
seems desirable and not risky at all, so I think it would be fine.  Would you
be willing to submit a complete patch for this?

Simon



More information about the Gdb-patches mailing list