mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 16:40:42 +08:00
34 lines
795 B
Python
34 lines
795 B
Python
|
|
# SPDX-FileCopyrightText: 2026 Ernie Pasveer <epasveer@att.net>
|
||
|
|
#
|
||
|
|
# SPDX-License-Identifier: MIT
|
||
|
|
|
||
|
|
import re
|
||
|
|
|
||
|
|
#
|
||
|
|
# Python MI command to support gdb's "start" commands.
|
||
|
|
#
|
||
|
|
|
||
|
|
class MIMonitor(gdb.MICommand):
|
||
|
|
"""
|
||
|
|
Send a command to gdb's monitor.
|
||
|
|
|
||
|
|
-monitor-exec Rin a command in gdb's monitor.
|
||
|
|
|
||
|
|
See:
|
||
|
|
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Server.html
|
||
|
|
"""
|
||
|
|
|
||
|
|
def __init__(self, name, mode):
|
||
|
|
self._mode = mode
|
||
|
|
super(MIMonitor, self).__init__(name)
|
||
|
|
|
||
|
|
def invoke(self, argv):
|
||
|
|
if self._mode == "exec":
|
||
|
|
gdb.execute ("monitor " + " ".join(argv), to_string=True)
|
||
|
|
return None
|
||
|
|
else:
|
||
|
|
raise gdb.GdbError("monitor: Invalid parameter: %s" % self._mode)
|
||
|
|
|
||
|
|
MIMonitor("-monitor-exec", "exec")
|
||
|
|
|