From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21168 invoked by alias); 17 Nov 2008 15:45:44 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 21000 invoked by uid 306); 17 Nov 2008 15:45:43 -0000 Date: Mon, 17 Nov 2008 15:45:00 -0000 Message-ID: <20081117154543.20973.qmail@sourceware.org> From: tromey@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-tromey-python: gdb X-Git-Refname: refs/heads/archer-tromey-python X-Git-Reftype: branch X-Git-Oldrev: cf82162b0524be8d185e05f561bc177275bb7ecc X-Git-Newrev: 98011209ea5a2fc236cce680946b1097caa80df7 X-SW-Source: 2008-q4/txt/msg00116.txt.bz2 List-Id: The branch, archer-tromey-python has been updated via 98011209ea5a2fc236cce680946b1097caa80df7 (commit) from cf82162b0524be8d185e05f561bc177275bb7ecc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 98011209ea5a2fc236cce680946b1097caa80df7 Author: Tom Tromey Date: Mon Nov 17 08:45:25 2008 -0700 gdb * varobj.c (install_default_visualizer): Remove 'type' argument. (varobj_create): Update. (varobj_list_children): Likewise (varobj_add_child): Likewise. (varobj_update): Don't reinstall visualizer when type has changed. gdb/testsuite * gdb.python/python-prettyprint.c (do_nothing): New function. (main): Call it. * gdb.python/python-prettyprint.exp (run_lang_tests): Update for reference-printing change. ----------------------------------------------------------------------- Summary of changes: gdb/ChangeLog | 9 +++++++++ gdb/testsuite/ChangeLog | 2 ++ gdb/testsuite/gdb.python/python-mi.exp | 10 ++++++++-- gdb/testsuite/gdb.python/python-prettyprint.c | 11 +++++++++++ gdb/varobj.c | 20 +++++++------------- 5 files changed, 37 insertions(+), 15 deletions(-) First 500 lines of diff: diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7c4bf4e..c51b9b1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2008-11-17 Tom Tromey + + * varobj.c (install_default_visualizer): Remove 'type' argument. + (varobj_create): Update. + (varobj_list_children): Likewise + (varobj_add_child): Likewise. + (varobj_update): Don't reinstall visualizer when type has + changed. + 2008-11-16 Tom Tromey * python/python-type.c (type_object_type): Add extra fields. diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 90079f7..ec897a2 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,7 @@ 2008-11-17 Tom Tromey + * gdb.python/python-prettyprint.c (do_nothing): New function. + (main): Call it. * gdb.python/python-prettyprint.exp (run_lang_tests): Update for reference-printing change. diff --git a/gdb/testsuite/gdb.python/python-mi.exp b/gdb/testsuite/gdb.python/python-mi.exp index 4d411b3..7cc15c3 100644 --- a/gdb/testsuite/gdb.python/python-mi.exp +++ b/gdb/testsuite/gdb.python/python-mi.exp @@ -27,7 +27,7 @@ if [mi_gdb_start] { set testfile "python-prettyprint" set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DMI}] != "" } { untested mi2-var-child.exp return -1 } @@ -48,7 +48,7 @@ mi_gdb_test "python execfile ('${srcdir}/${subdir}/${testfile}.py')" "" mi_continue_to_line [gdb_get_line_number {MI breakpoint here} ${testfile}.c] \ "step to breakpoint" -mi_create_varobj container c "create container varobj" +mi_create_floating_varobj container c "create container varobj" mi_list_varobj_children container { } "examine container children=0" @@ -116,3 +116,9 @@ mi_list_varobj_children container { { {container.\[0\]} {\[0\]} 0 int } { {container.\[1\]} {\[1\]} 0 int } } "list varobj children after resetting child range" + +mi_continue_to_line \ + [gdb_get_line_number {Another MI breakpoint} ${testfile}.c] \ + "step to second breakpoint" + +mi_varobj_update_with_type_change container int 0 "update after type change" diff --git a/gdb/testsuite/gdb.python/python-prettyprint.c b/gdb/testsuite/gdb.python/python-prettyprint.c index f99e6f9..f8c2435 100644 --- a/gdb/testsuite/gdb.python/python-prettyprint.c +++ b/gdb/testsuite/gdb.python/python-prettyprint.c @@ -107,6 +107,13 @@ void init_ss(struct ss *s, int a, int b) init_s(&s->b, b); } +void do_nothing(void) +{ + int c; + + c = 23; /* Another MI breakpoint */ +} + int main () { @@ -144,5 +151,9 @@ main () add_item (&c, 23); /* MI breakpoint here */ add_item (&c, 72); +#ifdef MI + do_nothing (); +#endif + return 0; /* break to inspect struct and union */ } diff --git a/gdb/varobj.c b/gdb/varobj.c index 0c5bf6f..eed4036 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -247,7 +247,7 @@ static char *cppop (struct cpstack **pstack); static int install_new_value (struct varobj *var, struct value *value, int initial); -static void install_default_visualizer (struct varobj *var, struct type *type); +static void install_default_visualizer (struct varobj *var); /* Language-specific routines. */ @@ -603,7 +603,7 @@ varobj_create (char *objname, } } - install_default_visualizer (var, var->type); + install_default_visualizer (var); discard_cleanups (old_chain); return var; } @@ -995,7 +995,7 @@ varobj_list_children (struct varobj *var) name = name_of_child (var, i); existing = create_child (var, i, name); VEC_replace (varobj_p, var->children, i, existing); - install_default_visualizer (existing, existing->type); + install_default_visualizer (existing); } } @@ -1009,7 +1009,7 @@ varobj_add_child (struct varobj *var, const char *name, struct value *value) VEC_length (varobj_p, var->children), name, value); VEC_safe_push (varobj_p, var->children, v); - install_default_visualizer (v, v->type); + install_default_visualizer (v); return v; } @@ -1427,7 +1427,7 @@ install_visualizer (struct varobj *var, PyObject *visualizer) } static void -install_default_visualizer (struct varobj *var, struct type *type) +install_default_visualizer (struct varobj *var) { #if HAVE_PYTHON struct cleanup *cleanup; @@ -1437,8 +1437,8 @@ install_default_visualizer (struct varobj *var, struct type *type) state = PyGILState_Ensure (); cleanup = make_cleanup_py_restore_gil (&state); - if (type) - constructor = gdbpy_get_varobj_pretty_printer (type); + if (var->type) + constructor = gdbpy_get_varobj_pretty_printer (var->type); install_visualizer (var, constructor); do_cleanups (cleanup); @@ -1543,12 +1543,6 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit) new = value_of_root (varp, &type_changed); r.varobj = *varp; - /* Change the default visualizer, if needed, before installing - the new value. This ensures that we instantiate the correct - class. */ - if (type_changed) - install_default_visualizer (*varp, value_type (new)); - r.type_changed = type_changed; if (install_new_value ((*varp), new, type_changed)) r.changed = 1; hooks/post-receive -- Repository for Project Archer.