esp-idf/tools/idf_py_actions/errors.py
David Cermak 3b5c3d6521 idf.py: debug targets for easier execution of openocd, gdb, gdbui
Support for execution of asynchronous target, such as openocd, which
by default runs in the background, but if it's the only target idf.py
outputs the openocd in the console waiting for termination by user.

Supports also blocking commands gdb and gdbtui to start a debugging
session in an active console.

Supports running gdbgui running a UI debugging session in a browser
window, using the active console for other commands, such as openocd
or monitor.

Supports combining the debug targets in one action list, such as
idf.py openocd gdbgui monitor
2020-04-07 17:37:48 +02:00

11 lines
443 B
Python

class FatalError(RuntimeError):
"""
Wrapper class for runtime errors that aren't caused by bugs in idf.py or the build process.
"""
def __init__(self, message, ctx=None):
super(RuntimeError, self).__init__(message)
# if context is defined, check for the cleanup tasks
if ctx is not None and "cleanup" in ctx.meta:
# cleans up the environment before failure
ctx.meta["cleanup"]()