From 08c637dee28a25da97418745fbebb26b2fba8eef Mon Sep 17 00:00:00 2001 From: Thiago Jung Bauermann Date: Wed, 4 Feb 2009 21:55:40 +0000 Subject: gdb/ 2009-02-04 Tom Tromey Thiago Jung Bauermann Phil Muldoon * 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) : 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 * gdb.texinfo (Basic Python): Document gdb.history. gdb/testsuite/ 2009-02-04 Tom Tromey Thiago Jung Bauermann * 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. --- gdb/python/python.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/python/python.c') diff --git a/gdb/python/python.c b/gdb/python/python.c index e778ac4..991321f 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -52,7 +52,7 @@ static PyObject *gdbpy_flush (PyObject *, PyObject *); static PyMethodDef GdbMethods[] = { - { "get_value_from_history", gdbpy_get_value_from_history, METH_VARARGS, + { "history", gdbpy_history, METH_VARARGS, "Get a value from history" }, { "execute", execute_gdb_command, METH_VARARGS, "Execute a gdb command" }, -- cgit v1.1