diff options
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi-var-cmd.exp')
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-var-cmd.exp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp index 70a0d68..8be0d8d 100644 --- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp +++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp @@ -519,5 +519,34 @@ mi_gdb_test "-var-delete l" \ "\\^done,ndeleted=\"1\"" \ "delete var l" +# Test whether we can follow the name of a variable through multiple +# stack frames. +mi_gdb_test "-break-insert do_special_tests" \ + {\^done,bkpt=.*} \ + "set breakpoint at do_special_tests" + +mi_continue_to {.*} do_special_tests {.*} {.*var-cmd.c} {.*} {stop in do_special_tests} + +mi_gdb_test "-var-create selected_a @ a" \ + {\^done,name="selected_a",numchild="0",type="int"} \ + "create selected_a" + +mi_gdb_test "-break-insert incr_a" \ + {\^done,bkpt=.*} \ + "set breakpoint at incr_a" + +mi_continue_to {.*} incr_a {.*} {.*var-cmd.c} {.*} {stop in incr_a} + +mi_gdb_test "-var-update selected_a" \ + {\^done,changelist=\{name="selected_a",in_scope="true",new_type="char",new_num_children="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",new_type="int",new_num_children="0"\}} \ + "update selected_a in do_special_tests" + mi_gdb_exit return 0 |