Rémi Bernon : winedbg: Cleanup return for kill and status packets.
Alexandre Julliard
julliard at winehq.org
Tue Mar 31 16:44:25 CDT 2020
Module: wine
Branch: master
Commit: eba6b38ba3665eb164ee0d6c301cc57d54ae1a4d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=eba6b38ba3665eb164ee0d6c301cc57d54ae1a4d
Author: Rémi Bernon <rbernon at codeweavers.com>
Date: Tue Mar 31 15:12:31 2020 +0200
winedbg: Cleanup return for kill and status packets.
There's a special packet_last_f flag to indicate we should quit, use
that on kill packet instead of exiting abruptly.
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
programs/winedbg/gdbproxy.c | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c
index a9f9210f52..02522ea319 100644
--- a/programs/winedbg/gdbproxy.c
+++ b/programs/winedbg/gdbproxy.c
@@ -814,15 +814,12 @@ static inline void packet_reply_register_hex_to(struct gdb_context* gdbctx, unsi
static enum packet_return packet_reply_status(struct gdb_context* gdbctx)
{
- enum packet_return ret = packet_done;
-
- packet_reply_open(gdbctx);
-
if (gdbctx->process != NULL)
{
unsigned char sig;
unsigned i;
+ packet_reply_open(gdbctx);
packet_reply_add(gdbctx, "T");
sig = gdbctx->last_sig;
packet_reply_val(gdbctx, sig, 1);
@@ -840,19 +837,17 @@ static enum packet_return packet_reply_status(struct gdb_context* gdbctx)
packet_reply_register_hex_to(gdbctx, i);
packet_reply_add(gdbctx, ";");
}
+
+ packet_reply_close(gdbctx);
+ return packet_done;
}
else
{
/* Try to put an exit code
* Cannot use GetExitCodeProcess, wouldn't fit in a 8 bit value, so
* just indicate the end of process and exit */
- packet_reply_add(gdbctx, "W00");
- /*if (!gdbctx->extended)*/ ret |= packet_last_f;
+ return packet_reply(gdbctx, "W00") | packet_last_f;
}
-
- packet_reply_close(gdbctx);
-
- return ret;
}
#if 0
@@ -1159,10 +1154,7 @@ static enum packet_return packet_kill(struct gdb_context* gdbctx)
if (!gdbctx->extended)
/* dunno whether GDB cares or not */
#endif
- wait(NULL);
- exit(0);
- /* assume we can't really answer something here */
- /* return packet_done; */
+ return packet_ok | packet_last_f;
}
static enum packet_return packet_thread(struct gdb_context* gdbctx)
More information about the wine-cvs
mailing list