From f0823d2ce8e4cb8b64176872a372d8147804fb10 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 7 Feb 2012 19:47:16 +0000 Subject: PR python/12027: * python/python-internal.h (frame_object_type): Declare. * python/py-symbol.c (sympy_needs_frame): New function. (sympy_value): New function. (symbol_object_getset): Add "needs_frame". (symbol_object_methods): Add "value". * python/py-frame.c (frame_object_type): No longer static. gdb/doc * gdb.texinfo (Symbols In Python): Document Symbol.needs_frame and Symbol.value. gdb/testsuite * gdb.python/py-symbol.exp: Test Symbol.needs_frame and Symbol.value. * gdb.python/py-symbol.c (qq): Set default value. --- gdb/doc/ChangeLog | 5 +++++ gdb/doc/gdb.texinfo | 14 ++++++++++++++ 2 files changed, 19 insertions(+) (limited to 'gdb/doc') diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 8dd113e..19b61be 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,5 +1,10 @@ 2012-02-07 Tom Tromey + * gdb.texinfo (Symbols In Python): Document Symbol.needs_frame and + Symbol.value. + +2012-02-07 Tom Tromey + * gdb.texinfo (Symbols In Python): Document Symbol.line. 2012-01-27 Thomas Schwinge diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 052820b..02beed7 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -23993,6 +23993,11 @@ of a symbol. Each address class is a constant defined in the @code{gdb} module and described later in this chapter. @end defvar +@defvar Symbol.needs_frame +This is @code{True} if evaluating this symbol's value requires a frame +(@pxref{Frames In Python}) and @code{False} otherwise. Typically, +local variables will require a frame, but other symbols will not. + @defvar Symbol.is_argument @code{True} if the symbol is an argument of a function. @end defvar @@ -24020,6 +24025,15 @@ the symbol it refers to does not exist in @value{GDBN} any longer. All other @code{gdb.Symbol} methods will throw an exception if it is invalid at the time the method is called. @end defun + +@defun Symbol.value (@r{[}frame@r{]}) +Compute the value of the symbol, as a @code{gdb.Value}. For +functions, this computes the address of the function, cast to the +appropriate type. If the symbol requires a frame in order to compute +its value, then @var{frame} must be given. If @var{frame} is not +given, or if @var{frame} is invalid, then this method will throw an +exception. +@end defun @end table The available domain categories in @code{gdb.Symbol} are represented -- cgit v1.1