Fix library segment-address for 64bit values
authorHannes Domani <ssbssa@yahoo.de>
Tue, 28 Jan 2020 17:24:31 +0000 (18:24 +0100)
committerHannes Domani <ssbssa@yahoo.de>
Tue, 28 Jan 2020 19:01:02 +0000 (20:01 +0100)
The address was written as a long value, but long is always a 32bit value
on Windows, which lead to truncated addresses.
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/ChangeLog
gdb/gdbserver/server.c

index aeb9cb6c77805e3b366ad557a6bfdee695487de4..a97e4082020d21e39baf07eb20c558e52f48ca04 100644 (file)
@@ -1,3 +1,8 @@
+2020-01-28  Hannes Domani  <ssbssa@yahoo.de>
+
+       * server.c (handle_qxfer_libraries): Write segment-address with
+       paddress.
+
 2020-01-24  Hannes Domani  <ssbssa@yahoo.de>
 
        * Makefile.in (install-strip): New target.
index 17e79a6ea016bea02bfab04c42ea24e75de36b79..3fc026f78ebba4db17134befd3b7607e68ed04ff 100644 (file)
@@ -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";