tools/minidumpserver.py: support quit with gdb

This patch supports quiting of minidumpserver along with gdb so that
to reduce usage efforts.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This commit is contained in:
Yanfeng Liu 2024-03-11 17:31:46 +08:00 committed by Xiang Xiao
parent 5ac401d941
commit 836715a2d6

View file

@ -587,6 +587,11 @@ class GDBStub:
def handle_general_query_packet(self, pkt):
self.put_gdb_packet(b"")
def handle_vkill_packet(self, pkt):
self.put_gdb_packet(b"OK")
logger.debug("quit with gdb")
sys.exit(0)
def run(self, socket: socket.socket):
self.socket = socket
@ -618,9 +623,9 @@ class GDBStub:
self.handle_memory_write_packet(pkt)
elif pkt_type == b"q":
self.handle_general_query_packet(pkt)
elif pkt_type == b"k":
elif pkt.startswith(b"vKill") or pkt_type == b"k":
# GDB quits
break
self.handle_vkill_packet(pkt)
else:
self.put_gdb_packet(b"")