aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2006-12-08 14:29:02 +0000
committerVladimir Prus <vladimir@codesourcery.com>2006-12-08 14:29:02 +0000
commit038224f6186b569d849c7416159bde789749094a (patch)
treea386ad9be96c90693f331a6adca01e8aa0a316e7 /gdb/testsuite/lib
parenta1b5960f519380935c043f551b3c397f6c82df50 (diff)
downloadgdb-038224f6186b569d849c7416159bde789749094a.zip
gdb-038224f6186b569d849c7416159bde789749094a.tar.gz
gdb-038224f6186b569d849c7416159bde789749094a.tar.bz2
2006-12-08 Vladimir Prus <vladimir@codesourcery.com>
Test for base in references. * gdb.mi/mi-var-cp.cc: Add test code. * gdb.mi/mi-var-cp.exp: Test for bases in references. * gdb.mi/mi-watch.exp: Adjust to mi_runto changes. * gdb.mi/mi2-watch.exp: Likewise. * lib/mi-support.exp (mi_runto): Use temporary breakpoint. (mi_list_varobj_children): New function.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r--gdb/testsuite/lib/mi-support.exp52
1 files changed, 49 insertions, 3 deletions
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index af3feef..75f4039 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -868,8 +868,8 @@ proc mi_runto {func} {
global hex decimal fullname_syntax
set test "mi runto $func"
- mi_gdb_test "200-break-insert $func" \
- "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"\[0-9\]*\",times=\"0\"\}" \
+ mi_gdb_test "200-break-insert -t $func" \
+ "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"\[0-9\]*\",times=\"0\"\}" \
"breakpoint at $func"
if {![regexp {number="[0-9]+"} $expect_out(buffer) str]
@@ -879,7 +879,7 @@ proc mi_runto {func} {
mi_run_cmd
gdb_expect {
- -re ".*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"$bkptno\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
+ -re ".*000\\*stopped,thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
pass "$test"
return 0
}
@@ -1034,3 +1034,49 @@ proc mi_check_varobj_value { name value testname } {
"\\^done,value=\"$value\"" \
$testname
}
+
+# Check the results of the:
+#
+# -var-list-children VARNAME
+#
+# command. The CHILDREN parement should be a list of lists.
+# Each inner list can have either 3 or 4 elements, describing
+# fields that gdb is expected to report for child variable object,
+# in the following order
+#
+# - Name
+# - Expression
+# - Number of children
+# - Type
+#
+# If inner list has 3 elements, the gdb is expected to output no
+# type for a child.
+#
+proc mi_list_varobj_children { varname children testname } {
+
+ set numchildren [llength $children]
+ set children_exp {}
+ set whatever "\"\[^\"\]+\""
+
+ foreach item $children {
+
+ set name [lindex $item 0]
+ set exp [lindex $item 1]
+ set numchild [lindex $item 2]
+ if {[llength $item] == 4} {
+ set type [lindex $item 3]
+
+ lappend children_exp\
+ "child={name=\"$name\",exp=\"$exp\",numchild=\"$numchild\",type=\"$type\"}"
+ } else {
+ lappend children_exp\
+ "child={name=\"$name\",exp=\"$exp\",numchild=\"$numchild\"}"
+ }
+ }
+ set children_exp_j [join $children_exp ","]
+ set expected "\\^done,numchild=\"$numchildren\",children=\\\[$children_exp_j\\\]"
+
+ verbose -log "Expecting: $expected"
+
+ mi_gdb_test "-var-list-children $varname" $expected $testname
+}