From: Paul Koning Date: Tue, 13 Oct 2015 18:53:43 +0000 (-0400) Subject: move core_bfd to program space X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41f0b53b94eb41ba14a5439b965d516c449d6d64;p=thirdparty%2Fbinutils-gdb.git 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. --- diff --git a/gdb/corefile.c b/gdb/corefile.c index 31301cf4777..a860ce3c8e4 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 0c08b373987..03231e8f25f 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 48f206e2e01..cbb3f2b3d6e 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; };