aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python.h
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2022-04-11 16:44:36 +0200
committerMarkus Metzger <markus.t.metzger@intel.com>2022-10-18 14:16:09 +0200
commit85933f7c91b668e42ae5ff27f432917328828468 (patch)
treebbc6942a880dfd256a7f7fd63cc838f04a8f17a3 /gdb/python/python.h
parentfb4f3f38e98599690946cc24b09ae6883a36edb0 (diff)
downloadfsf-binutils-gdb-85933f7c91b668e42ae5ff27f432917328828468.zip
fsf-binutils-gdb-85933f7c91b668e42ae5ff27f432917328828468.tar.gz
fsf-binutils-gdb-85933f7c91b668e42ae5ff27f432917328828468.tar.bz2
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.
Diffstat (limited to 'gdb/python/python.h')
-rw-r--r--gdb/python/python.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/python/python.h b/gdb/python/python.h
index 4b150c3..2be83ba 100644
--- a/gdb/python/python.h
+++ b/gdb/python/python.h
@@ -28,4 +28,10 @@ extern const struct extension_language_defn extension_language_python;
/* Command element for the 'python' command. */
extern cmd_list_element *python_cmd_element;
+/* 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. */
+extern struct objfile *gdbpy_current_objfile;
+
#endif /* PYTHON_PYTHON_H */