aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2026-03-17 14:53:48 +0000
committerAndrew Burgess <aburgess@redhat.com>2026-03-19 14:36:25 +0000
commite9feb8a0104f7b21ee1c70535d8c07f0447a5b0c (patch)
tree5722293dc4a543d0eb3d4e7670843e5c370f5351 /gdb/python
parent695fd5ec1221707c9edda3fabd1a980808a30fe1 (diff)
downloadbinutils-e9feb8a0104f7b21ee1c70535d8c07f0447a5b0c.tar.gz
binutils-e9feb8a0104f7b21ee1c70535d8c07f0447a5b0c.tar.bz2
binutils-e9feb8a0104f7b21ee1c70535d8c07f0447a5b0c.zip
gdb: change new_objfile observer to take an objfile reference
I was looking at the new_objfile observer and noticed a comment in reread_symbols (symfile.c) that seemed out of date, it talked about calling the new objfile observer with a NULL objfile argument. A little digging indicates that the comment is indeed out of date, and that we never call the new_objfile observer with a NULL argument any more. So in this commit I have: 1. Updated the out of date comment in reread_symbols. 2. Changed the argument type for the new_objfile observer from 'objfile *' to 'objfile &'. Passing a NULL pointer is no longer an option. 3. Updated the existing new_objfile observers to take 'objfile &' and updated their implementations as needed. There should be no user visible changes after this commit. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-inferior.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c
index ea9f884a397..1a30f4ee378 100644
--- a/gdb/python/py-inferior.c
+++ b/gdb/python/py-inferior.c
@@ -163,19 +163,18 @@ python_inferior_exit (struct inferior *inf)
gdbpy_print_stack ();
}
-/* Callback used to notify Python listeners about new objfiles loaded in the
- inferior. OBJFILE may be NULL which means that the objfile list has been
- cleared (emptied). */
+/* Callback used to notify Python listeners that OBJFILE has been loaded in
+ to the current inferior. */
static void
-python_new_objfile (struct objfile *objfile)
+python_new_objfile (struct objfile &objfile)
{
if (!gdb_python_initialized)
return;
- gdbpy_enter enter_py (objfile->arch ());
+ gdbpy_enter enter_py (objfile.arch ());
- if (emit_new_objfile_event (objfile) < 0)
+ if (emit_new_objfile_event (&objfile) < 0)
gdbpy_print_stack ();
}