diff options
author | Doug Evans <dje@google.com> | 2011-02-22 22:48:12 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2011-02-22 22:48:12 +0000 |
commit | 6e6fbe60bc0412fec955d539b445b66b14a04e69 (patch) | |
tree | 369fa1e0716583cb0acf3890749ec42a6d0fae4b /gdb/doc | |
parent | 1d41d745ca37dc95f93c8e1a148b3c46c85d7273 (diff) | |
download | gdb-6e6fbe60bc0412fec955d539b445b66b14a04e69.zip gdb-6e6fbe60bc0412fec955d539b445b66b14a04e69.tar.gz gdb-6e6fbe60bc0412fec955d539b445b66b14a04e69.tar.bz2 |
Add gdb.lookup_global_symbol python function.
* NEWS: Add entry.
* python/py-symbol.c (gdbpy_lookup_global_symbol): New function.
* python/python-internal.h (gdbpy_lookup_global_symbol): Declare it.
* python/python.c (GdbMethods): Add entry for lookup_global_symbol.
doc/
* gdb.texinfo (Symbols In Python): Document lookup_global_symbol.
Clarify behaviour of lookup_symbol when `block' argument is omitted,
add description of result, fix @defun formatting.
testsuite/
* gdb.python/py-symbol.exp: Test lookup_global_symbol.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 27 |
2 files changed, 31 insertions, 2 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index ee9a63f..8d9ce1d 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,9 @@ +2011-02-22 Doug Evans <dje@google.com> + + * gdb.texinfo (Symbols In Python): Document lookup_global_symbol. + Clarify behaviour of lookup_symbol when `block' argument is omitted, + add description of result, fix @defun formatting. + 2011-02-21 Hui Zhu <teawater@gmail.com> * agentexpr.texi (Bytecode Descriptions): Add printf. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index f8b7e2d..74a626e 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -22829,7 +22829,7 @@ The following symbol-related functions are available in the @code{gdb} module: @findex gdb.lookup_symbol -@defun lookup_symbol name [block] [domain] +@defun lookup_symbol name @r{[}block@r{]} @r{[}domain@r{]} This function searches for a symbol by name. The search scope can be restricted to the parameters defined in the optional domain and block arguments. @@ -22837,10 +22837,33 @@ arguments. @var{name} is the name of the symbol. It must be a string. The optional @var{block} argument restricts the search to symbols visible in that @var{block}. The @var{block} argument must be a -@code{gdb.Block} object. The optional @var{domain} argument restricts +@code{gdb.Block} object. If omitted, the block for the current frame +is used. The optional @var{domain} argument restricts the search to the domain type. The @var{domain} argument must be a domain constant defined in the @code{gdb} module and described later in this chapter. + +The result is a tuple of two elements. +The first element is a @code{gdb.Symbol} object or @code{None} if the symbol +is not found. +If the symbol is found, the second element is @code{True} if the symbol +is a field of a method's object (e.g., @code{this} in @code{C++}), +otherwise it is @code{False}. +If the symbol is not found, the second element is @code{False}. +@end defun + +@findex gdb.lookup_global_symbol +@defun lookup_global_symbol name @r{[}domain@r{]} +This function searches for a global symbol by name. +The search scope can be restricted to by the domain argument. + +@var{name} is the name of the symbol. It must be a string. +The optional @var{domain} argument restricts the search to the domain type. +The @var{domain} argument must be a domain constant defined in the @code{gdb} +module and described later in this chapter. + +The result is a @code{gdb.Symbol} object or @code{None} if the symbol +is not found. @end defun A @code{gdb.Symbol} object has the following attributes: |