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/exec.c | |
parent | 9ad8c5832d0092e1c02069b1189ec0ff59089957 (diff) | |
download | binutils-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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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. */ |