aboutsummaryrefslogtreecommitdiff
path: root/gdb/exec.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2024-05-30 14:53:53 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2024-06-07 23:09:03 -0400
commit9ad8c5832d0092e1c02069b1189ec0ff59089957 (patch)
treefedbd77064a2a4522f6cb6d15e40d7399ba07875 /gdb/exec.c
parent9102a6c15c756c55e77c0fa7deecfc58fa8a361e (diff)
downloadgdb-9ad8c5832d0092e1c02069b1189ec0ff59089957.zip
gdb-9ad8c5832d0092e1c02069b1189ec0ff59089957.tar.gz
gdb-9ad8c5832d0092e1c02069b1189ec0ff59089957.tar.bz2
gdb: make progspace::exec_filename private, add getter / setter
Just like the title says... I think this makes things a bit clearer, for instance where the exec filename is set. It also makes the read call sites a bit nicer, avoiding the `.get ()`. Change-Id: If8b58ae8f6270c8a34b868f6ca06128c6671ea3c Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/exec.c')
-rw-r--r--gdb/exec.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index 8891526..4fe4d3b 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -456,15 +456,15 @@ exec_file_attach (const char *filename, int from_tty)
/* gdb_realpath_keepfile resolves symlinks on the local
filesystem and so cannot be used for "target:" files. */
- gdb_assert (current_program_space->exec_filename == nullptr);
+ gdb_assert (current_program_space->exec_filename () == nullptr);
if (load_via_target)
- current_program_space->exec_filename
- = (make_unique_xstrdup
+ current_program_space->set_exec_filename
+ (make_unique_xstrdup
(bfd_get_filename (current_program_space->exec_bfd ())));
else
- current_program_space->exec_filename
- = make_unique_xstrdup (gdb_realpath_keepfile
- (scratch_pathname).c_str ());
+ current_program_space->set_exec_filename
+ (make_unique_xstrdup (gdb_realpath_keepfile
+ (scratch_pathname).c_str ()));
if (!bfd_check_format_matches (current_program_space->exec_bfd (),
bfd_object, &matching))