]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb, python: use gdbarch_iterate_over_objfiles_in_search_order
authorMarkus Metzger <markus.t.metzger@intel.com>
Mon, 11 Apr 2022 14:44:36 +0000 (16:44 +0200)
committerMarkus Metzger <markus.t.metzger@intel.com>
Tue, 18 Oct 2022 12:16:09 +0000 (14:16 +0200)
commit85933f7c91b668e42ae5ff27f432917328828468
treebbc6942a880dfd256a7f7fd63cc838f04a8f17a3
parentfb4f3f38e98599690946cc24b09ae6883a36edb0
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.
gdb/python/py-objfile.c
gdb/python/python.c
gdb/python/python.h