diff --git a/tools/idf_py_actions/debug_ext.py b/tools/idf_py_actions/debug_ext.py index ebc7dd317b..1140103f91 100644 --- a/tools/idf_py_actions/debug_ext.py +++ b/tools/idf_py_actions/debug_ext.py @@ -396,11 +396,6 @@ def action_extensions(base_actions: Dict, project_path: str) -> Dict: if task.name in ('gdb', 'gdbgui', 'gdbtui'): task.action_args['require_openocd'] = True - def run_gdb(gdb_args: List) -> int: - p = subprocess.Popen(gdb_args) - processes['gdb'] = p - return p.wait() - def gdbtui(action: str, ctx: Context, args: PropertyDict, gdbinit: str, require_openocd: bool) -> None: """ Synchronous GDB target with text ui mode @@ -422,11 +417,11 @@ def action_extensions(base_actions: Dict, project_path: str) -> Dict: args += ['-tui'] if batch: args += ['--batch'] - t = Thread(target=run_gdb, args=(args,)) - t.start() + p = subprocess.Popen(args) + processes['gdb'] = p while True: try: - t.join() + p.wait() break except KeyboardInterrupt: # Catching Keyboard interrupt, as this is used for breaking running program in gdb