diff options
author | Doug Evans <dje@google.com> | 2014-12-12 09:48:13 -0800 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2014-12-12 09:48:13 -0800 |
commit | 6dddd6a5747532ef6e9703432c51680011df4e8d (patch) | |
tree | 35083e8dddfb1148d20dc1dc6808c05df7b8bb8a /gdb/doc | |
parent | f161c17134bdfa5f5e72d7afb7dfccf5599a67e1 (diff) | |
download | gdb-6dddd6a5747532ef6e9703432c51680011df4e8d.zip gdb-6dddd6a5747532ef6e9703432c51680011df4e8d.tar.gz gdb-6dddd6a5747532ef6e9703432c51680011df4e8d.tar.bz2 |
New python function gdb.lookup_objfile.
gdb/ChangeLog:
* NEWS: Mention gdb.lookup_objfile.
* python/python.c (GdbMethods): Add lookup_objfile.
* python/python-internal.h (gdbpy_lookup_objfile): Declare.
* python/py-objfile.c: #include "symtab.h".
(objfpy_build_id_ok, objfpy_build_id_matches): New functions.
(objfpy_lookup_objfile_by_name): New function.
(objfpy_lookup_objfile_by_build_id): New function.
(gdbpy_lookup_objfile): New function.
gdb/doc/ChangeLog:
* python.texi (Objfiles In Python): Document gdb.lookup_objfile.
gdb/testsuite/ChangeLog:
* lib/gdb-python.exp (get_python_valueof): New function.
* gdb.python/py-objfile.exp: Add tests for gdb.lookup_objfile.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/doc/python.texi | 21 |
2 files changed, 25 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index b8152df..9b36c37 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,7 @@ +2014-12-12 Doug Evans <dje@google.com> + + * python.texi (Objfiles In Python): Document gdb.lookup_objfile. + 2014-12-12 Andreas Arnez <arnez@linux.vnet.ibm.com> * gdb.texinfo: Document "maint print user-registers". diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index efd258d..234ce5c 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -3488,6 +3488,27 @@ Return a sequence of all the objfiles current known to @value{GDBN}. @xref{Objfiles In Python}. @end defun +@findex gdb.lookup_objfile +@defun gdb.lookup_objfile (name @r{[}, by_build_id{]}) +Look up @var{name}, a file name or build ID, in the list of objfiles +for the current program space (@pxref{Progspaces In Python}). +If the objfile is not found throw the Python @code{ValueError} exception. + +If @var{name} is a relative file name, then it will match any +source file name with the same trailing components. For example, if +@var{name} is @samp{gcc/expr.c}, then it will match source file +name of @file{/build/trunk/gcc/expr.c}, but not +@file{/build/trunk/libcpp/expr.c} or @file{/build/trunk/gcc/x-expr.c}. + +If @var{by_build_id} is provided and is @code{True} then @var{name} +is the build ID of the objfile. Otherwise, @var{name} is a file name. +This is supported only on some operating systems, notably those which use +the ELF format for binary files and the @sc{gnu} Binutils. For more details +about this feature, see the description of the @option{--build-id} +command-line option in @ref{Options, , Command Line Options, ld.info, +The GNU Linker}. +@end defun + Each objfile is represented by an instance of the @code{gdb.Objfile} class. |