aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-10-29 15:04:33 -0600
committerTom Tromey <tom@tromey.com>2020-10-29 15:04:35 -0600
commit5a36e71525564fe8767bc9f00b29dcc0fec59837 (patch)
treefd0bf48773db5a424b7e2cd9e5b18e0b08fc0770 /gdb
parent784c859246ae2cf3ffa07376cfe8ec60e4526e57 (diff)
downloadgdb-5a36e71525564fe8767bc9f00b29dcc0fec59837.zip
gdb-5a36e71525564fe8767bc9f00b29dcc0fec59837.tar.gz
gdb-5a36e71525564fe8767bc9f00b29dcc0fec59837.tar.bz2
Remove exec_bfd_mtime define
This removes the exec_bfd_mtime define, in favor of directly using the appropriate member of the current program space. gdb/ChangeLog 2020-10-29 Tom Tromey <tom@tromey.com> * source-cache.c (source_cache::get_plain_source_lines): Use current_program_space. * corefile.c (reopen_exec_file): Use current_program_space. * exec.c (exec_file_attach): Use current_program_space. * exec.h (exec_bfd_mtime): Remove.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/corefile.c4
-rw-r--r--gdb/exec.c2
-rw-r--r--gdb/exec.h1
-rw-r--r--gdb/source-cache.c2
5 files changed, 13 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 13d6e56..b47133e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
2020-10-29 Tom Tromey <tom@tromey.com>
+ * source-cache.c (source_cache::get_plain_source_lines): Use
+ current_program_space.
+ * corefile.c (reopen_exec_file): Use current_program_space.
+ * exec.c (exec_file_attach): Use current_program_space.
+ * exec.h (exec_bfd_mtime): Remove.
+
+2020-10-29 Tom Tromey <tom@tromey.com>
+
* gcore.c (default_gcore_mach): Remove.
(create_gcore_bfd): Update.
diff --git a/gdb/corefile.c b/gdb/corefile.c
index c1eec19..1586e9f 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -115,7 +115,9 @@ reopen_exec_file (void)
std::string filename = bfd_get_filename (exec_bfd);
res = stat (filename.c_str (), &st);
- if (res == 0 && exec_bfd_mtime && exec_bfd_mtime != st.st_mtime)
+ if (res == 0
+ && current_program_space->ebfd_mtime
+ && current_program_space->ebfd_mtime != st.st_mtime)
exec_file_attach (filename.c_str (), 0);
else
/* If we accessed the file since last opening it, close it now;
diff --git a/gdb/exec.c b/gdb/exec.c
index 6459688..4345f35 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -482,7 +482,7 @@ exec_file_attach (const char *filename, int from_tty)
target_section_table sections = build_section_table (exec_bfd);
- exec_bfd_mtime = bfd_get_mtime (exec_bfd);
+ current_program_space->ebfd_mtime = bfd_get_mtime (exec_bfd);
validate_files ();
diff --git a/gdb/exec.h b/gdb/exec.h
index f98dd83..658112a 100644
--- a/gdb/exec.h
+++ b/gdb/exec.h
@@ -31,7 +31,6 @@ struct bfd;
struct objfile;
#define exec_bfd current_program_space->ebfd
-#define exec_bfd_mtime current_program_space->ebfd_mtime
/* Builds a section table, given args BFD. */
diff --git a/gdb/source-cache.c b/gdb/source-cache.c
index 9196e3a..c67d087 100644
--- a/gdb/source-cache.c
+++ b/gdb/source-cache.c
@@ -69,7 +69,7 @@ source_cache::get_plain_source_lines (struct symtab *s,
if (SYMTAB_OBJFILE (s) != NULL && SYMTAB_OBJFILE (s)->obfd != NULL)
mtime = SYMTAB_OBJFILE (s)->mtime;
else if (exec_bfd)
- mtime = exec_bfd_mtime;
+ mtime = current_program_space->ebfd_mtime;
if (mtime && mtime < st.st_mtime)
warning (_("Source file is more recent than executable."));