mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
Merge branch 'bugfix/debug_ext_ctrl_c_v5.1' into 'release/v5.1'
tools: fix waiting on gdb process when interrupted with CTRL+C (v5.1) See merge request espressif/esp-idf!24933
This commit is contained in:
@@ -473,11 +473,6 @@ def action_extensions(base_actions: Dict, project_path: str) -> Dict:
|
|||||||
if task.name in ('gdb', 'gdbgui', 'gdbtui'):
|
if task.name in ('gdb', 'gdbgui', 'gdbtui'):
|
||||||
task.action_args['require_openocd'] = True
|
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:
|
def gdbtui(action: str, ctx: Context, args: PropertyDict, gdbinit: str, require_openocd: bool) -> None:
|
||||||
"""
|
"""
|
||||||
Synchronous GDB target with text ui mode
|
Synchronous GDB target with text ui mode
|
||||||
@@ -499,11 +494,11 @@ def action_extensions(base_actions: Dict, project_path: str) -> Dict:
|
|||||||
args += ['-tui']
|
args += ['-tui']
|
||||||
if batch:
|
if batch:
|
||||||
args += ['--batch']
|
args += ['--batch']
|
||||||
t = Thread(target=run_gdb, args=(args,))
|
p = subprocess.Popen(args)
|
||||||
t.start()
|
processes['gdb'] = p
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
t.join()
|
p.wait()
|
||||||
break
|
break
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
# Catching Keyboard interrupt, as this is used for breaking running program in gdb
|
# Catching Keyboard interrupt, as this is used for breaking running program in gdb
|
||||||
|
Reference in New Issue
Block a user