Eric Pouech : winedbg: Add helper in gdbproxy mode to get proper address width information.
Alexandre Julliard
julliard at winehq.org
Fri Jul 2 14:46:40 CDT 2021
Module: wine
Branch: master
Commit: 40587a620e8d6db7cba0a31eca6986b12f645cb7
URL: https://source.winehq.org/git/wine.git/?a=commit;h=40587a620e8d6db7cba0a31eca6986b12f645cb7
Author: Eric Pouech <eric.pouech at gmail.com>
Date: Fri Jul 2 10:14:41 2021 +0200
winedbg: Add helper in gdbproxy mode to get proper address width information.
Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
programs/winedbg/gdbproxy.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c
index 4ccff1ea894..b8a8a1da2f8 100644
--- a/programs/winedbg/gdbproxy.c
+++ b/programs/winedbg/gdbproxy.c
@@ -702,6 +702,13 @@ static void get_thread_info(struct gdb_context* gdbctx, unsigned tid,
* =============================================== *
*/
+static int addr_width(struct gdb_context* gdbctx)
+{
+ int sz = (gdbctx && gdbctx->process && gdbctx->process->be_cpu) ?
+ gdbctx->process->be_cpu->pointer_size : (int)sizeof(void*);
+ return sz * 2;
+}
+
enum packet_return {packet_error = 0x00, packet_ok = 0x01, packet_done = 0x02,
packet_last_f = 0x80};
@@ -1343,7 +1350,7 @@ static void packet_query_monitor_wnd_helper(struct gdb_context* gdbctx, HWND hWn
"%*s%04lx%*s%-17.17s %08x %0*lx %.14s\n",
indent, "", (ULONG_PTR)hWnd, 13 - indent, "",
clsName, GetWindowLongW(hWnd, GWL_STYLE),
- ADDRWIDTH, (ULONG_PTR)GetWindowLongPtrW(hWnd, GWLP_WNDPROC),
+ addr_width(gdbctx), (ULONG_PTR)GetWindowLongPtrW(hWnd, GWLP_WNDPROC),
wndName);
packet_reply_hex_to_str(gdbctx, buffer);
packet_reply_close(gdbctx);
@@ -1468,8 +1475,8 @@ static void packet_query_monitor_mem(struct gdb_context* gdbctx, int len, const
}
packet_reply_open(gdbctx);
snprintf(buffer, sizeof(buffer), "%0*lx %0*lx %s %s %s\n",
- (unsigned)sizeof(void*), (DWORD_PTR)addr,
- (unsigned)sizeof(void*), mbi.RegionSize, state, type, prot);
+ addr_width(gdbctx), (DWORD_PTR)addr,
+ addr_width(gdbctx), mbi.RegionSize, state, type, prot);
packet_reply_add(gdbctx, "O");
packet_reply_hex_to_str(gdbctx, buffer);
packet_reply_close(gdbctx);
More information about the wine-cvs
mailing list