This is the mail archive of the
archer-commits@sourceware.org
mailing list for the Archer project.
[SCM] archer-tromey-python: Fix python regressions
- From: tromey at sourceware dot org
- To: archer-commits at sourceware dot org
- Date: 29 Jun 2009 23:43:06 -0000
- Subject: [SCM] archer-tromey-python: Fix python regressions
The branch, archer-tromey-python has been updated
via 2d5ab2a86a7aad28f39825e8a0a04ae478def484 (commit)
from 1f54190eb74c76febd72cce6b07736375e1afee1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit 2d5ab2a86a7aad28f39825e8a0a04ae478def484
Author: Tom Tromey <tromey@redhat.com>
Date: Mon Jun 29 17:42:41 2009 -0600
Fix python regressions
* python/python.c (pretty_print_one_value): Update comment.
(print_string_repr): Don't make a cleanup.
* python/python-value.c (convert_value_from_python): Use
value_copy again.
-----------------------------------------------------------------------
Summary of changes:
gdb/python/python-value.c | 7 ++++++-
gdb/python/python.c | 11 +++--------
2 files changed, 9 insertions(+), 9 deletions(-)
First 500 lines of diff:
diff --git a/gdb/python/python-value.c b/gdb/python/python-value.c
index 8c4361e..b7e634c 100644
--- a/gdb/python/python-value.c
+++ b/gdb/python/python-value.c
@@ -923,7 +923,12 @@ convert_value_from_python (PyObject *obj)
}
}
else if (PyObject_TypeCheck (obj, &value_object_type))
- value = ((value_object *) obj)->value;
+ {
+ /* This lets callers freely decref the Value wrapper object
+ and not worry about whether or not the value will
+ disappear. */
+ value = value_copy (((value_object *) obj)->value);
+ }
else
PyErr_Format (PyExc_TypeError, _("Could not convert Python object: %s"),
PyString_AsString (PyObject_Str (obj)));
diff --git a/gdb/python/python.c b/gdb/python/python.c
index f1f25ee..dc49409 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -829,8 +829,8 @@ find_pretty_printer (PyObject *value)
/* Pretty-print a single value, via the printer object PRINTER.
If the function returns a string, a PyObject containing the string
is returned. Otherwise, if the function returns a value,
- *OUT_VALUE is set to the value, and NULL is returned. On error,
- *OUT_VALUE is set to NULL, and NULL is returned. */
+ the value (still on the all_values chain), and NULL is returned.
+ On error, *OUT_VALUE is set to NULL and NULL is returned. */
static PyObject *
pretty_print_one_value (PyObject *printer, struct value **out_value)
{
@@ -907,7 +907,6 @@ print_string_repr (PyObject *printer, const char *hint,
{
struct value *replacement = NULL;
PyObject *py_str = NULL;
- struct cleanup *cleanups = make_cleanup (null_cleanup, 0);
py_str = pretty_print_one_value (printer, &replacement);
if (py_str)
@@ -930,13 +929,9 @@ print_string_repr (PyObject *printer, const char *hint,
Py_DECREF (py_str);
}
else if (replacement)
- {
- make_cleanup (value_free_cleanup, replacement);
- common_val_print (replacement, stream, recurse, options, language);
- }
+ common_val_print (replacement, stream, recurse, options, language);
else
gdbpy_print_stack ();
- do_cleanups (cleanups);
}
static void
hooks/post-receive
--
Repository for Project Archer.