mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-01 03:41:58 +08:00
gdb, python: use gdbarch_iterate_over_objfiles_in_search_order
The implementation of gdb.lookup_objfile() iterates over all objfiles and compares their name or build id to the user-provided search string. This will cause problems when supporting linker namespaces as the first objfile in any namespace will be found. Instead, use gdbarch_iterate_over_objfiles_in_search_order to only consider the namespace of gdb.current_objfile() for the search, which defaults to the initial namespace when gdb.current_objfile() is None.
This commit is contained in:
@ -1583,11 +1583,8 @@ gdbpy_current_language (PyObject *unused1, PyObject *unused2)
|
||||
|
||||
|
||||
|
||||
/* The "current" objfile. This is set when gdb detects that a new
|
||||
objfile has been loaded. It is only set for the duration of a call to
|
||||
gdbpy_source_objfile_script and gdbpy_execute_objfile_script; it is NULL
|
||||
at other times. */
|
||||
static struct objfile *gdbpy_current_objfile;
|
||||
/* See python.h. */
|
||||
struct objfile *gdbpy_current_objfile;
|
||||
|
||||
/* Set the current objfile to OBJFILE and then read FILE named FILENAME
|
||||
as Python code. This does not throw any errors. If an exception
|
||||
|
Reference in New Issue
Block a user