]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: remove program_space::core_bfd member function
authorAndrew Burgess <aburgess@redhat.com>
Wed, 10 Sep 2025 10:04:45 +0000 (11:04 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Wed, 8 Oct 2025 12:29:06 +0000 (13:29 +0100)
commit84f8be0d9c8ce30bf56eb9e14ce6fe012125fa53
tree68d0193ab60adb6df0d8a3a7aa54b5ef57bbcca8
parentc97e57bc9d2e081b7c842742933b7262f1d7ce39
gdb: remove program_space::core_bfd member function

This commit removes the program_space::core_bfd member function, which
was left in place as a temporary hack in the last commit in order to
reduce the size of the last commit.

In every place that 'current_program_space->core_bfd ()' was used I
now call 'get_inferior_core_bfd (current_inferior ())'.

I think there is further scope for improving things in the future,
reducing the number of times we access the core file via global state,
but doing that cleanup might be more involved than the clean up I've
done up to this point.  So I'm leaving that work for the future.

But I think in some places, at the top level (e.g. user command
functions), there's always going to be some cases where we just need
to access the current global state, this is just the nature of the
command handlers.

There should be no user visible changes after this commit.

Approved-By: Tom Tromey <tom@tromey.com>
13 files changed:
gdb/corefile.c
gdb/corelow.c
gdb/fbsd-tdep.c
gdb/linux-tdep.c
gdb/linux-thread-db.c
gdb/maint.c
gdb/progspace.c
gdb/progspace.h
gdb/record-full.c
gdb/sol-thread.c
gdb/solib-dsbt.c
gdb/solib-frv.c
gdb/symfile-mem.c