Skip to content

Commit

Permalink
Update machinarium-gdb.py: add ignore-errors (#643)
Browse files Browse the repository at this point in the history
  • Loading branch information
reshke authored Jul 30, 2024
1 parent 1a02229 commit e8f89da
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion third_party/machinarium/gdb/machinarium-gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,25 @@ def invoke(self, args, is_tty):
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)

0 comments on commit e8f89da

Please sign in to comment.