diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2024-05-30 14:53:54 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2024-06-07 23:09:03 -0400 |
commit | 0a70e1a8a94b29d9fe461d0a401f7c2d02f8c441 (patch) | |
tree | 5ae3a4d8a02f58e11b6fc168e2451a12ee7f65af /gdb/infcmd.c | |
parent | 9ad8c5832d0092e1c02069b1189ec0ff59089957 (diff) | |
download | fsf-binutils-gdb-0a70e1a8a94b29d9fe461d0a401f7c2d02f8c441.zip fsf-binutils-gdb-0a70e1a8a94b29d9fe461d0a401f7c2d02f8c441.tar.gz fsf-binutils-gdb-0a70e1a8a94b29d9fe461d0a401f7c2d02f8c441.tar.bz2 |
gdb: replace `get_exec_file (0)` calls with `current_program_space->exec_filename ()`
Calls of `get_exec_file (0)` are equivalent to just getting the exec
filename from the current program space. I'm looking to remove
`get_exec_file`, so replace these uses with
`current_program_space->exec_filename ()`.
Remove the `err` parameter of `get_exec_wrapper` since all the calls
that remain pass 1, meaning to error out if no executable is specified.
Change-Id: I7729ea4c7f03dbb046211cc5aa3858ab3a551965
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r-- | gdb/infcmd.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 69db665..71514d5 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -368,7 +368,6 @@ enum run_how static void run_command_1 (const char *args, int from_tty, enum run_how run_how) { - const char *exec_file; struct ui_out *uiout = current_uiout; struct target_ops *run_target; int async_exec; @@ -422,7 +421,7 @@ run_command_1 (const char *args, int from_tty, enum run_how run_how) tbreak_command (arg.c_str (), 0); } - exec_file = get_exec_file (0); + const char *exec_file = current_program_space->exec_filename (); /* We keep symbols from add-symbol-file, on the grounds that the user might want to add some symbols before running the program @@ -2498,7 +2497,7 @@ setup_inferior (int from_tty) /* If no exec file is yet known, try to determine it from the process itself. */ - if (get_exec_file (0) == nullptr) + if (current_program_space->exec_filename () == nullptr) exec_file_locate_attach (inferior_ptid.pid (), 1, from_tty); else { |