aboutsummaryrefslogtreecommitdiff
path: root/gdb/exec.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2024-05-30 14:53:54 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2024-06-07 23:09:03 -0400
commit0a70e1a8a94b29d9fe461d0a401f7c2d02f8c441 (patch)
tree5ae3a4d8a02f58e11b6fc168e2451a12ee7f65af /gdb/exec.c
parent9ad8c5832d0092e1c02069b1189ec0ff59089957 (diff)
downloadbinutils-0a70e1a8a94b29d9fe461d0a401f7c2d02f8c441.zip
binutils-0a70e1a8a94b29d9fe461d0a401f7c2d02f8c441.tar.gz
binutils-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/exec.c')
-rw-r--r--gdb/exec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index 4fe4d3b..496f3b1 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -215,7 +215,7 @@ validate_exec_file (int from_tty)
if (exec_file_mismatch_mode == exec_file_mismatch_off)
return;
- const char *current_exec_file = get_exec_file (0);
+ const char *current_exec_file = current_program_space->exec_filename ();
struct inferior *inf = current_inferior ();
/* Try to determine a filename from the process itself. */
const char *pid_exec_file = target_pid_to_exec_file (inf->pid);
@@ -233,7 +233,7 @@ validate_exec_file (int from_tty)
did not change). If exec file changed, reopen_exec_file has
allocated another file name, so get_exec_file again. */
reopen_exec_file ();
- current_exec_file = get_exec_file (0);
+ current_exec_file = current_program_space->exec_filename ();
const bfd_build_id *exec_file_build_id
= build_id_bfd_get (current_program_space->exec_bfd ());
@@ -314,7 +314,7 @@ exec_file_locate_attach (int pid, int defer_bp_reset, int from_tty)
symfile_add_flags add_flags = 0;
/* Do nothing if we already have an executable filename. */
- if (get_exec_file (0) != NULL)
+ if (current_program_space->exec_filename () != nullptr)
return;
/* Try to determine a filename from the process itself. */