Brendan Shanks : winedbg: Implement GDB qGetTIBAddr query.

Alexandre Julliard julliard at winehq.org
Wed Jul 27 16:15:58 CDT 2022


Module: wine
Branch: master
Commit: d3b72d0ff14834156bd91d6c4255012db9b77416
URL:    https://gitlab.winehq.org/wine/wine/-/commit/d3b72d0ff14834156bd91d6c4255012db9b77416

Author: Brendan Shanks <bshanks at codeweavers.com>
Date:   Tue Jul 26 10:39:56 2022 -0700

winedbg: Implement GDB qGetTIBAddr query.

---

 programs/winedbg/gdbproxy.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c
index 643860d55ee..1999c103372 100644
--- a/programs/winedbg/gdbproxy.c
+++ b/programs/winedbg/gdbproxy.c
@@ -2047,6 +2047,27 @@ static enum packet_return packet_query(struct gdb_context* gdbctx)
             return packet_done;
         }
         break;
+    case 'G':
+        if (gdbctx->in_packet_len > 10 &&
+            strncmp(gdbctx->in_packet, "GetTIBAddr", 10) == 0 &&
+            gdbctx->in_packet[10] == ':')
+        {
+            unsigned    tid;
+            char*       end;
+            struct dbg_thread* thd;
+
+            tid = strtol(gdbctx->in_packet + 11, &end, 16);
+            if (end == NULL) break;
+
+            thd = dbg_get_thread(gdbctx->process, tid);
+            if (thd == NULL)
+                return packet_reply_error(gdbctx, HOST_EINVAL);
+            packet_reply_open(gdbctx);
+            packet_reply_val(gdbctx, (ULONG_PTR)thd->teb, sizeof(thd->teb));
+            packet_reply_close(gdbctx);
+            return packet_done;
+        }
+        break;
     case 'O':
         if (strncmp(gdbctx->in_packet, "Offsets", gdbctx->in_packet_len) == 0)
         {




More information about the wine-cvs mailing list