]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
move core_bfd to program space
authorPaul Koning <paul_koning@dell.com>
Tue, 13 Oct 2015 18:53:43 +0000 (14:53 -0400)
committerPaul Koning <paul_koning@dell.com>
Tue, 13 Oct 2015 18:53:43 +0000 (14:53 -0400)
This moves the core_bfd global to be a field of the program space.  It
then replaces core_bfd with a macro to avoid a massive patch -- the
same approach taken for various other program space fields.

This patch is a basic transformation for eventual multi-target work.

2014-07-29  Tom Tromey  <tromey@redhat.com>

* corefile.c (core_bfd): Remove.
* gdbcore.h (core_bfd): Now a macro.
* progspace.h (struct program_space) <cbfd>: New field.

gdb/corefile.c
gdb/gdbcore.h
gdb/progspace.h

index 31301cf4777f4b582c14b09b366bc2ab05963bd5..a860ce3c8e4b06422801f34553a3c0df5e619e31 100644 (file)
@@ -53,10 +53,6 @@ static hook_type *exec_file_extra_hooks;     /* Array of additional
                                                   hooks.  */
 static int exec_file_hook_count = 0;           /* Size of array.  */
 
-/* Binary file diddling handle for the core file.  */
-
-bfd *core_bfd = NULL;
-
 /* corelow.c target.  It is never NULL after GDB initialization.  */
 
 struct target_ops *core_target;
index 0c08b3739870f1b646bdf3141c49341b613ffe83..03231e8f25fd5a90a0a42cbb21c6492563b330e3 100644 (file)
@@ -136,7 +136,7 @@ extern void specify_exec_file_hook (void (*hook) (const char *filename));
 
 /* Binary File Diddler for the core file.  */
 
-extern bfd *core_bfd;
+#define core_bfd (current_program_space->cbfd)
 
 extern struct target_ops *core_target;
 
index 48f206e2e01c51cb4a5f8979b712bf81a864297c..cbb3f2b3d6e1db700b9eef49f398e7cbc0372190 100644 (file)
@@ -206,6 +206,9 @@ struct program_space
        This is so we can properly report solib changes to the user.  */
     VEC (char_ptr) *deleted_solibs;
 
+    /* Binary file diddling handle for the core file.  */
+    bfd *cbfd;
+
     /* Per pspace data-pointers required by other GDB modules.  */
     REGISTRY_FIELDS;
   };