From 41f0b53b94eb41ba14a5439b965d516c449d6d64 Mon Sep 17 00:00:00 2001 From: Paul Koning Date: Tue, 13 Oct 2015 14:53:43 -0400 Subject: 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 * corefile.c (core_bfd): Remove. * gdbcore.h (core_bfd): Now a macro. * progspace.h (struct program_space) : New field. --- gdb/corefile.c | 4 ---- gdb/gdbcore.h | 2 +- gdb/progspace.h | 3 +++ 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; }; -- cgit v1.1