mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-19 01:19:41 +08:00
Reimplement DAP's stopAtBeginningOfMainSubprogram
Right now, stopAtBeginningOfMainSubprogram is implemented "by hand", but then later the launch function uses "starti" to implement stopOnEntry. This patch unifies this code and rewrites it to use "start" when appropriate. Reviewed-by: Kévin Le Gouguec <legouguec@adacore.com>
This commit is contained in:
@@ -53,17 +53,19 @@ def launch(
|
||||
if program is not None:
|
||||
file_command(program)
|
||||
inf = gdb.selected_inferior()
|
||||
if stopAtBeginningOfMainSubprogram:
|
||||
main = inf.main_name
|
||||
if main is not None:
|
||||
exec_and_log("tbreak " + main)
|
||||
inf.arguments = args
|
||||
if env is not None:
|
||||
inf.clear_env()
|
||||
for name, value in env.items():
|
||||
inf.set_env(name, value)
|
||||
expect_process("process")
|
||||
exec_and_expect_stop("starti" if stopOnEntry else "run")
|
||||
if stopAtBeginningOfMainSubprogram:
|
||||
cmd = "start"
|
||||
elif stopOnEntry:
|
||||
cmd = "starti"
|
||||
else:
|
||||
cmd = "run"
|
||||
exec_and_expect_stop(cmd)
|
||||
|
||||
|
||||
@request("attach")
|
||||
|
||||
Reference in New Issue
Block a user