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
This commit is contained in:
David Cermak
2019-07-23 21:37:31 +02:00
parent 3116dfede7
commit 3b5c3d6521
5 changed files with 416 additions and 6 deletions

View File

@@ -78,7 +78,7 @@ def action_extensions(base_actions, project_path):
if not os.path.exists(elf_file):
raise FatalError("ELF file '%s' not found. You need to build & flash the project before running 'monitor', "
"and the binary on the device must match the one in the build directory exactly. "
"Try '%s flash monitor'." % (elf_file, ctx.info_name))
"Try '%s flash monitor'." % (elf_file, ctx.info_name), ctx)
idf_monitor = os.path.join(os.environ["IDF_PATH"], "tools/idf_monitor.py")
monitor_args = [PYTHON, idf_monitor]
if args.port is not None: