summaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2009-12-03 18:30:02 +0000
committerTom Tromey <tromey@redhat.com>2009-12-03 18:30:02 +0000
commit57a1d736959fb92e39abab59511a903b7ec59547 (patch)
tree5ec223f0d33bfe64a7583c5993325705b1fad1cc /gdb/doc
parentfb169834478e0db3ffe865300c0cf4556160c7bd (diff)
downloadbinutils-gdb-57a1d736959fb92e39abab59511a903b7ec59547.tar.gz
gdb
* python/python.c (gdbpy_parse_and_eval): New function. (GdbMethods): Add "parse_and_eval". gdb/testsuite * gdb.python/py-value.exp (test_parse_and_eval): New function. gdb/doc * gdb.texinfo (Basic Python): Document gdb.parse_and_eval.
Diffstat (limited to 'gdb/doc')
-rw-r--r--gdb/doc/ChangeLog4
-rw-r--r--gdb/doc/gdb.texinfo13
2 files changed, 17 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 73a640d104e..553abaede71 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,7 @@
+2009-12-03 Tom Tromey <tromey@redhat.com>
+
+ * gdb.texinfo (Basic Python): Document gdb.parse_and_eval.
+
2009-12-02 Paul Pluzhnikov <ppluzhnikov@google.com>
* observer.texi: New memory_changed observer.
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 39107ec9022..8cdab8f3ee7 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -19328,6 +19328,19 @@ If no exception is raised, the return value is always an instance of
@code{gdb.Value} (@pxref{Values From Inferior}).
@end defun
+@findex gdb.parse_and_eval
+@defun parse_and_eval expression
+Parse @var{expression} as an expression in the current language,
+evaluate it, and return the result as a @code{gdb.Value}.
+@var{expression} must be a string.
+
+This function can be useful when implementing a new command
+(@pxref{Commands In Python}), as it provides a way to parse the
+command's argument as an expression. It is also useful simply to
+compute values, for example, it is the only way to get the value of a
+convenience variable (@pxref{Convenience Vars}) as a @code{gdb.Value}.
+@end defun
+
@findex gdb.write
@defun write string
Print a string to @value{GDBN}'s paginated standard output stream.