aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorThiago Jung Bauermann <bauerman@br.ibm.com>2009-02-04 21:55:40 +0000
committerThiago Jung Bauermann <bauerman@br.ibm.com>2009-02-04 21:55:40 +0000
commit08c637dee28a25da97418745fbebb26b2fba8eef (patch)
tree7d7d670deff8204aa4f5deb9152b739b91e0ef53 /gdb/doc
parent20261af84c27478a2333f573702ba2b6e4a8b038 (diff)
downloadgdb-08c637dee28a25da97418745fbebb26b2fba8eef.zip
gdb-08c637dee28a25da97418745fbebb26b2fba8eef.tar.gz
gdb-08c637dee28a25da97418745fbebb26b2fba8eef.tar.bz2
gdb/
2009-02-04 Tom Tromey <tromey@redhat.com> Thiago Jung Bauermann <bauerman@br.ibm.com> Phil Muldoon <pmuldoon@redhat.com> * python/python-internal.h (gdbpy_get_value_from_history): Rename prototype to gdbpy_history. (gdbpy_is_string): Declare. (python_string_to_host_string): Declare. * python/python-utils.c (gdbpy_is_string): New function. (unicode_to_encoded_string): New function. (unicode_to_target_string): Use it. (python_string_to_host_string): New function. * python/python-value.c (valpy_address): New function. (convert_value_from_python): Use gdbpy_is_string. Change to throw Python exception instead of a GDB exception on error. Properly check Python booleans. (valpy_getitem): Convert field name to host string. Handle array accesses. Adapt to new behaviour of convert_value_from_python. (valpy_new): Adapt to new behaviour of convert_value_from_python. (enum valpy_opcode) <VALPY_LSH, VALPY_RSH, VALPY_BITAND, VALPY_BITXOR, VALPY_BITOR>: New constants. (valpy_binop): Update. Adapt to new behaviour of convert_value_from_python. (valpy_invert): New function. (valpy_lsh): Likewise. (valpy_rsh): Likewise. (valpy_and): Likewise. (valpy_or): Likewise. (valpy_xor): Likewise. (valpy_richcompare): Call convert_value_from_python instead of doing conversions itself. (is_intlike, valpy_int, valpy_long, valpy_float): New functions. (gdbpy_get_value_from_history): Rename function to gdbpy_history. (gdbpy_initialize_values): Don't set tp_new. (value_object_type): Add valpy_new. (value_object_methods): Add `address' entry. (value_object_as_number): Update for new methods. * python/python.c (GdbMethods): Rename entry from `get_value_from_history' to `history'. gdb/doc/ 2009-02-04 Tom Tromey <tromey@redhat.com> * gdb.texinfo (Basic Python): Document gdb.history. gdb/testsuite/ 2009-02-04 Tom Tromey <tromey@redhat.com> Thiago Jung Bauermann <bauerman@br.ibm.com> * gdb.python/python-value.exp: Use `gdb.history' instead of `gdb.value_from_history'. (test_value_numeric_ops): Add test for conversion of enum constant. * gdb.python/python-value.c (enum e): New type. (evalue): New global. (main): Use argv.
Diffstat (limited to 'gdb/doc')
-rw-r--r--gdb/doc/ChangeLog4
-rw-r--r--gdb/doc/gdb.texinfo15
2 files changed, 19 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 69c9d20..677d74b 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,7 @@
+2009-02-04 Tom Tromey <tromey@redhat.com>
+
+ * gdb.texinfo (Basic Python): Document gdb.history.
+
2009-01-30 Vladimir Prus <vladimir@codesourcery.com>
* gdb.texinfo (GDB/MI Thread Commands): Document the
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 166b84d..884f50b 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -18097,6 +18097,21 @@ If the named parameter does not exist, this function throws a
a Python value of the appropriate type, and returned.
@end defun
+@findex gdb.history
+@defun history number
+Return a value from @value{GDBN}'s value history (@pxref{Value
+History}). @var{number} indicates which history element to return.
+If @var{number} is negative, then @value{GDBN} will take its absolute value
+and count backward from the last element (i.e., the most recent element) to
+find the value to return. If @var{number} is zero, then @value{GDBN} will
+return the most recent element. If the element specified by @value{number}
+doesn't exist in the value history, a @code{RuntimeError} exception will be
+raised.
+
+If no exception is raised, the return value is always an instance of
+@code{gdb.Value} (@pxref{Values From Inferior}).
+@end defun
+
@findex gdb.write
@defun write string
Print a string to @value{GDBN}'s paginated standard output stream.