aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Koning <paul_koning@dell.com>2015-10-13 14:53:43 -0400
committerPaul Koning <paul_koning@dell.com>2015-10-13 14:53:43 -0400
commit41f0b53b94eb41ba14a5439b965d516c449d6d64 (patch)
tree225079520a17668fb7fb436aa0de2326f12d6b0a
parentc5bcd27856f388ae4935b525b1016e812803ddf5 (diff)
downloadgdb-41f0b53b94eb41ba14a5439b965d516c449d6d64.zip
gdb-41f0b53b94eb41ba14a5439b965d516c449d6d64.tar.gz
gdb-41f0b53b94eb41ba14a5439b965d516c449d6d64.tar.bz2
move core_bfd to program space
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.
-rw-r--r--gdb/corefile.c4
-rw-r--r--gdb/gdbcore.h2
-rw-r--r--gdb/progspace.h3
3 files changed, 4 insertions, 5 deletions
diff --git a/gdb/corefile.c b/gdb/corefile.c
index 31301cf..a860ce3 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -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;
diff --git a/gdb/gdbcore.h b/gdb/gdbcore.h
index 0c08b37..03231e8 100644
--- a/gdb/gdbcore.h
+++ b/gdb/gdbcore.h
@@ -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;
diff --git a/gdb/progspace.h b/gdb/progspace.h
index 48f206e..cbb3f2b 100644
--- a/gdb/progspace.h
+++ b/gdb/progspace.h
@@ -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;
};