From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25532 invoked by alias); 24 Feb 2009 10:47:36 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 25509 invoked by uid 9514); 24 Feb 2009 10:47:35 -0000 Date: Tue, 24 Feb 2009 10:47:00 -0000 Message-ID: <20090224104735.25493.qmail@sourceware.org> From: pmuldoon@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-pmuldoon-pretty-printers-lookup: Delete get_type. Delete value argument in apply_varobj_pretty_printer. Fix redundant if check. Print stacktrace on error on apply_val_pretty_print. X-Git-Refname: refs/heads/archer-pmuldoon-pretty-printers-lookup X-Git-Reftype: branch X-Git-Oldrev: 219a4656534db9037967f36e4fd3c2eebed502b7 X-Git-Newrev: cb51cacb5792ad694bff94e43bcadb004f71e7c8 X-SW-Source: 2009-q1/txt/msg00189.txt.bz2 List-Id: The branch, archer-pmuldoon-pretty-printers-lookup has been updated via cb51cacb5792ad694bff94e43bcadb004f71e7c8 (commit) from 219a4656534db9037967f36e4fd3c2eebed502b7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit cb51cacb5792ad694bff94e43bcadb004f71e7c8 Author: Phil Muldoon Date: Tue Feb 24 10:46:22 2009 +0000 Delete get_type. Delete value argument in apply_varobj_pretty_printer. Fix redundant if check. Print stacktrace on error on apply_val_pretty_print. ----------------------------------------------------------------------- Summary of changes: gdb/python/python-internal.h | 2 +- gdb/python/python.c | 29 +++++------------------------ gdb/varobj.c | 2 +- 3 files changed, 7 insertions(+), 26 deletions(-) First 500 lines of diff: diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h index c370af1..12422af 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -161,7 +161,7 @@ int gdbpy_is_value_object (PyObject *obj); /* Note that these are declared here, and not in python.h with the other pretty-printer functions, because they refer to PyObject. */ -char *apply_varobj_pretty_printer (PyObject *print_obj, struct value *value, +char *apply_varobj_pretty_printer (PyObject *print_obj, struct value **replacement); PyObject *gdbpy_get_varobj_pretty_printer (struct value *value); PyObject *gdbpy_instantiate_printer (PyObject *cons, PyObject *value); diff --git a/gdb/python/python.c b/gdb/python/python.c index 20b09ec..4d104c2 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -1055,27 +1055,6 @@ gdbpy_objfiles (PyObject *unused1, PyObject *unused2) -/* Return a string representing TYPE. */ -static char * -get_type (struct type *type) -{ - struct cleanup *old_chain; - struct ui_file *stb; - char *thetype; - long length; - - stb = mem_fileopen (); - old_chain = make_cleanup_ui_file_delete (stb); - - CHECK_TYPEDEF (type); - - type_print (type, "", stb, -1); - - thetype = ui_file_xstrdup (stb, &length); - do_cleanups (old_chain); - return thetype; -} - /* Helper function for find_pretty_printer which iterates over a list, calls each function and inspects output. */ static PyObject * @@ -1101,7 +1080,7 @@ search_pp_list (PyObject *list, PyObject *value) else if (printer != Py_None) return printer; - Py_DECREF(Py_None); + Py_DECREF (printer); } Py_RETURN_NONE; @@ -1136,7 +1115,7 @@ find_pretty_printer (PyObject *value) return NULL; } - if (function && function != Py_None) + if (function != Py_None) goto done; /* In this loop, if function is not an instantiation of a @@ -1563,6 +1542,8 @@ apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, done: + if (PyErr_Occurred ()) + gdbpy_print_stack (); do_cleanups (cleanups); return result; } @@ -1576,7 +1557,7 @@ apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, value, and this function returns NULL. On error, *REPLACEMENT is set to NULL and this function also returns NULL. */ char * -apply_varobj_pretty_printer (PyObject *printer_obj, struct value *value, +apply_varobj_pretty_printer (PyObject *printer_obj, struct value **replacement) { char *result; diff --git a/gdb/varobj.c b/gdb/varobj.c index 150d8f8..8b32c59 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -2274,7 +2274,7 @@ value_get_print_value (struct value *value, enum varobj_display_formats format, xfree (hint); } - thevalue = apply_varobj_pretty_printer (value_formatter, value, + thevalue = apply_varobj_pretty_printer (value_formatter, &replacement); if (thevalue && !string_print) { hooks/post-receive -- Repository for Project Archer.