diff options
author | Tom Tromey <tromey@redhat.com> | 2009-09-15 18:51:26 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2009-09-15 18:51:26 +0000 |
commit | 0cc7d26fe4e30614f7ca3d3abd607d938b56dbf0 (patch) | |
tree | dd150a090dac11d841608d5b437e7f04c6733593 /gdb/testsuite | |
parent | 1acf546ea5a0a65be516aefe252bcf7f2daaccb3 (diff) | |
download | gdb-0cc7d26fe4e30614f7ca3d3abd607d938b56dbf0.zip gdb-0cc7d26fe4e30614f7ca3d3abd607d938b56dbf0.tar.gz gdb-0cc7d26fe4e30614f7ca3d3abd607d938b56dbf0.tar.bz2 |
gdb
* varobj.h (varobj_update_result_t) <new>: New field.
(varobj_get_child_range, varobj_set_child_range): Declare.
(varobj_list_children): Update.
(varobj_enable_pretty_printing, varobj_has_more)
(varobj_pretty_printed_p): Declare.
* varobj.c (pretty_printing): New global.
(varobj_enable_pretty_printing): New function.
(struct varobj_root) <from, to, constructor, child_iter,
saved_item>: New fields.
(varobj_create): Don't call install_default_visualizer.
(instantiate_pretty_printer): Don't use value_copy.
(varobj_has_more): New function.
(restrict_range): New function.
(install_dynamic_child): Likewise.
(dynamic_varobj_has_child_method): Likewise.
(update_dynamic_varobj_children): Remove 'new_and_unchanged'
argument; add 'new', 'unchanged', 'from', and 'to' arguments.
Rewrite.
(varobj_get_num_children): Call update_dynamic_varobj_children.
(varobj_list_children): Add 'from' and 'to' arguments. Ignore
result of update_dynamic_varobj_children. Don't call
install_default_visualizer. Restrict result range.
(varobj_add_child): Don't call install_default_visualizer.
(varobj_pretty_printed_p): New function.
(install_visualizer): Rewrite. Move earlier in file.
(install_default_visualizer): Likewise.
(construct_visualizer): New function.
(install_new_value_visualizer): Likewise.
(install_new_value): Don't call release_value. Special case
pretty-printed objects. Use value_incref. Rearrange "changed"
logic.
(varobj_get_child_range): New function.
(varobj_set_child_range): Likewise.
(varobj_set_visualizer): Rewrite.
(varobj_update): Rewrite pretty-printing logic.
(new_variable): Initialize new fields.
(free_variable): Destroy new fields.
(value_of_root): Copy 'from' and 'to'.
(my_value_of_variable): Handle pretty-printers.
(value_get_print_value): Rework pretty-printing logic.
(cplus_describe_child): Don't use release_value.
* mi/mi-cmds.h (mi_cmd_enable_pretty_printing)
(mi_cmd_var_set_update_range): Declare.
* mi/mi-cmds.c (mi_cmds): Add enable-pretty-printing and
var-set-update-range.
* mi/mi-cmd-var.c (print_varobj): Update. Emit "dynamic"
attribute.
(mi_cmd_var_create): Emit "has_more" attribute.
(mi_cmd_var_set_format): Plug memory leak.
(mi_print_value_p): Replace 'type' argument with 'var'. Handle
pretty-printed varobjs.
(mi_cmd_var_list_children): Accept 'from' and 'to' arguments.
Emit "has_more" attribute.
(mi_cmd_var_evaluate_expression): Plug memory leak.
(mi_cmd_var_assign): Likewise.
(varobj_update_one): Likewise. Emit "dynamic", "has_more", and
"new_children" attributes.
(mi_cmd_enable_pretty_printing): New function.
(mi_cmd_var_set_update_range): Likewise.
gdb/doc
* gdb.texinfo (GDB/MI Variable Objects): Document
-enable-pretty-printing, -var-set-update-range, dynamic varobjs.
Expand -var-update documentation.
gdb/testsuite
* lib/mi-support.exp (mi_create_varobj): Update.
(mi_create_floating_varobj): Likewise.
(mi_create_dynamic_varobj): New proc.
(mi_varobj_update): Update.
(mi_varobj_update_with_type_change): Likewise.
(mi_varobj_update_kv_helper): New proc.
(mi_varobj_update_dynamic_helper): Rewrite.
(mi_varobj_update_dynamic): New proc.
(mi_list_varobj_children): Update.
(mi_list_varobj_children_range): Add 'from' and 'to' arguments.
* gdb.python/python-prettyprint.py (pp_outer): New class.
(pp_nullstr): Likewise.
(lookup_function): Register new printers.
* gdb.python/python-prettyprint.c (struct substruct): New type.
(struct outerstruct): Likewise.
(substruct_test): New function.
(struct nullstr): New type.
(string_1, string_2): New globals.
(main): Add new tests.
* gdb.python/python-mi.exp: Added regression tests.
* gdb.mi/mi2-var-display.exp: Update.
* gdb.mi/mi2-var-cmd.exp: Update.
* gdb.mi/mi2-var-child.exp: Update.
* gdb.mi/mi2-var-block.exp: Update.
* gdb.mi/mi-var-invalidate.exp: Update.
* gdb.mi/mi-var-display.exp: Update.
* gdb.mi/mi-var-cmd.exp: Update.
* gdb.mi/mi-var-child.exp: Update.
* gdb.mi/mi-var-block.exp: Update.
* gdb.mi/mi-break.exp: Update.
* gdb.mi/gdb701.exp: Update.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 34 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/gdb701.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-break.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-var-block.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-var-child.exp | 30 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-var-cmd.exp | 38 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-var-display.exp | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-var-invalidate.exp | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi2-var-block.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi2-var-child.exp | 30 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi2-var-cmd.exp | 33 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi2-var-display.exp | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-mi.exp | 163 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-prettyprint.c | 45 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-prettyprint.py | 29 | ||||
-rw-r--r-- | gdb/testsuite/lib/mi-support.exp | 100 |
16 files changed, 412 insertions, 112 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a80d9a2..b9039df 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,37 @@ +2009-09-15 Tom Tromey <tromey@redhat.com> + + * lib/mi-support.exp (mi_create_varobj): Update. + (mi_create_floating_varobj): Likewise. + (mi_create_dynamic_varobj): New proc. + (mi_varobj_update): Update. + (mi_varobj_update_with_type_change): Likewise. + (mi_varobj_update_kv_helper): New proc. + (mi_varobj_update_dynamic_helper): Rewrite. + (mi_varobj_update_dynamic): New proc. + (mi_list_varobj_children): Update. + (mi_list_varobj_children_range): Add 'from' and 'to' arguments. + * gdb.python/python-prettyprint.py (pp_outer): New class. + (pp_nullstr): Likewise. + (lookup_function): Register new printers. + * gdb.python/python-prettyprint.c (struct substruct): New type. + (struct outerstruct): Likewise. + (substruct_test): New function. + (struct nullstr): New type. + (string_1, string_2): New globals. + (main): Add new tests. + * gdb.python/python-mi.exp: Added regression tests. + * gdb.mi/mi2-var-display.exp: Update. + * gdb.mi/mi2-var-cmd.exp: Update. + * gdb.mi/mi2-var-child.exp: Update. + * gdb.mi/mi2-var-block.exp: Update. + * gdb.mi/mi-var-invalidate.exp: Update. + * gdb.mi/mi-var-display.exp: Update. + * gdb.mi/mi-var-cmd.exp: Update. + * gdb.mi/mi-var-child.exp: Update. + * gdb.mi/mi-var-block.exp: Update. + * gdb.mi/mi-break.exp: Update. + * gdb.mi/gdb701.exp: Update. + 2009-09-14 Sergio Durigan Junior <sergiodj@linux.vnet.ibm.com> * Makefile.in: Inclusion of catch-syscall object. diff --git a/gdb/testsuite/gdb.mi/gdb701.exp b/gdb/testsuite/gdb.mi/gdb701.exp index d4acdc2..244c731 100644 --- a/gdb/testsuite/gdb.mi/gdb701.exp +++ b/gdb/testsuite/gdb.mi/gdb701.exp @@ -54,7 +54,7 @@ mi_gdb_test "-var-list-children fooPtr" \ foreach i [list x y z] { mi_gdb_test "-var-list-children fooPtr.$i" \ - "(&\".*\"\r\n)*\\^done,numchild=\"0\"" \ + "(&\".*\"\r\n)*\\^done,numchild=\"0\",has_more=\"0\"" \ "list children of fooPtr.$i" } diff --git a/gdb/testsuite/gdb.mi/mi-break.exp b/gdb/testsuite/gdb.mi/mi-break.exp index 619727d..8d06c0e 100644 --- a/gdb/testsuite/gdb.mi/mi-break.exp +++ b/gdb/testsuite/gdb.mi/mi-break.exp @@ -175,7 +175,7 @@ proc test_error {} { # containing function call, the internal breakpoint created to handle # function call would be reported, messing up MI output. mi_gdb_test "-var-create V * return_1()" \ - "\\^done,name=\"V\",numchild=\"0\",value=\"1\",type=\"int\"" \ + "\\^done,name=\"V\",numchild=\"0\",value=\"1\",type=\"int\",has_more=\"0\"" \ "create varobj for function call" mi_gdb_test "-var-update *" \ diff --git a/gdb/testsuite/gdb.mi/mi-var-block.exp b/gdb/testsuite/gdb.mi/mi-var-block.exp index 8806848..93ded26 100644 --- a/gdb/testsuite/gdb.mi/mi-var-block.exp +++ b/gdb/testsuite/gdb.mi/mi-var-block.exp @@ -74,7 +74,7 @@ mi_step_to "do_block_tests" "" "var-cmd.c" \ # Test: c_variable-3.4 # Desc: check foo, cb changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"foo\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"cb\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"foo\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"cb\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: cb foo changed" # step to "foo = 321;" diff --git a/gdb/testsuite/gdb.mi/mi-var-child.exp b/gdb/testsuite/gdb.mi/mi-var-child.exp index 1f4bdc6..eb6c456 100644 --- a/gdb/testsuite/gdb.mi/mi-var-child.exp +++ b/gdb/testsuite/gdb.mi/mi-var-child.exp @@ -680,7 +680,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.2 # Desc: check that integer changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.integer\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"struct_declarations.integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars struct_declarations.integer" # Step over: @@ -693,7 +693,7 @@ mi_execute_to "exec-step 3" "end-stepping-range" do_children_tests {} ".*${srcfi # Test: c_variable-5.3 # Desc: check that char_ptr changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars struct_declarations.char_ptr" # Step over "struct_declarations.int_ptr_ptr = &foo;" @@ -703,7 +703,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.4 # Desc: check that int_ptr_ptr and children changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars int_ptr_ptr and children changed" # Step over "weird->long_array[0] = 1234;" @@ -713,7 +713,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.5 # Desc: check that long_array[0] changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.0\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.0\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars struct_declarations.long_array.0 changed" # Step over "struct_declarations.long_array[1] = 2345;" @@ -723,7 +723,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.6 # Desc: check that long_array[1] changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.1\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.1\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars struct_declarations.long_array.1 changed" # Step over "weird->long_array[2] = 3456;" @@ -733,7 +733,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.7 # Desc: check that long_array[2] changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.2\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.2\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars struct_declarations.long_array.2 changed" # Step over: @@ -752,7 +752,7 @@ mi_execute_to "exec-step 7" "end-stepping-range" do_children_tests {} ".*${srcfi # Test: c_variable-5.8 # Desc: check that long_array[3-9] changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars struct_declarations.long_array.3-9 changed" @@ -763,7 +763,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.9 # Desc: check that func_ptr changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars struct_declarations.func_ptr changed" # Step over "struct_declarations.long_array[10] = 3456"; @@ -771,7 +771,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ [expr $line_dct_nothing + 2] "step \$line_dct_nothing + 2" mi_gdb_test "-var-update --no-values *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.10\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.10\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars struct_declarations.long_array.10 changed, don't print values." # Step over "struct_declarations.long_array[11] = 5678"; @@ -780,7 +780,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ $line_dct_a0_0 "step \$line_dct_a0_0" mi_gdb_test "-var-update --all-values *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.11\",value=\"5678\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.11\",value=\"5678\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars struct_declarations.long_array.11 changed, print values." mi_list_varobj_children {struct_declarations.long_array --all-values} { @@ -1121,7 +1121,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.47 # Desc: check that psnp->char_ptr (and [0].char_ptr) changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars psnp->char_ptr (and 0.char_ptr) changed" # Step over "snp1.char_ptr = &c3;" @@ -1131,7 +1131,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.48 # Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars psnp->next->char_ptr (and 1.char_ptr) changed" @@ -1142,7 +1142,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.49 # Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars psnp->next->next->char_ptr (and 2.char_ptr) changed" @@ -1153,7 +1153,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.50 # Desc: check that psnp->long_ptr (and [0].long_ptr) changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars psnp->long_ptr (and 0.long_ptr) changed" @@ -1181,7 +1181,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.52 # Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars psnp->next->next->long_ptr (and 2.long_ptr) changed" mi_prepare_inline_tests $srcfile diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp index ad2e55c..6efb333 100644 --- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp +++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp @@ -146,7 +146,7 @@ mi_step_to "do_locals_tests" "" "var-cmd.c" $line_dlt_linteger "step at do_local # Test: c_variable-2.2 # Desc: check whether only linteger changed values mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: linteger changed" # Step over "lpinteger = &linteger;" @@ -155,7 +155,7 @@ mi_step_to "do_locals_tests" "" "var-cmd.c" [expr $line_dlt_linteger + 1] "step # Test: c_variable-2.3 # Desc: check whether only lpinteger changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: lpinteger changed" # Step over "lcharacter = 'a';" @@ -164,7 +164,7 @@ mi_step_to "do_locals_tests" "" "var-cmd.c" [expr $line_dlt_linteger + 2] "step # Test: c_variable-2.4 # Desc: check whether only lcharacter changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: lcharacter changed" # Step over "lpcharacter = &lcharacter;" @@ -173,7 +173,7 @@ mi_step_to "do_locals_tests" "" "var-cmd.c" [expr $line_dlt_linteger + 3] "step # Test: c_variable-2.5 # Desc: check whether only lpcharacter changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: lpcharacter changed" @@ -195,7 +195,7 @@ mi_execute_to "exec-step 9" "end-stepping-range" "do_locals_tests" "" \ # Desc: check whether llong, lplong, lfloat, lpfloat, ldouble, lpdouble, lsimple.integer, # lsimple.unsigned_character lsimple.integer lsimple.character changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpdouble\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpfloat\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lplong\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lpdouble\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lpfloat\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lplong\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: many changed" # Step over: @@ -212,7 +212,7 @@ mi_execute_to "exec-step 4" "end-stepping-range" "do_locals_tests" "" \ # Test: c_variable-2.7 # Desc: check whether (lsimple.signed_character, lsimple.char_ptr) lpsimple, func changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"func\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpsimple\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"func\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lpsimple\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: func and lpsimple changed" # Step over @@ -234,7 +234,7 @@ mi_execute_to "exec-step 8" "end-stepping-range" "do_locals_tests" "" \ # Note: this test also checks that lpsimple->integer and lsimple.integer have # changed (they are the same) mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: lsimple and others changed" @@ -257,7 +257,7 @@ mi_gdb_test "-var-assign linteger 3333" \ # change. set lpchar_update "\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\}," mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[($lpchar_update)?\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[($lpchar_update)?\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: linteger changed after assign" mi_gdb_test "-var-assign linteger 3333" \ @@ -277,7 +277,7 @@ mi_gdb_test "-var-assign lpinteger \"&linteger + 3\"" \ "assign to lpinteger" mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: lpinteger changed after assign" mi_gdb_test "-var-update *" \ @@ -377,7 +377,7 @@ mi_gdb_test "-var-update *" \ "assign same value to func (update)" mi_gdb_test "-var-create array_ptr * array_ptr" \ - "\\^done,name=\"array_ptr\",numchild=\"1\",value=\"$hex\",type=\"int \\*\"" \ + "\\^done,name=\"array_ptr\",numchild=\"1\",value=\"$hex\",type=\"int \\*\",has_more=\"0\"" \ "create global variable array_ptr" mi_gdb_test "-var-assign array_ptr array2" \ @@ -385,7 +385,7 @@ mi_gdb_test "-var-assign array_ptr array2" \ "assign array to pointer" mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"array_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"array_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "assign array to pointer (update)" mi_gdb_test "-var-assign array_ptr array2" \ @@ -439,7 +439,7 @@ mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\ # Test: c_variable-2.13 # Desc: change subroutine1 local i mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"i\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"i\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: i changed" mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \ @@ -448,7 +448,7 @@ mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\ # Test: c_variable-2.14 # Desc: change do_locals_tests local llong mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"llong\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: llong changed" set line_dlt_call_subroutine1 [gdb_get_line_number "subroutine1 (linteger, &llong);"] @@ -458,7 +458,7 @@ mi_next_to "do_locals_tests" "" "var-cmd.c" \ # Test: c_variable-2.15 # Desc: check for out of scope subroutine1 locals mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"l\",in_scope=\"false\"\,type_changed=\"false\"},\{name=\"i\",in_scope=\"false\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"l\",in_scope=\"false\"\,type_changed=\"false\",has_more=\"0\"},\{name=\"i\",in_scope=\"false\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: all now out of scope" # Done with locals/globals tests. Erase all variables @@ -550,14 +550,14 @@ mi_gdb_test "-var-create selected_a @ a" \ mi_continue_to incr_a mi_gdb_test "-var-update selected_a" \ - "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"char\",new_num_children=\"0\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"char\",new_num_children=\"0\",has_more=\"0\"\}\\\]" \ "update selected_a in incr_a" mi_next "step a line in incr_a" mi_next "return from incr_a to do_special_tests" mi_gdb_test "-var-update selected_a" \ - "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"int\",new_num_children=\"0\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"int\",new_num_children=\"0\",has_more=\"0\"\}\\\]" \ "update selected_a in do_special_tests" mi_gdb_test "-file-exec-and-symbols ${binfile}" "\\^done" \ @@ -596,7 +596,7 @@ mi_check_varobj_value F 7 "check F inside callee" # A varobj we fail to read during -var-update should be considered # out of scope. mi_gdb_test "-var-create null_ptr * **0" \ - {\^done,name="null_ptr",numchild="0",value=".*",type="int"} \ + {\^done,name="null_ptr",numchild="0",value=".*",type="int",has_more="0"} \ "create null_ptr" # Allow this to succeed, if address zero is readable, although it @@ -644,7 +644,7 @@ mi_check_varobj_value "L" "{...}" "in-and-out-of-scope: check initial value" mi_runto main mi_gdb_test "-var-update L" \ - {\^done,changelist=\[{name="L",in_scope="false",type_changed="false"}\]} \ + {\^done,changelist=\[{name="L",in_scope="false",type_changed="false",has_more="0"}\]} \ "in-and-out-of-scope: out of scope now" mi_gdb_test "-var-update L" \ @@ -654,7 +654,7 @@ mi_gdb_test "-var-update L" \ mi_continue_to do_locals_tests mi_gdb_test "-var-update L" \ - {\^done,changelist=\[{name="L",in_scope="true",type_changed="false"}\]} \ + {\^done,changelist=\[{name="L",in_scope="true",type_changed="false",has_more="0"}\]} \ "in-and-out-of-scope: in scope now" mi_gdb_test "-var-update L" \ diff --git a/gdb/testsuite/gdb.mi/mi-var-display.exp b/gdb/testsuite/gdb.mi/mi-var-display.exp index 4b02e50..faa9172 100644 --- a/gdb/testsuite/gdb.mi/mi-var-display.exp +++ b/gdb/testsuite/gdb.mi/mi-var-display.exp @@ -558,7 +558,7 @@ mi_gdb_test "-var-info-num-children e" \ # Test: c_variable-7.55 # Desc: children of e mi_gdb_test "-var-list-children e" \ - "\\^done,numchild=\"0\"" \ + "\\^done,numchild=\"0\",has_more=\"0\"" \ "get children of e" # Test: c_variable-7.60 @@ -600,7 +600,7 @@ mi_gdb_test "-var-info-num-children anone" \ # Test: c_variable-7.75 # Desc: children of anone mi_gdb_test "-var-list-children anone" \ - "\\^done,numchild=\"0\"" \ + "\\^done,numchild=\"0\",has_more=\"0\"" \ "get children of anone" diff --git a/gdb/testsuite/gdb.mi/mi-var-invalidate.exp b/gdb/testsuite/gdb.mi/mi-var-invalidate.exp index 05d46fa..4b95674 100644 --- a/gdb/testsuite/gdb.mi/mi-var-invalidate.exp +++ b/gdb/testsuite/gdb.mi/mi-var-invalidate.exp @@ -72,7 +72,7 @@ mi_runto main # Check local variable is "invalid". mi_gdb_test "-var-update linteger" \ - "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"invalid\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"invalid\",has_more=\"0\"\}\\\]" \ "linteger not anymore in scope due to binary changes" mi_gdb_test "-var-info-type linteger" \ @@ -97,7 +97,7 @@ mi_delete_breakpoints mi_gdb_load ${binfile2} # Check local variable are "invalid" mi_gdb_test "-var-update linteger" \ - "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"invalid\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"invalid\",has_more=\"0\"\}\\\]" \ "linteger not valid anymore due to binary changes" mi_gdb_test "-var-info-type linteger" \ @@ -106,7 +106,7 @@ mi_gdb_test "-var-info-type linteger" \ # Check global variable are still correct. mi_gdb_test "-var-update global_simple" \ - "\\^done,changelist=\\\[\{name=\"global_simple\",in_scope=\"invalid\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"global_simple\",in_scope=\"invalid\",has_more=\"0\"\}\\\]" \ "global_simple not anymore in scope due to binary changes" mi_gdb_test "-var-info-type global_simple" \ diff --git a/gdb/testsuite/gdb.mi/mi2-var-block.exp b/gdb/testsuite/gdb.mi/mi2-var-block.exp index 6bcfea3..9b3d08f 100644 --- a/gdb/testsuite/gdb.mi/mi2-var-block.exp +++ b/gdb/testsuite/gdb.mi/mi2-var-block.exp @@ -74,7 +74,7 @@ mi_step_to "do_block_tests" "" "var-cmd.c" \ # Test: c_variable-3.4 # Desc: check foo, cb changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"foo\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"cb\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"foo\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"cb\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: cb foo changed" # step to "foo = 321;" diff --git a/gdb/testsuite/gdb.mi/mi2-var-child.exp b/gdb/testsuite/gdb.mi/mi2-var-child.exp index 161b34f..0f9b4d4 100644 --- a/gdb/testsuite/gdb.mi/mi2-var-child.exp +++ b/gdb/testsuite/gdb.mi/mi2-var-child.exp @@ -1,4 +1,4 @@ -# Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation +# Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2009 Free Software Foundation # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -680,7 +680,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ # Test: c_variable-5.2 # Desc: check that integer changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.integer\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"struct_declarations.integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars struct_declarations.integer" # Step over: @@ -693,7 +693,7 @@ mi_execute_to "exec-step 3" "end-stepping-range" do_children_tests {} {.*var-cmd # Test: c_variable-5.3 # Desc: check that char_ptr changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars struct_declarations.char_ptr" # Step over "struct_declarations.int_ptr_ptr = &foo;" @@ -703,7 +703,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ # Test: c_variable-5.4 # Desc: check that int_ptr_ptr and children changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars int_ptr_ptr and children changed" # Step over "weird->long_array[0] = 1234;" @@ -713,7 +713,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ # Test: c_variable-5.5 # Desc: check that long_array[0] changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.0\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.0\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars struct_declarations.long_array.0 changed" # Step over "struct_declarations.long_array[1] = 2345;" @@ -723,7 +723,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ # Test: c_variable-5.6 # Desc: check that long_array[1] changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.1\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.1\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars struct_declarations.long_array.1 changed" # Step over "weird->long_array[2] = 3456;" @@ -733,7 +733,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ # Test: c_variable-5.7 # Desc: check that long_array[2] changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.2\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.2\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars struct_declarations.long_array.2 changed" # Step over: @@ -752,7 +752,7 @@ mi_execute_to "exec-step 7" "end-stepping-range" do_children_tests {} {.*var-cmd # Test: c_variable-5.8 # Desc: check that long_array[3-9] changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars struct_declarations.long_array.3-9 changed" @@ -764,7 +764,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ # Test: c_variable-5.9 # Desc: check that func_ptr changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars struct_declarations.func_ptr changed" # Delete all variables @@ -1075,7 +1075,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ # Test: c_variable-5.47 # Desc: check that psnp->char_ptr (and [0].char_ptr) changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars psnp->char_ptr (and 0.char_ptr) changed" # Step over "snp1.char_ptr = &c3;" @@ -1085,7 +1085,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ # Test: c_variable-5.48 # Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars psnp->next->char_ptr (and 1.char_ptr) changed" @@ -1096,7 +1096,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ # Test: c_variable-5.49 # Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars psnp->next->next->char_ptr (and 2.char_ptr) changed" @@ -1107,7 +1107,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ # Test: c_variable-5.50 # Desc: check that psnp->long_ptr (and [0].long_ptr) changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars psnp->long_ptr (and 0.long_ptr) changed" @@ -1120,7 +1120,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ # Why does this have a FIXME? setup_xfail *-*-* mi_gdb_test "-var-update *" \ - "FIXME\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "FIXME\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars psnp->next->long_ptr (and 1.long_ptr) changed" clear_xfail *-*-* @@ -1135,7 +1135,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ # Test: c_variable-5.52 # Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars psnp->next->next->long_ptr (and 2.long_ptr) changed" diff --git a/gdb/testsuite/gdb.mi/mi2-var-cmd.exp b/gdb/testsuite/gdb.mi/mi2-var-cmd.exp index dda77bb..e900d14 100644 --- a/gdb/testsuite/gdb.mi/mi2-var-cmd.exp +++ b/gdb/testsuite/gdb.mi/mi2-var-cmd.exp @@ -126,11 +126,6 @@ mi_gdb_test "-var-create int * int" \ "&\"Attempt to use a type name as an expression.\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \ "create int" -# The number 0 must be an invalid frame address and linteger a local variable. -mi_gdb_test "-var-create invalidframe 0 linteger" \ - "\\^error,msg=\"Failed to find the specified frame\"" \ - "create variable with invalid FRAME-ADDR" - ##### ##### # # @@ -151,7 +146,7 @@ mi_step_to "do_locals_tests" "" "var-cmd.c" $line_dlt_linteger "step at do_local # Test: c_variable-2.2 # Desc: check whether only linteger changed values mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: linteger changed" # Step over "lpinteger = &linteger;" @@ -160,7 +155,7 @@ mi_step_to "do_locals_tests" "" "var-cmd.c" [expr $line_dlt_linteger + 1] "step # Test: c_variable-2.3 # Desc: check whether only lpinteger changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: lpinteger changed" # Step over "lcharacter = 'a';" @@ -169,7 +164,7 @@ mi_step_to "do_locals_tests" "" "var-cmd.c" [expr $line_dlt_linteger + 2] "step # Test: c_variable-2.4 # Desc: check whether only lcharacter changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: lcharacter changed" # Step over "lpcharacter = &lcharacter;" @@ -178,7 +173,7 @@ mi_step_to "do_locals_tests" "" "var-cmd.c" [expr $line_dlt_linteger + 3] "step # Test: c_variable-2.5 # Desc: check whether only lpcharacter changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: lpcharacter changed" @@ -200,7 +195,7 @@ mi_execute_to "exec-step 9" "end-stepping-range" "do_locals_tests" "" \ # Desc: check whether llong, lplong, lfloat, lpfloat, ldouble, lpdouble, lsimple.integer, # lsimple.unsigned_character lsimple.integer lsimple.character changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpdouble\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpfloat\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lplong\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lpdouble\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lpfloat\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lplong\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: many changed" # Step over: @@ -217,7 +212,7 @@ mi_execute_to "exec-step 4" "end-stepping-range" "do_locals_tests" "" \ # Test: c_variable-2.7 # Desc: check whether (lsimple.signed_character, lsimple.char_ptr) lpsimple, func changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"func\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpsimple\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"func\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lpsimple\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: func and lpsimple changed" # Step over @@ -239,7 +234,7 @@ mi_execute_to "exec-step 8" "end-stepping-range" "do_locals_tests" "" \ # Note: this test also checks that lpsimple->integer and lsimple.integer have # changed (they are the same) mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: lsimple and others changed" @@ -262,7 +257,7 @@ mi_gdb_test "-var-assign linteger 3333" \ # change. set lpchar_update "\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\}," mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[($lpchar_update)?\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[($lpchar_update)?\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: linteger changed after assign" mi_gdb_test "-var-assign linteger 3333" \ @@ -282,7 +277,7 @@ mi_gdb_test "-var-assign lpinteger \"&linteger + 3\"" \ "assign to lpinteger" mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: lpinteger changed after assign" mi_gdb_test "-var-update *" \ @@ -407,7 +402,7 @@ mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\ # Test: c_variable-2.13 # Desc: change subroutine1 local i mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"i\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"i\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: i changed" mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \ @@ -416,7 +411,7 @@ mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\ # Test: c_variable-2.14 # Desc: change do_locals_tests local llong mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"llong\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: llong changed" set line_dlt_call_subroutine1 [gdb_get_line_number "subroutine1 (linteger, &llong);"] @@ -426,7 +421,7 @@ mi_next_to "do_locals_tests" "" "var-cmd.c" \ # Test: c_variable-2.15 # Desc: check for out of scope subroutine1 locals mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"l\",in_scope=\"false\"\,type_changed=\"false\"},\{name=\"i\",in_scope=\"false\",type_changed=\"false\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"l\",in_scope=\"false\"\,type_changed=\"false\",has_more=\"0\"},\{name=\"i\",in_scope=\"false\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ "update all vars: all now out of scope" # Done with locals/globals tests. Erase all variables @@ -518,14 +513,14 @@ mi_gdb_test "-var-create selected_a @ a" \ mi_continue_to incr_a mi_gdb_test "-var-update selected_a" \ - "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"char\",new_num_children=\"0\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"char\",new_num_children=\"0\"\,has_more=\"0\"}\\\]" \ "update selected_a in incr_a" mi_next "step a line in incr_a" mi_next "return from incr_a to do_special_tests" mi_gdb_test "-var-update selected_a" \ - "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"int\",new_num_children=\"0\"\}\\\]" \ + "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"int\",new_num_children=\"0\",has_more=\"0\"\}\\\]" \ "update selected_a in do_special_tests" mi_gdb_test "-file-exec-and-symbols ${binfile}" "\\^done" \ diff --git a/gdb/testsuite/gdb.mi/mi2-var-display.exp b/gdb/testsuite/gdb.mi/mi2-var-display.exp index d6ce673..17e208a 100644 --- a/gdb/testsuite/gdb.mi/mi2-var-display.exp +++ b/gdb/testsuite/gdb.mi/mi2-var-display.exp @@ -557,7 +557,7 @@ mi_gdb_test "-var-info-num-children e" \ # Test: c_variable-7.55 # Desc: children of e mi_gdb_test "-var-list-children e" \ - "\\^done,numchild=\"0\"" \ + "\\^done,numchild=\"0\",has_more=\"0\"" \ "get children of e" # Test: c_variable-7.60 @@ -599,7 +599,7 @@ mi_gdb_test "-var-info-num-children anone" \ # Test: c_variable-7.75 # Desc: children of anone mi_gdb_test "-var-list-children anone" \ - "\\^done,numchild=\"0\"" \ + "\\^done,numchild=\"0\",has_more=\"0\"" \ "get children of anone" diff --git a/gdb/testsuite/gdb.python/py-mi.exp b/gdb/testsuite/gdb.python/py-mi.exp index d3f44b2..30d6f32 100644 --- a/gdb/testsuite/gdb.python/py-mi.exp +++ b/gdb/testsuite/gdb.python/py-mi.exp @@ -48,23 +48,53 @@ 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_floating_varobj container c "create container varobj" +mi_create_dynamic_varobj container c \ + "create container varobj, no pretty-printing" + +mi_list_varobj_children container { + { container.name name 1 string } + { container.len len 0 int } + { container.elements elements 1 "int ." } +} "examine container children=0, no pretty-printing" + +mi_delete_varobj container "delete varobj" + +mi_gdb_test "-enable-pretty-printing" "" + +mi_create_varobj_checked string string_1 \ + "struct string_repr" \ + "create string_1 varobj" + +mi_gdb_test "-data-evaluate-expression \"string_1 = string_2\"" ".*" \ + "assign string_1 from string_2" + +mi_gdb_test "-var-update string" \ + "\\^done,changelist=\\\[{name=\"string\",in_scope=\"true\",type_changed=\"false\",dynamic=\"1\",has_more=\"0\"}\\\]" \ + "update string varobj after assignment" + +mi_create_dynamic_varobj container c \ + "create container varobj" mi_list_varobj_children container { } "examine container children=0" mi_next "next over update 1" -mi_varobj_update_dynamic container { - { {container.\[0\]} {\[0\]} 0 int } -} "varobj update 1" +mi_varobj_update_dynamic container "varobj update 1" { + type_changed false new_num_children 1 dynamic 1 has_more 0 +} { +} { + { name {container.\[0\]} exp {\[0\]} numchild 0 type int thread-id 1 } +} mi_next "next over update 2" -mi_varobj_update_dynamic container { - { {container.\[0\]} {\[0\]} 0 int } - { {container.\[1\]} {\[1\]} 0 int } -} "varobj update 2" +mi_varobj_update_dynamic container "varobj update 2" { + type_changed false new_num_children 2 dynamic 1 has_more 0 +} { +} { + { name {container.\[1\]} exp {\[1\]} numchild 0 type int thread-id 1 } +} mi_gdb_test "-var-set-visualizer container None" \ "\\^done" \ @@ -78,19 +108,124 @@ mi_gdb_test "-var-set-visualizer container gdb.default_visualizer" \ "\\^done" \ "choose default visualizer" -mi_varobj_update_dynamic container { - { {container.\[0\]} {\[0\]} 0 int } - { {container.\[1\]} {\[1\]} 0 int } -} "varobj update after choosing default" +mi_varobj_update_dynamic container "varobj update after choosing default" { + type_changed false new_num_children 2 dynamic 1 has_more 0 +} { +} { + { name {container.\[0\]} exp {\[0\]} numchild 0 type int thread-id 1 } + { name {container.\[1\]} exp {\[1\]} numchild 0 type int thread-id 1 } +} mi_gdb_test "-var-set-visualizer container ContainerPrinter" \ "\\^done" \ "choose visualizer using expression" -mi_varobj_update_dynamic container { +mi_varobj_update_dynamic container \ + "varobj update after choosing via expression" { + type_changed false new_num_children 2 dynamic 1 has_more 0 + } { + } { + { name {container.\[0\]} exp {\[0\]} numchild 0 type int thread-id 1 } + { name {container.\[1\]} exp {\[1\]} numchild 0 type int thread-id 1 } + } + +mi_list_varobj_children_range container 1 2 2 { + { {container.\[1\]} {\[1\]} 0 int } +} "list varobj children after selecting child range" + +mi_list_varobj_children_range container -1 -1 2 { { {container.\[0\]} {\[0\]} 0 int } { {container.\[1\]} {\[1\]} 0 int } -} "varobj update after choosing via expression" +} "list varobj children after resetting child range" + +mi_next "next over update 3" + +mi_gdb_test "-var-set-update-range container 0 1" \ + "\\^done" \ + "set update range" + +# This should truncate the list. +mi_list_varobj_children container { + { {container.\[0\]} {\[0\]} 0 int } +} "list children after setting update range" + +# This should return just the items in [1,2). +mi_list_varobj_children_range container 1 2 2 { + { {container.\[1\]} {\[1\]} 0 int } +} "list selected children after setting range" + +# This should not be affected by the previous list-children request. +mi_list_varobj_children container { + { {container.\[0\]} {\[0\]} 0 int } +} "list children after listing selected range" + +mi_next "next over update 4" + +# This should only show the first child, because the update range has +# been set. +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 } + } { + } + +mi_gdb_test "-var-set-update-range container 3 4" \ + "\\^done" \ + "set update range with non-zero start" + +# Elements were updated but should not be reported. +mi_varobj_update_dynamic container \ + "update varobj with change outside selected range" { + type_changed false new_num_children 3 dynamic 1 has_more 0 + } { + } { + } + +mi_next "next over update 5" + +# Regression test: examine an object that has no children, then update +# it to ensure that we don't print the children. +mi_create_dynamic_varobj container2 c2 \ + "create second container varobj" + +mi_gdb_test "-var-update container2" \ + "\\^done,changelist=.." \ + "update varobj, no children requested" + +mi_next "next over update 6" + +# Now container2 has an element -- and an update should mention that +# it has_more. But, because we did not request children, we still +# should not actually see them. +mi_varobj_update_dynamic container2 \ + "update varobj 2, no children requested" { + type_changed false dynamic 1 has_more 1 + } {} {} + +mi_continue_to_line \ + [gdb_get_line_number {MI outer breakpoint here} ${testfile}.c] \ + "step to outer breakpoint" + +mi_create_dynamic_varobj outer outer \ + "create outer varobj" + +mi_list_varobj_children outer { + { outer.s s 2 "struct substruct" } + { outer.x x 0 "int" } +} "list children of outer" + +mi_list_varobj_children outer.s { + { outer.s.a a 0 int } + { outer.s.b b 0 int } +} "list children of 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\"}." \ + "update after updating element of outer" mi_continue_to_line \ [gdb_get_line_number {Another MI breakpoint} ${testfile}.c] \ diff --git a/gdb/testsuite/gdb.python/py-prettyprint.c b/gdb/testsuite/gdb.python/py-prettyprint.c index 3cafc48..7f16400 100644 --- a/gdb/testsuite/gdb.python/py-prettyprint.c +++ b/gdb/testsuite/gdb.python/py-prettyprint.c @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <string.h> + struct s { int a; @@ -80,6 +82,29 @@ class Derived : public Vbase1, public Vbase2, public Vbase3 #endif +struct substruct { + int a; + int b; +}; + +struct outerstruct { + struct substruct s; + int x; +}; + +struct outerstruct +substruct_test (void) +{ + struct outerstruct outer; + outer.s.a = 0; + outer.s.b = 0; + outer.x = 0; + + outer.s.a = 3; /* MI outer breakpoint here */ + + return outer; +} + typedef struct string_repr { struct whybother @@ -148,6 +173,14 @@ void do_nothing(void) c = 23; /* Another MI breakpoint */ } +struct nullstr +{ + char *s; +}; + +struct string_repr string_1 = { { "one" } }; +struct string_repr string_2 = { { "two" } }; + int main () { @@ -155,11 +188,15 @@ main () struct ss ssa[2]; string x = make_string ("this is x"); zzz_type c = make_container ("container"); + zzz_type c2 = make_container ("container2"); const struct string_repr cstring = { { "const string" } }; + /* Clearing by being `static' could invoke an other GDB C++ bug. */ + struct nullstr nullstr; init_ss(&ss, 1, 2); init_ss(ssa+0, 3, 4); init_ss(ssa+1, 5, 6); + memset (&nullstr, 0, sizeof nullstr); struct ns ns; ns.null_str = "embedded\0null\0string"; @@ -193,6 +230,14 @@ main () add_item (&c, 72); #ifdef MI + add_item (&c, 1011); + c.elements[0] = 1023; + c.elements[0] = 2323; + + add_item (&c2, 2222); + add_item (&c2, 3333); + + substruct_test (); do_nothing (); #endif diff --git a/gdb/testsuite/gdb.python/py-prettyprint.py b/gdb/testsuite/gdb.python/py-prettyprint.py index bf009a1..2f070d8 100644 --- a/gdb/testsuite/gdb.python/py-prettyprint.py +++ b/gdb/testsuite/gdb.python/py-prettyprint.py @@ -92,6 +92,13 @@ class pp_vbase1: def to_string (self): return "pp class name: " + self.val.type.tag +class pp_nullstr: + def __init__(self, val): + self.val = val + + def to_string(self): + return self.val['s'].string(gdb.parameter('target-charset')) + class pp_ns: "Print a std::basic_string of some kind" @@ -105,11 +112,24 @@ class pp_ns: def display_hint (self): return 'string' +class pp_outer: + "Print struct outer" + + def __init__ (self, val): + self.val = val + + def to_string (self): + return "x = %s" % self.val['x'] + + def children (self): + yield 's', self.val['s'] + yield 'x', self.val['x'] + def lookup_function (val): "Look-up and return a pretty-printer that can print val." # Get the type. - type = val.type; + type = val.type # If it points to a reference, get the reference. if type.code == gdb.TYPE_CODE_REF: @@ -148,6 +168,9 @@ def register_pretty_printers (): pretty_printers_dict[re.compile ('^VirtualTest$')] = pp_multiple_virtual pretty_printers_dict[re.compile ('^Vbase1$')] = pp_vbase1 + + pretty_printers_dict[re.compile ('^struct nullstr$')] = pp_nullstr + pretty_printers_dict[re.compile ('^nullstr$')] = pp_nullstr # Note that we purposely omit the typedef names here. # Printer lookup is based on canonical name. @@ -160,6 +183,10 @@ def register_pretty_printers (): pretty_printers_dict[re.compile ('^struct ns$')] = pp_ns pretty_printers_dict[re.compile ('^ns$')] = pp_ns + + pretty_printers_dict[re.compile ('^struct outerstruct$')] = pp_outer + pretty_printers_dict[re.compile ('^outerstruct$')] = pp_outer + pretty_printers_dict = {} register_pretty_printers () diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index e691232..167a02c 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -1195,13 +1195,13 @@ proc mi_list_breakpoints { expected test } { # Name cannot be "-". proc mi_create_varobj { name expression testname } { mi_gdb_test "-var-create $name * $expression" \ - "\\^done,name=\"$name\",numchild=\"\[0-9\]+\",value=\".*\",type=.*" \ + "\\^done,name=\"$name\",numchild=\"\[0-9\]+\",value=\".*\",type=.*,has_more=\"0\"" \ $testname } proc mi_create_floating_varobj { name expression testname } { mi_gdb_test "-var-create $name @ $expression" \ - "\\^done,name=\"$name\",numchild=\"\[0-9\]+\",value=\".*\",type=.*" \ + "\\^done,name=\"$name\",numchild=\"\(-1\|\[0-9\]+\)\",value=\".*\",type=.*" \ $testname } @@ -1214,6 +1214,14 @@ proc mi_create_varobj_checked { name expression type testname } { $testname } +# Same as mi_create_floating_varobj, but assumes the test is creating +# a dynamic varobj that has children, so the value must be "{...}". +proc mi_create_dynamic_varobj {name expression testname} { + mi_gdb_test "-var-create $name @ $expression" \ + "\\^done,name=\"$name\",numchild=\"\(-1\|\[0-9\]+\)\",value=\"{\\.\\.\\.}\",type=.*" \ + $testname +} + # Deletes the specified NAME. proc mi_delete_varobj { name testname } { mi_gdb_test "-var-delete $name" \ @@ -1229,7 +1237,7 @@ proc mi_varobj_update { name expected testname } { set er "\\^done,changelist=\\\[" set first 1 foreach item $expected { - set v "{name=\"$item\",in_scope=\"true\",type_changed=\"false\"}" + set v "{name=\"$item\",in_scope=\"true\",type_changed=\"false\",has_more=\".\"}" if {$first == 1} { set er "$er$v" set first 0 @@ -1244,22 +1252,70 @@ proc mi_varobj_update { name expected testname } { } proc mi_varobj_update_with_type_change { name new_type new_children testname } { - set v "{name=\"$name\",in_scope=\"true\",type_changed=\"true\",new_type=\"$new_type\",new_num_children=\"$new_children\"}" + set v "{name=\"$name\",in_scope=\"true\",type_changed=\"true\",new_type=\"$new_type\",new_num_children=\"$new_children\",has_more=\".\"}" set er "\\^done,changelist=\\\[$v\\\]" verbose -log "Expecting: $er" mi_gdb_test "-var-update $name" $er $testname } -# Update a dynamic varobj named NAME. CHILDREN is a list of children, -# in the same form as mi_list_varobj_children. TESTNAME is the name -# of the test. -proc mi_varobj_update_dynamic {name children testname} { - set children_exp_j [mi_child_regexp $children 0] +# A helper that turns a key/value list into a regular expression +# matching some MI output. +proc mi_varobj_update_kv_helper {list} { + set first 1 + set rx "" + foreach {key value} $list { + if {!$first} { + append rx , + } + set first 0 + if {$key == "new_children"} { + append rx "$key=\\\[$value\\\]" + } else { + append rx "$key=\"$value\"" + } + } + return $rx +} - set er "\\^done,changelist=\\\[" +# A helper for mi_varobj_update_dynamic that computes a match +# expression given a child list. +proc mi_varobj_update_dynamic_helper {children} { + set crx "" - append er "{name=\"$name\",in_scope=\"true\",type_changed=\"false\"" - append er ",children=\\\[$children_exp_j.*\\\]}\\\]" + set first 1 + foreach child $children { + if {!$first} { + append crx , + } + set first 0 + append crx "{" + append crx [mi_varobj_update_kv_helper $child] + append crx "}" + } + + return $crx +} + +# Update a dynamic varobj named NAME. CHILDREN is a list of children +# that have been updated; NEW_CHILDREN is a list of children that were +# added to the primary varobj. Each child is a list of key/value +# pairs that are expected. SELF is a key/value list holding +# information about the varobj itself. TESTNAME is the name of the +# test. +proc mi_varobj_update_dynamic {name testname self children new_children} { + if {[llength $new_children]} { + set newrx [mi_varobj_update_dynamic_helper $new_children] + lappend self new_children $newrx + } + set selfrx [mi_varobj_update_kv_helper $self] + set crx [mi_varobj_update_dynamic_helper $children] + + set er "\\^done,changelist=\\\[\{name=\"$name\",in_scope=\"true\"" + append er ",$selfrx\}" + if {"$crx" != ""} { + append er ",$crx" + } + append er "\\\]" verbose -log "Expecting: $er" mi_gdb_test "-var-update $name" $er $testname @@ -1329,14 +1385,13 @@ proc mi_child_regexp {children add_child} { # have no value. # proc mi_list_varobj_children { varname children testname } { - mi_list_varobj_children_range $varname [llength $children] $children \ + mi_list_varobj_children_range $varname "" "" [llength $children] $children \ $testname } -# Like mi_list_varobj_children, but assumes that a subrange has been -# selected with -var-set-child-range. NUMCHILDREN is the total number -# of children. -proc mi_list_varobj_children_range {varname numchildren children testname} { +# Like mi_list_varobj_children, but sets a subrange. NUMCHILDREN is +# the total number of children. +proc mi_list_varobj_children_range {varname from to numchildren children testname} { set options "" if {[llength $varname] == 2} { set options [lindex $varname 1] @@ -1352,9 +1407,18 @@ proc mi_list_varobj_children_range {varname numchildren children testname} { set expected "\\^done,numchild=\"0\"" } + if {"$to" == ""} { + append expected ",has_more=\"0\"" + } elseif {$to >= 0 && $numchildren > $to} { + append expected ",has_more=\"1\"" + } else { + append expected ",has_more=\"0\"" + } + verbose -log "Expecting: $expected" - mi_gdb_test "-var-list-children $options $varname" $expected $testname + mi_gdb_test "-var-list-children $options $varname $from $to" \ + $expected $testname } # Verifies that variable object VARNAME has NUMBER children, |