Update machinarium-gdb.py: add ignore-errors (#643)

This commit is contained in:
reshke 2024-07-30 11:34:30 +05:00 committed by GitHub
parent 1a02229806
commit e8f89da9e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 18 additions and 1 deletions

View File

@ -489,8 +489,25 @@ Example:
self._execute_in_coroutine_context(thread, coro, gdbcmd)
class IgnoreErrorsCmd (gdb.Command):
"""Execute a single command, ignoring all errors.
Only one-line commands are supported.
This is primarily useful in scripts."""
def __init__ (self):
super (IgnoreErrorsCommand, self).__init__ ("ignore-errors",
gdb.COMMAND_OBSCURE,
# FIXME...
gdb.COMPLETE_COMMAND)
def invoke (self, arg, from_tty):
try:
gdb.execute (arg, from_tty)
except:
pass
MMCoroutines()
MMCoroutineCmd()
IgnoreErrorsCmd ()
gdb.write('done.\n', stream=gdb.STDLOG)