Fix library segment-address for 64bit values
Commit Message
The address was written as a long value, but long is always a 32bit value
on Windows.
The solution was to use paddress instead.
gdb/gdbserver/ChangeLog:
2020-01-28 Hannes Domani <ssbssa@yahoo.de>
* server.c (handle_qxfer_libraries): Write segment-address with
paddress.
---
gdb/gdbserver/server.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On 2020-01-28 12:37 p.m., Hannes Domani via gdb-patches wrote:
> The address was written as a long value, but long is always a 32bit value
> on Windows.
Perhaps just mention: ", which lead to truncated addresses.".
The patch LGTM with that fixed, you can push it to both master and the gdb-9-branch.
Note that searching for '(long)' in that file reveals that there are probably more
instances of this problem.
Thanks,
Simon
Am Dienstag, 28. Januar 2020, 19:47:38 MEZ hat Simon Marchi <simark@simark.ca> Folgendes geschrieben:
> On 2020-01-28 12:37 p.m., Hannes Domani via gdb-patches wrote:
>
> > The address was written as a long value, but long is always a 32bit value
> > on Windows.
>
>
> Perhaps just mention: ", which lead to truncated addresses.".
>
> The patch LGTM with that fixed, you can push it to both master and the gdb-9-branch.
Pushed to both with this change, thanks.
>
> Note that searching for '(long)' in that file reveals that there are probably more
> instances of this problem.
I will keep that in mind.
@@ -1548,8 +1548,8 @@ handle_qxfer_libraries (const char *annex,
for (const dll_info &dll : all_dlls)
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));
document += "</library-list>\n";