diff options
author | Tom Tromey <tromey@redhat.com> | 2012-12-06 18:59:57 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2012-12-06 18:59:57 +0000 |
commit | 731145cb171b848d564a696e81153166524eb35a (patch) | |
tree | ab76e30954e6d4f133e8795e385d0fe84ecfd2b8 /gdb/testsuite/gdb.python/py-mi.exp | |
parent | cd6fa7fd8801453ab5caef588fc772d14cb1ee9a (diff) | |
download | gdb-731145cb171b848d564a696e81153166524eb35a.zip gdb-731145cb171b848d564a696e81153166524eb35a.tar.gz gdb-731145cb171b848d564a696e81153166524eb35a.tar.bz2 |
2012-12-06 Jens Elmenthaler <jens.elmenthaler@advantest.com>
PR mi/14741:
* mi/mi-cmd-var.c (varobj_update_one): Take value of
attribute "dynamic" and "displayhint" from printed child,
not the root variable.
* gdb.python/py-mi.exp: Correct expected results for attribute
"dynamic" returned by -var-update.
Add test case for correct handling of "diplayhint" for children
of dynamic varobjs.
* gdb.python/py-prettyprint.c (set_itme): New function.
(bug_14741) New function.
(main) Add call to bug_14741().
* gdb.python/py-prettyprint.py (class ArrayPrinter): New class.
Diffstat (limited to 'gdb/testsuite/gdb.python/py-mi.exp')
-rw-r--r-- | gdb/testsuite/gdb.python/py-mi.exp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.python/py-mi.exp b/gdb/testsuite/gdb.python/py-mi.exp index e7034a1..49b4def 100644 --- a/gdb/testsuite/gdb.python/py-mi.exp +++ b/gdb/testsuite/gdb.python/py-mi.exp @@ -182,7 +182,7 @@ mi_varobj_update_dynamic container \ "update after next with restricted range" { type_changed false new_num_children 1 dynamic 1 has_more 1 } { - { name {container.\[0\]} in_scope true type_changed false dynamic 1 has_more 0 } + { name {container.\[0\]} in_scope true type_changed false has_more 0 } } { } @@ -239,7 +239,7 @@ mi_list_varobj_children outer.s { mi_next "next over outer update" mi_gdb_test "-var-update outer" \ - ".done,changelist=.{name=\"outer.s.a\",in_scope=\"true\",type_changed=\"false\",dynamic=\"1\",has_more=\"0\"}." \ + ".done,changelist=.{name=\"outer.s.a\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"}." \ "update after updating element of outer" mi_continue_to_line \ @@ -293,6 +293,28 @@ mi_gdb_test "-var-evaluate-expression me" \ mi_create_dynamic_varobj children_as_list children_as_list \ "printer whose children are returned as a list" +# Regression test for bug 14741. +mi_continue_to_line \ + [gdb_get_line_number {breakpoint bug 14741} ${srcfile}] \ + "step to breakpoint for bug 14741" + +mi_create_dynamic_varobj c c \ + "create varobj for c" + +mi_gdb_test "-var-set-visualizer c ArrayPrinter" \ + "\\^done" \ + "choose array visualizer for c" + +mi_list_varobj_children c { + { {c.\[0\]} {\[0\]} 0 int } +} "list children of c" + +mi_next "next over change of array element" + +mi_gdb_test "-var-update c" \ + "\\^done,changelist=\\\[{name=\"c.\\\[0\\\]\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"}\\\]" \ + "update varobj after element change" + # C++ MI tests gdb_exit if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-cxx" \ |