From b6846ba57b4c6a8b613deefdaba512598ea3d0d0 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Thu, 23 Dec 2021 15:48:47 +0000 Subject: gdb/testsuite: resolve some duplicate testnames in gdb.mi Set of fixes to resolve some duplicate test names in the gdb.mi/ directory. There should be no real test changes after this set of fixes, they are all either: - Adding with_test_prefix type constructs to make test names unique, or - Changing the test name to be more descriptive, or better reflect the test being run. --- gdb/testsuite/gdb.mi/mi-syn-frame.exp | 12 +- gdb/testsuite/gdb.mi/mi-var-child.exp | 10 +- gdb/testsuite/gdb.mi/mi-var-rtti.cc | 48 ++--- gdb/testsuite/gdb.mi/mi-watch.exp | 2 +- gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp | 236 +++++++++++++------------ gdb/testsuite/gdb.mi/mi2-var-child.exp | 10 +- 6 files changed, 170 insertions(+), 148 deletions(-) diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.exp b/gdb/testsuite/gdb.mi/mi-syn-frame.exp index 21f506b..0d9a710 100644 --- a/gdb/testsuite/gdb.mi/mi-syn-frame.exp +++ b/gdb/testsuite/gdb.mi/mi-syn-frame.exp @@ -55,11 +55,12 @@ mi_gdb_test "402-stack-list-frames" "402\\^done,stack=\\\[frame=\{level=\"0\",ad # mi_send_resuming_command "exec-continue" "testing exec continue" -mi_expect_stop "really-no-reason" "" "" "" "" "" "finished exec continue" +mi_expect_stop "really-no-reason" "" "" "" "" "" \ + "finished exec continue after calling foo" mi_gdb_test "404-stack-list-frames 0 0" \ "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\}.*\\\]" \ - "list stack frames" + "list stack frames, back in main after calling foo" # @@ -79,16 +80,17 @@ mi_gdb_test "406-data-evaluate-expression have_a_very_merry_interrupt()" \ mi_gdb_test "407-stack-list-frames" \ "407\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"handler\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"\"\},.*frame=\{level=\"$decimal\",addr=\"$hex\",func=\"have_a_very_merry_interrupt\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\}.*\\\]" \ - "list stack frames" + "list stack frames, with signal handler and dummy frame" mi_send_resuming_command "exec-continue" "testing exec continue" -mi_expect_stop "really-no-reason" "" "" "" "" "" "finished exec continue" +mi_expect_stop "really-no-reason" "" "" "" "" "" \ + "finished exec continue after calling have_a_very_merry_interrupt" mi_gdb_test "409-stack-list-frames 0 0" \ "409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\}.*\\\]" \ - "list stack frames" + "list stack frames, back in main after calling have_a_very_merry_interrupt" # # Call bar() by hand, which should get an exception while running. diff --git a/gdb/testsuite/gdb.mi/mi-var-child.exp b/gdb/testsuite/gdb.mi/mi-var-child.exp index 63cea06..28f8ec0 100644 --- a/gdb/testsuite/gdb.mi/mi-var-child.exp +++ b/gdb/testsuite/gdb.mi/mi-var-child.exp @@ -899,7 +899,7 @@ mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" { {{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr.\*\*\*psnp->char_ptr.\*\*\*\*psnp->char_ptr} \ {\*\*\*\*psnp->char_ptr} 0 char} -} "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" +} "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr after counting children" # Test: c_variable-5.18 # Desc: number of children of *(*(*(psnp->char_ptr))) @@ -1077,7 +1077,7 @@ mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" { mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" { {{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr.\*\*\*\*char_ptr} \ {\*\*\*\*char_ptr} 0 char} -} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" +} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" # Test: c_variable-5.42 # Desc: number of children of **psnp->ptrs[0]->next->char_ptr @@ -1090,7 +1090,7 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" { {{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr.\*\*\*\*char_ptr} \ {\*\*\*\*char_ptr} 0 char} -} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" +} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr after counting children" # Test: c_variable-5.44 # Desc: number of children of ***psnp->ptrs[0]->next->char_ptr @@ -1101,13 +1101,13 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ # Test: c_variable-5.43B # Desc: children of ****psnp->ptrs[0]->next->char_ptr mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" {} \ - "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" + "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" # Test: c_variable-5.44B # Desc: number of children of ****psnp->ptrs[0]->next->char_ptr mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \ "\\^done,numchild=\"0\"" \ - "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" + "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" # Test: c_variable-5.45 # Desc: children of psnp->ptrs[0]->next->next diff --git a/gdb/testsuite/gdb.mi/mi-var-rtti.cc b/gdb/testsuite/gdb.mi/mi-var-rtti.cc index 30b4617..6a78a26 100644 --- a/gdb/testsuite/gdb.mi/mi-var-rtti.cc +++ b/gdb/testsuite/gdb.mi/mi-var-rtti.cc @@ -218,7 +218,7 @@ void use_rtti_with_multiple_inheritence_test () } "list children of ptr.First (with RTTI) in $testname" mi_list_varobj_children "VAR.First.public" { { VAR.First.public.F F 0 int } - } "list children of ptr.Base.public (with RTTI) in $testname" + } "list children of ptr.First.public (with RTTI) in $testname" mi_list_varobj_children "VAR.Base" { { VAR.Base.public public 1 } } "list children of ptr.Base (with RTTI) in $testname" @@ -307,43 +307,49 @@ void skip_type_update_when_not_use_rtti_test () /*: set testname skip_type_update_when_not_use_rtti - set_print_object off $testname - mi_create_varobj_checked PTR ptr {Base \*} \ + with_test_prefix "ptr is nullptr" { + set_print_object off $testname + mi_create_varobj_checked PTR ptr {Base \*} \ "create varobj for ptr in $testname" - check_derived_children_without_rtti PTR ptr $testname - - mi_create_varobj S s "create varobj for S in $testname" - mi_list_varobj_children S { - { S.public public 1 } - } "list children of s in $testname" - mi_list_varobj_children S.public { - { S.public.ptr ptr 1 {Base \*} } - } "list children of s.public in $testname" - check_derived_children_without_rtti S.public.ptr s.ptr $testname + check_derived_children_without_rtti PTR ptr $testname + + mi_create_varobj S s "create varobj for S in $testname" + mi_list_varobj_children S { + { S.public public 1 } + } "list children of s in $testname" + mi_list_varobj_children S.public { + { S.public.ptr ptr 1 {Base \*} } + } "list children of s.public in $testname" + check_derived_children_without_rtti S.public.ptr s.ptr $testname + } :*/ ptr = &d; s.ptr = &d; /*: - mi_varobj_update PTR {PTR PTR.public.A} \ + with_test_prefix "ptr points at d" { + mi_varobj_update PTR {PTR PTR.public.A} \ "update ptr to derived type in $testname" - check_derived_without_rtti PTR ptr $testname + check_derived_without_rtti PTR ptr $testname - mi_varobj_update S {S.public.ptr S.public.ptr.public.A} \ + mi_varobj_update S {S.public.ptr S.public.ptr.public.A} \ "update s to derived type in $testname" - check_derived_without_rtti S.public.ptr s.ptr $testname + check_derived_without_rtti S.public.ptr s.ptr $testname + } :*/ ptr = 0; s.ptr = 0; /*: - mi_varobj_update PTR {PTR PTR.public.A} \ + with_test_prefix "ptr is nullptr again" { + mi_varobj_update PTR {PTR PTR.public.A} \ "update ptr back to base type in $testname" - mi_delete_varobj PTR "delete varobj for ptr in $testname" + mi_delete_varobj PTR "delete varobj for ptr in $testname" - mi_varobj_update S {S.public.ptr S.public.ptr.public.A} \ + mi_varobj_update S {S.public.ptr S.public.ptr.public.A} \ "update s back to base type in $testname" - mi_delete_varobj S "delete varobj for s in $testname" + mi_delete_varobj S "delete varobj for s in $testname" + } :*/ return; /*: END: skip_type_update_when_not_use_rtti :*/ diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-watch.exp index eb037bc..f850724 100644 --- a/gdb/testsuite/gdb.mi/mi-watch.exp +++ b/gdb/testsuite/gdb.mi/mi-watch.exp @@ -131,7 +131,7 @@ proc test_watchpoint_triggering {} { mi_execute_to "exec-continue" "watchpoint-scope" "callee3" ".*" \ ".*basics.c" $line_callee3_close_brace \ {"" "wpnum=\"2\""} \ - "watchpoint trigger" + "watchpoint scope" } proc test_watchpoint_all {mi_mode type} { diff --git a/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp b/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp index 4505bfa..cf60242 100644 --- a/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp +++ b/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp @@ -49,121 +49,135 @@ foreach name {different breakhere_different breakhere_validity breakhere_invalid # Test various kinds of `set print entry-values'. -if {[mi_runto_main] == -1} { - return -1 +with_test_prefix "entry-values=no" { + if {[mi_runto_main] == -1} { + return -1 + } + mi_gdb_test "-gdb-set print entry-values no" {\^done} "no: set print entry-values" + mi_send_resuming_command "exec-continue" "no: entry_equal: continue" + mi_expect_stop "breakpoint-hit" .* {{name="val",value="5"}} .* .* {.* disp="keep"} "no: entry_equal: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="5"}\]} "no: entry_equal: -stack-list-variables" + mi_send_resuming_command "exec-continue" "no: entry_different: continue" + mi_expect_stop "breakpoint-hit" .* {{name="val",value="6"}} .* .* {.* disp="keep"} "no: entry_different: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="6"}\]} "no: entry_different: -stack-list-variables" + mi_send_resuming_command "exec-continue" "no: validity: continue" + mi_expect_stop "breakpoint-hit" .* {{name="lost",value=""},{name="born",value="10"}} .* .* {.* disp="keep"} "no: validity: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost",arg="1",value=""},{name="born",arg="1",value="10"}\]} "no: validity: -stack-list-variables" + mi_send_resuming_command "exec-continue" "no: invalid: continue" + mi_expect_stop "breakpoint-hit" .* {{name="inv",value=""}} .* .* {.* disp="keep"} "no: invalid: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value=""}\]} "no: invalid: -stack-list-variables" } -mi_gdb_test "-gdb-set print entry-values no" {\^done} "no: set print entry-values" -mi_send_resuming_command "exec-continue" "no: entry_equal: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="5"}} .* .* {.* disp="keep"} "no: entry_equal: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="5"}\]} "no: entry_equal: -stack-list-variables" -mi_send_resuming_command "exec-continue" "no: entry_different: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="6"}} .* .* {.* disp="keep"} "no: entry_different: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="6"}\]} "no: entry_different: -stack-list-variables" -mi_send_resuming_command "exec-continue" "no: validity: continue" -mi_expect_stop "breakpoint-hit" .* {{name="lost",value=""},{name="born",value="10"}} .* .* {.* disp="keep"} "no: validity: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost",arg="1",value=""},{name="born",arg="1",value="10"}\]} "no: validity: -stack-list-variables" -mi_send_resuming_command "exec-continue" "no: invalid: continue" -mi_expect_stop "breakpoint-hit" .* {{name="inv",value=""}} .* .* {.* disp="keep"} "no: invalid: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value=""}\]} "no: invalid: -stack-list-variables" - -if {[mi_runto_main] == -1} { - return -1 + +with_test_prefix "entry-values=only" { + if {[mi_runto_main] == -1} { + return -1 + } + mi_gdb_test "-gdb-set print entry-values only" {\^done} "only: set print entry-values" + mi_send_resuming_command "exec-continue" "only: entry_equal: continue" + mi_expect_stop "breakpoint-hit" .* {{name="val@entry",value="5"}} .* .* {.* disp="keep"} "only: entry_equal: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val@entry",arg="1",value="5"}\]} "only: entry_equal: -stack-list-variables" + mi_send_resuming_command "exec-continue" "only: entry_different: continue" + mi_expect_stop "breakpoint-hit" .* {{name="val@entry",value="5"}} .* .* {.* disp="keep"} "only: entry_different: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val@entry",arg="1",value="5"}\]} "only: entry_different: -stack-list-variables" + mi_send_resuming_command "exec-continue" "only: validity: continue" + mi_expect_stop "breakpoint-hit" .* {{name="lost@entry",value="5"},{name="born@entry",value=""}} .* .* {.* disp="keep"} "only: validity: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost@entry",arg="1",value="5"},{name="born@entry",arg="1",value=""}\]} "only: validity: -stack-list-variables" + mi_send_resuming_command "exec-continue" "only: invalid: continue" + mi_expect_stop "breakpoint-hit" .* {{name="inv@entry",value=""}} .* .* {.* disp="keep"} "only: invalid: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv@entry",arg="1",value=""}\]} "only: invalid: -stack-list-variables" } -mi_gdb_test "-gdb-set print entry-values only" {\^done} "only: set print entry-values" -mi_send_resuming_command "exec-continue" "only: entry_equal: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val@entry",value="5"}} .* .* {.* disp="keep"} "only: entry_equal: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val@entry",arg="1",value="5"}\]} "only: entry_equal: -stack-list-variables" -mi_send_resuming_command "exec-continue" "only: entry_different: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val@entry",value="5"}} .* .* {.* disp="keep"} "only: entry_different: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val@entry",arg="1",value="5"}\]} "only: entry_different: -stack-list-variables" -mi_send_resuming_command "exec-continue" "only: validity: continue" -mi_expect_stop "breakpoint-hit" .* {{name="lost@entry",value="5"},{name="born@entry",value=""}} .* .* {.* disp="keep"} "only: validity: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost@entry",arg="1",value="5"},{name="born@entry",arg="1",value=""}\]} "only: validity: -stack-list-variables" -mi_send_resuming_command "exec-continue" "only: invalid: continue" -mi_expect_stop "breakpoint-hit" .* {{name="inv@entry",value=""}} .* .* {.* disp="keep"} "only: invalid: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv@entry",arg="1",value=""}\]} "only: invalid: -stack-list-variables" - -if {[mi_runto_main] == -1} { - return -1 + +with_test_prefix "entry-values=preferred" { + if {[mi_runto_main] == -1} { + return -1 + } + mi_gdb_test "-gdb-set print entry-values preferred" {\^done} "preferred: set print entry-values" + mi_send_resuming_command "exec-continue" "preferred: entry_equal: continue" + mi_expect_stop "breakpoint-hit" .* {{name="val@entry",value="5"}} .* .* {.* disp="keep"} "preferred: entry_equal: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val@entry",arg="1",value="5"}\]} "preferred: entry_equal: -stack-list-variables" + mi_send_resuming_command "exec-continue" "preferred: entry_different: continue" + mi_expect_stop "breakpoint-hit" .* {{name="val@entry",value="5"}} .* .* {.* disp="keep"} "preferred: entry_different: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val@entry",arg="1",value="5"}\]} "preferred: entry_different: -stack-list-variables" + mi_send_resuming_command "exec-continue" "preferred: validity: continue" + mi_expect_stop "breakpoint-hit" .* {{name="lost@entry",value="5"},{name="born",value="10"}} .* .* {.* disp="keep"} "preferred: validity: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"}\]} "preferred: validity: -stack-list-variables" + mi_send_resuming_command "exec-continue" "preferred: invalid: continue" + mi_expect_stop "breakpoint-hit" .* {{name="inv@entry",value=""}} .* .* {.* disp="keep"} "preferred: invalid: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv@entry",arg="1",value=""}\]} "preferred: invalid: -stack-list-variables" } -mi_gdb_test "-gdb-set print entry-values preferred" {\^done} "preferred: set print entry-values" -mi_send_resuming_command "exec-continue" "preferred: entry_equal: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val@entry",value="5"}} .* .* {.* disp="keep"} "preferred: entry_equal: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val@entry",arg="1",value="5"}\]} "preferred: entry_equal: -stack-list-variables" -mi_send_resuming_command "exec-continue" "preferred: entry_different: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val@entry",value="5"}} .* .* {.* disp="keep"} "preferred: entry_different: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val@entry",arg="1",value="5"}\]} "preferred: entry_different: -stack-list-variables" -mi_send_resuming_command "exec-continue" "preferred: validity: continue" -mi_expect_stop "breakpoint-hit" .* {{name="lost@entry",value="5"},{name="born",value="10"}} .* .* {.* disp="keep"} "preferred: validity: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"}\]} "preferred: validity: -stack-list-variables" -mi_send_resuming_command "exec-continue" "preferred: invalid: continue" -mi_expect_stop "breakpoint-hit" .* {{name="inv@entry",value=""}} .* .* {.* disp="keep"} "preferred: invalid: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv@entry",arg="1",value=""}\]} "preferred: invalid: -stack-list-variables" - -if {[mi_runto_main] == -1} { - return -1 + +with_test_prefix "entry-values=if-needed" { + if {[mi_runto_main] == -1} { + return -1 + } + mi_gdb_test "-gdb-set print entry-values if-needed" {\^done} "if-needed: set print entry-values" + mi_send_resuming_command "exec-continue" "if-needed: entry_equal: continue" + mi_expect_stop "breakpoint-hit" .* {{name="val",value="5"}} .* .* {.* disp="keep"} "if-needed: entry_equal: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="5"}\]} "if-needed: entry_equal: -stack-list-variables" + mi_send_resuming_command "exec-continue" "if-needed: entry_different: continue" + mi_expect_stop "breakpoint-hit" .* {{name="val",value="6"}} .* .* {.* disp="keep"} "if-needed: entry_different: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="6"}\]} "if-needed: entry_different: -stack-list-variables" + mi_send_resuming_command "exec-continue" "if-needed: validity: continue" + mi_expect_stop "breakpoint-hit" .* {{name="lost@entry",value="5"},{name="born",value="10"}} .* .* {.* disp="keep"} "if-needed: validity: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"}\]} "if-needed: validity: -stack-list-variables" + mi_send_resuming_command "exec-continue" "if-needed: invalid: continue" + mi_expect_stop "breakpoint-hit" .* {{name="inv",value=""}} .* .* {.* disp="keep"} "if-needed: invalid: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value=""}\]} "if-needed: invalid: -stack-list-variables" } -mi_gdb_test "-gdb-set print entry-values if-needed" {\^done} "if-needed: set print entry-values" -mi_send_resuming_command "exec-continue" "if-needed: entry_equal: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="5"}} .* .* {.* disp="keep"} "if-needed: entry_equal: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="5"}\]} "if-needed: entry_equal: -stack-list-variables" -mi_send_resuming_command "exec-continue" "if-needed: entry_different: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="6"}} .* .* {.* disp="keep"} "if-needed: entry_different: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="6"}\]} "if-needed: entry_different: -stack-list-variables" -mi_send_resuming_command "exec-continue" "if-needed: validity: continue" -mi_expect_stop "breakpoint-hit" .* {{name="lost@entry",value="5"},{name="born",value="10"}} .* .* {.* disp="keep"} "if-needed: validity: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"}\]} "if-needed: validity: -stack-list-variables" -mi_send_resuming_command "exec-continue" "if-needed: invalid: continue" -mi_expect_stop "breakpoint-hit" .* {{name="inv",value=""}} .* .* {.* disp="keep"} "if-needed: invalid: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value=""}\]} "if-needed: invalid: -stack-list-variables" - -if {[mi_runto_main] == -1} { - return -1 + +with_test_prefix "entry-values=both" { + if {[mi_runto_main] == -1} { + return -1 + } + mi_gdb_test "-gdb-set print entry-values both" {\^done} "both: set print entry-values" + mi_send_resuming_command "exec-continue" "both: entry_equal: continue" + mi_expect_stop "breakpoint-hit" .* {{name="val",value="5"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "both: entry_equal: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="5"},{name="val@entry",arg="1",value="5"}\]} "both: entry_equal: -stack-list-variables" + mi_send_resuming_command "exec-continue" "both: entry_different: continue" + mi_expect_stop "breakpoint-hit" .* {{name="val",value="6"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "both: entry_different: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="6"},{name="val@entry",arg="1",value="5"}\]} "both: entry_different: -stack-list-variables" + mi_send_resuming_command "exec-continue" "both: validity: continue" + mi_expect_stop "breakpoint-hit" .* {{name="lost",value=""},{name="lost@entry",value="5"},{name="born",value="10"},{name="born@entry",value=""}} .* .* {.* disp="keep"} "both: validity: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost",arg="1",value=""},{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"},{name="born@entry",arg="1",value=""}\]} "both: validity: -stack-list-variables" + mi_send_resuming_command "exec-continue" "both: invalid: continue" + mi_expect_stop "breakpoint-hit" .* {{name="inv",value=""},{name="inv@entry",value=""}} .* .* {.* disp="keep"} "both: invalid: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value=""},{name="inv@entry",arg="1",value=""}\]} "both: invalid: -stack-list-variables" } -mi_gdb_test "-gdb-set print entry-values both" {\^done} "both: set print entry-values" -mi_send_resuming_command "exec-continue" "both: entry_equal: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="5"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "both: entry_equal: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="5"},{name="val@entry",arg="1",value="5"}\]} "both: entry_equal: -stack-list-variables" -mi_send_resuming_command "exec-continue" "both: entry_different: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="6"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "both: entry_different: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="6"},{name="val@entry",arg="1",value="5"}\]} "both: entry_different: -stack-list-variables" -mi_send_resuming_command "exec-continue" "both: validity: continue" -mi_expect_stop "breakpoint-hit" .* {{name="lost",value=""},{name="lost@entry",value="5"},{name="born",value="10"},{name="born@entry",value=""}} .* .* {.* disp="keep"} "both: validity: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost",arg="1",value=""},{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"},{name="born@entry",arg="1",value=""}\]} "both: validity: -stack-list-variables" -mi_send_resuming_command "exec-continue" "both: invalid: continue" -mi_expect_stop "breakpoint-hit" .* {{name="inv",value=""},{name="inv@entry",value=""}} .* .* {.* disp="keep"} "both: invalid: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value=""},{name="inv@entry",arg="1",value=""}\]} "both: invalid: -stack-list-variables" - -if {[mi_runto_main] == -1} { - return -1 + +with_test_prefix "entry-values=compact" { + if {[mi_runto_main] == -1} { + return -1 + } + mi_gdb_test "-gdb-set print entry-values compact" {\^done} "compact: set print entry-values" + mi_send_resuming_command "exec-continue" "compact: entry_equal: continue" + mi_expect_stop "breakpoint-hit" .* {{name="val",value="5"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "compact: entry_equal: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="5"},{name="val@entry",arg="1",value="5"}\]} "compact: entry_equal: -stack-list-variables" + mi_send_resuming_command "exec-continue" "compact: entry_different: continue" + mi_expect_stop "breakpoint-hit" .* {{name="val",value="6"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "compact: entry_different: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="6"},{name="val@entry",arg="1",value="5"}\]} "compact: entry_different: -stack-list-variables" + mi_send_resuming_command "exec-continue" "compact: validity: continue" + mi_expect_stop "breakpoint-hit" .* {{name="lost@entry",value="5"},{name="born",value="10"}} .* .* {.* disp="keep"} "compact: validity: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"}\]} "compact: validity: -stack-list-variables" + mi_send_resuming_command "exec-continue" "compact: invalid: continue" + mi_expect_stop "breakpoint-hit" .* {{name="inv",value=""}} .* .* {.* disp="keep"} "compact: invalid: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value=""}\]} "compact: invalid: -stack-list-variables" } -mi_gdb_test "-gdb-set print entry-values compact" {\^done} "compact: set print entry-values" -mi_send_resuming_command "exec-continue" "compact: entry_equal: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="5"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "compact: entry_equal: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="5"},{name="val@entry",arg="1",value="5"}\]} "compact: entry_equal: -stack-list-variables" -mi_send_resuming_command "exec-continue" "compact: entry_different: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="6"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "compact: entry_different: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="6"},{name="val@entry",arg="1",value="5"}\]} "compact: entry_different: -stack-list-variables" -mi_send_resuming_command "exec-continue" "compact: validity: continue" -mi_expect_stop "breakpoint-hit" .* {{name="lost@entry",value="5"},{name="born",value="10"}} .* .* {.* disp="keep"} "compact: validity: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"}\]} "compact: validity: -stack-list-variables" -mi_send_resuming_command "exec-continue" "compact: invalid: continue" -mi_expect_stop "breakpoint-hit" .* {{name="inv",value=""}} .* .* {.* disp="keep"} "compact: invalid: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value=""}\]} "compact: invalid: -stack-list-variables" - -if {[mi_runto_main] == -1} { - return -1 + +with_test_prefix "entry-values=default" { + if {[mi_runto_main] == -1} { + return -1 + } + mi_gdb_test "-gdb-set print entry-values default" {\^done} "default: set print entry-values" + mi_send_resuming_command "exec-continue" "default: entry_equal: continue" + mi_expect_stop "breakpoint-hit" .* {{name="val",value="5"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "default: entry_equal: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="5"},{name="val@entry",arg="1",value="5"}\]} "default: entry_equal: -stack-list-variables" + mi_send_resuming_command "exec-continue" "default: entry_different: continue" + mi_expect_stop "breakpoint-hit" .* {{name="val",value="6"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "default: entry_different: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="6"},{name="val@entry",arg="1",value="5"}\]} "default: entry_different: -stack-list-variables" + mi_send_resuming_command "exec-continue" "default: validity: continue" + mi_expect_stop "breakpoint-hit" .* {{name="lost",value=""},{name="lost@entry",value="5"},{name="born",value="10"}} .* .* {.* disp="keep"} "default: validity: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost",arg="1",value=""},{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"}\]} "default: validity: -stack-list-variables" + mi_send_resuming_command "exec-continue" "default: invalid: continue" + mi_expect_stop "breakpoint-hit" .* {{name="inv",value=""}} .* .* {.* disp="keep"} "default: invalid: stop" + mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value=""}\]} "default: invalid: -stack-list-variables" } -mi_gdb_test "-gdb-set print entry-values default" {\^done} "default: set print entry-values" -mi_send_resuming_command "exec-continue" "default: entry_equal: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="5"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "default: entry_equal: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="5"},{name="val@entry",arg="1",value="5"}\]} "default: entry_equal: -stack-list-variables" -mi_send_resuming_command "exec-continue" "default: entry_different: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="6"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "default: entry_different: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="6"},{name="val@entry",arg="1",value="5"}\]} "default: entry_different: -stack-list-variables" -mi_send_resuming_command "exec-continue" "default: validity: continue" -mi_expect_stop "breakpoint-hit" .* {{name="lost",value=""},{name="lost@entry",value="5"},{name="born",value="10"}} .* .* {.* disp="keep"} "default: validity: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost",arg="1",value=""},{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"}\]} "default: validity: -stack-list-variables" -mi_send_resuming_command "exec-continue" "default: invalid: continue" -mi_expect_stop "breakpoint-hit" .* {{name="inv",value=""}} .* .* {.* disp="keep"} "default: invalid: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value=""}\]} "default: invalid: -stack-list-variables" diff --git a/gdb/testsuite/gdb.mi/mi2-var-child.exp b/gdb/testsuite/gdb.mi/mi2-var-child.exp index 499e13b..aa03ce5 100644 --- a/gdb/testsuite/gdb.mi/mi2-var-child.exp +++ b/gdb/testsuite/gdb.mi/mi2-var-child.exp @@ -839,7 +839,7 @@ mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" { {{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr.\*\*\*psnp->char_ptr.\*\*\*\*psnp->char_ptr} \ {\*\*\*\*psnp->char_ptr} 0 char} -} "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" +} "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr after counting children" # Test: c_variable-5.18 # Desc: number of children of *(*(*(psnp->char_ptr))) @@ -1018,7 +1018,7 @@ mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" { mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" { {{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr.\*\*\*\*char_ptr} \ {\*\*\*\*char_ptr} 0 char} -} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" +} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" # Test: c_variable-5.42 # Desc: number of children of **psnp->ptrs[0]->next->char_ptr @@ -1031,7 +1031,7 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" { {{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr.\*\*\*\*char_ptr} \ {\*\*\*\*char_ptr} 0 char} -} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" +} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr after counting children" # Test: c_variable-5.44 # Desc: number of children of ***psnp->ptrs[0]->next->char_ptr @@ -1042,13 +1042,13 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ # Test: c_variable-5.43B # Desc: children of ****psnp->ptrs[0]->next->char_ptr mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" {} \ - "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" + "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" # Test: c_variable-5.44B # Desc: number of children of ****psnp->ptrs[0]->next->char_ptr mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \ "\\^done,numchild=\"0\"" \ - "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" + "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" # Test: c_variable-5.45 # Desc: children of psnp->ptrs[0]->next->next -- cgit v1.1