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:
parent
5ac401d941
commit
836715a2d6
@ -587,6 +587,11 @@ class GDBStub:
|
|||||||
def handle_general_query_packet(self, pkt):
|
def handle_general_query_packet(self, pkt):
|
||||||
self.put_gdb_packet(b"")
|
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):
|
def run(self, socket: socket.socket):
|
||||||
self.socket = socket
|
self.socket = socket
|
||||||
|
|
||||||
@ -618,9 +623,9 @@ class GDBStub:
|
|||||||
self.handle_memory_write_packet(pkt)
|
self.handle_memory_write_packet(pkt)
|
||||||
elif pkt_type == b"q":
|
elif pkt_type == b"q":
|
||||||
self.handle_general_query_packet(pkt)
|
self.handle_general_query_packet(pkt)
|
||||||
elif pkt_type == b"k":
|
elif pkt.startswith(b"vKill") or pkt_type == b"k":
|
||||||
# GDB quits
|
# GDB quits
|
||||||
break
|
self.handle_vkill_packet(pkt)
|
||||||
else:
|
else:
|
||||||
self.put_gdb_packet(b"")
|
self.put_gdb_packet(b"")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user