binutils-gdb/gdb/python
Andrew Burgess c97e57bc9d gdb: move core file bfd from program_space into core_target
This commit moves the 'gdb_bfd_ref_ptr cbfd' out of program_space and
into core_target, where it is now called m_core_bfd.

I believe this change makes sense as the core_target instance holds
additional information that is parsed from the core file BFD, and so
storing the parsed information separately from the BFD doesn't make
much sense to me.

To minimise the churn in this commit, I have retained the
program_space::core_bfd member function as a temporary hack.  This
function forwards the request to the new function
get_inferior_core_bfd.  This works fine for now as
program_space::core_bfd is, after this commit, only called on the
current_program_space.  If this all seems like a total hack, then it
is, but don't worry too much, the next commit will clean this all up.

I was tempted to make the new function get_inferior_core_bfd, a member
function of the inferior class, inferior::core_bfd.  In fact, that
would have been my preferred change.  However, the new function needs
visibility of the core_target class, which, right now is private
within the corelow.c file.

This shouldn't be a problem, we could just declare the member function
in inferior.h, and implement the function in corelow.c.  But this
would mean the implementation of inferior::core_bfd, would not live in
inferior.c.  Previously when I've implemented member functions outside
their natural home (e.g. an inferior function not in inferior.c) I've
received review feedback that this is not desirable.  So, for now,
I've gone with a free function.

I also needed to change get_current_core_target, renaming it to
get_core_target, and taking an inferior as an argument.  Existing call
sites are updated to pass 'current_inferior ()', but
get_inferior_core_bfd passes something that might not be the current
inferior.

There should be no user visible changes after this commit.

Approved-By: Tom Tromey <tom@tromey.com>
2025-10-08 13:29:06 +01:00
..
lib/gdb Remove 'sys' import from frame_filters.py 2025-10-07 13:08:19 -06:00
py-all-events.def Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-arch.c gdb/python: add void_type () method to gdb.Architecture object 2025-02-04 13:56:49 +00:00
py-auto-load.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-block.c gdb/python: check return value of PyObject_New in all cases 2025-08-21 11:47:17 +01:00
py-bpevent.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-breakpoint.c Change file initialization to use INIT_GDB_FILE macro 2025-06-26 06:15:59 -06:00
py-cmd.c gdb/python/guile: remove some explicit calls to xmalloc 2025-06-06 23:46:47 +01:00
py-color.c gdb/python/guile: check if styling is disabled in Color.escape_sequence 2025-05-06 11:24:28 +01:00
py-color.h Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-connection.c Change file initialization to use INIT_GDB_FILE macro 2025-06-26 06:15:59 -06:00
py-continueevent.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-corefile.c gdb: move core file bfd from program_space into core_target 2025-10-08 13:29:06 +01:00
py-dap.c Change file initialization to use INIT_GDB_FILE macro 2025-06-26 06:15:59 -06:00
py-disasm.c gdb/python: check return from final PyObject_New in py-disasm.c 2025-08-28 15:51:16 +01:00
py-event-types.def Have gdb.ThreadExitedEvent inherit from gdb.ThreadEvent 2025-09-18 08:07:49 -06:00
py-event.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-event.h Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-events.h Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-evtregistry.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-evts.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-exitedevent.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-finishbreakpoint.c gdb: modernize get_frame_pc_if_available 2025-08-14 13:40:19 -03:00
py-frame.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-framefilter.c gdb: rename address_class -> location_class 2025-08-19 09:49:46 -04:00
py-function.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-gdb-readline.c Require Python 3.4 2025-05-30 07:09:53 -06:00
py-inferior.c gdb/python: introduce gdb.Corefile API 2025-10-06 16:56:55 +01:00
py-infevents.c gdb/python: return gdbpy_ref<> from gdbpy_create_ptid_object 2025-08-26 22:02:40 +01:00
py-infthread.c gdb/python: return gdbpy_ref<> from gdbpy_create_ptid_object 2025-08-26 22:02:40 +01:00
py-instruction.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-instruction.h Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-lazy-string.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-linetable.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-membuf.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-mi.c Use gnulib c-ctype module in gdb 2025-09-09 11:59:04 -06:00
py-micmd.c Use gnulib c-ctype module in gdb 2025-09-09 11:59:04 -06:00
py-newobjfileevent.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-objfile.c Use gnulib c-ctype module in gdb 2025-09-09 11:59:04 -06:00
py-param.c gdb/python: allow empty gdb.Parameter.__doc__ string 2025-05-13 14:33:20 +01:00
py-prettyprint.c gdb: change objfiles_iterator to yield references 2025-10-07 16:22:15 -04:00
py-progspace.c gdb: change objfiles_iterator to yield references 2025-10-07 16:22:15 -04:00
py-record-btrace.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-record-btrace.h Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-record-full.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-record-full.h Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-record.c gdb/python: check return value of PyObject_New in all cases 2025-08-21 11:47:17 +01:00
py-record.h Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-ref.h Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-registers.c gdb/python: don't use PyObject_IsInstance in py-registers.c 2025-04-23 23:50:22 +01:00
py-signalevent.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-stopevent.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-stopevent.h Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-style.c gdb/python: extend gdb.write to support styled output 2025-10-05 13:48:06 +01:00
py-symbol.c gdb: change objfiles_iterator to yield references 2025-10-07 16:22:15 -04:00
py-symtab.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-threadevent.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-tui.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-type.c Fix bug in gdb.lookup_type 2025-09-30 08:08:30 -06:00
py-uiout.h Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-unwind.c gdb/python: check return value of PyObject_New in all cases 2025-08-21 11:47:17 +01:00
py-utils.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-value.c Fix gdb.Value.dynamic_type attribute 2025-09-09 21:11:27 +02:00
py-varobj.c Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00
py-xmethods.c gdb: change objfiles_iterator to yield references 2025-10-07 16:22:15 -04:00
python-config.py Run isort 2024-04-02 11:21:39 -06:00
python-internal.h gdb/python: introduce gdb.Corefile API 2025-10-06 16:56:55 +01:00
python.c gdb/python: extend gdb.write to support styled output 2025-10-05 13:48:06 +01:00
python.h Update copyright dates to include 2025 2025-04-08 10:54:39 -06:00