diff options
author | Tom Tromey <tromey@adacore.com> | 2024-11-21 12:32:53 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2024-12-09 13:52:54 -0700 |
commit | d50cf1cea853395da5fcd13c0d116a7332edff26 (patch) | |
tree | 7cd49cdd3bca880f3b317757ac7c355be9f98174 /gdb/python | |
parent | 7b46460a619a9b5719d1e79226bf371bbf29c7d2 (diff) | |
download | binutils-d50cf1cea853395da5fcd13c0d116a7332edff26.zip binutils-d50cf1cea853395da5fcd13c0d116a7332edff26.tar.gz binutils-d50cf1cea853395da5fcd13c0d116a7332edff26.tar.bz2 |
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>
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/lib/gdb/dap/launch.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gdb/python/lib/gdb/dap/launch.py b/gdb/python/lib/gdb/dap/launch.py index 65444bf..6444c8b 100644 --- a/gdb/python/lib/gdb/dap/launch.py +++ b/gdb/python/lib/gdb/dap/launch.py @@ -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") |