Remove exec_bfd_mtime define
authorTom Tromey <tom@tromey.com>
Thu, 29 Oct 2020 21:04:33 +0000 (15:04 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 29 Oct 2020 21:04:35 +0000 (15:04 -0600)
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.

gdb/ChangeLog
gdb/corefile.c
gdb/exec.c
gdb/exec.h
gdb/source-cache.c

index 13d6e5693c4c1daecd915563aeca49336b22daa7..b47133e7b354bff8d7db522fd087967a982b44f1 100644 (file)
@@ -1,3 +1,11 @@
+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.
index c1eec199342adc3afe50981b5820e34572029b13..1586e9f175a0476e3a141f33378bcc88b7483607 100644 (file)
@@ -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;
index 6459688ad6d929fce092c0a92295572c14cc2200..4345f35b7f960737a212159a4b61f2436448d075 100644 (file)
@@ -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 ();
 
index f98dd83da215812285ec67b645b3f5554f109233..658112a0f280f9b155a2f7bf6d485dcfeb364b36 100644 (file)
@@ -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.  */
 
index 9196e3a19e3f60fcdab1225bd306e6a594f7bf7e..c67d087c76d1f45cf51276f5922c66ce3f3c2ab6 100644 (file)
@@ -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."));
This page took 0.035363 seconds and 4 git commands to generate.