diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2006-12-08 14:29:02 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2006-12-08 14:29:02 +0000 |
commit | 038224f6186b569d849c7416159bde789749094a (patch) | |
tree | a386ad9be96c90693f331a6adca01e8aa0a316e7 /gdb/testsuite/gdb.mi | |
parent | a1b5960f519380935c043f551b3c397f6c82df50 (diff) | |
download | gdb-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/gdb.mi')
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-var-cp.cc | 18 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-var-cp.exp | 20 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-watch.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi2-watch.exp | 2 |
4 files changed, 39 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-var-cp.cc b/gdb/testsuite/gdb.mi/mi-var-cp.cc index 23390f9..6027051 100644 --- a/gdb/testsuite/gdb.mi/mi-var-cp.cc +++ b/gdb/testsuite/gdb.mi/mi-var-cp.cc @@ -23,8 +23,26 @@ void reference_update_tests () x = 567; } +struct S { int i; int j; }; +struct S2 : S {}; + +int base_in_reference_test (S2& s2) +{ + return s2.i; +} + +void base_in_reference_test_main () +{ + S2 s; + s.i = 67; + s.j = 89; + base_in_reference_test (s); +} + + int main () { reference_update_tests (); + base_in_reference_test_main (); return 0; } diff --git a/gdb/testsuite/gdb.mi/mi-var-cp.exp b/gdb/testsuite/gdb.mi/mi-var-cp.exp index ea9d3de..fea145f 100644 --- a/gdb/testsuite/gdb.mi/mi-var-cp.exp +++ b/gdb/testsuite/gdb.mi/mi-var-cp.exp @@ -41,7 +41,6 @@ mi_gdb_load ${binfile} # Test that children of classes are properly reported -# Run to main mi_runto reference_update_tests mi_create_varobj "RX" "rx" "create varobj for rx" @@ -69,5 +68,24 @@ mi_next_to "reference_update_tests" {} ".*${srcfile}" [expr $x_assignment+2] \ mi_varobj_update RX {} "update RX (3)" +mi_runto base_in_reference_test + +mi_create_varobj "S2" "s2" "create varobj for s2" + +mi_list_varobj_children "S2" {{"S2.S" "S" "1" "S"}} "list children of s2" + +mi_list_varobj_children "S2.S" {{"S2.S.public" "public" "2"}} \ + "list children of s2.s" + +mi_list_varobj_children "S2.S.public"\ +{ + {"S2.S.public.i" "i" "0" "int"} + {"S2.S.public.j" "j" "0" "int"} +} "list children of s2.s.public" + +mi_check_varobj_value "S2.S.public.i" "67" "check S2.S.public.i" +mi_check_varobj_value "S2.S.public.j" "89" "check S2.S.public.j" + + mi_gdb_exit return 0 diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-watch.exp index a6d243b..9d1cfa6 100644 --- a/gdb/testsuite/gdb.mi/mi-watch.exp +++ b/gdb/testsuite/gdb.mi/mi-watch.exp @@ -64,7 +64,7 @@ proc test_watchpoint_creation_and_listing {} { "break-watch operation" mi_gdb_test "222-break-list" \ - "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"$line_callee4_body\",times=\"1\"\},bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",what=\"C\",times=\"0\"\}\\\]\}" \ + "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",what=\"C\",times=\"0\"\}\\\]\}" \ "list of watchpoints" } diff --git a/gdb/testsuite/gdb.mi/mi2-watch.exp b/gdb/testsuite/gdb.mi/mi2-watch.exp index 5cb0b32..40088ae 100644 --- a/gdb/testsuite/gdb.mi/mi2-watch.exp +++ b/gdb/testsuite/gdb.mi/mi2-watch.exp @@ -63,7 +63,7 @@ proc test_watchpoint_creation_and_listing {} { "break-watch operation" mi_gdb_test "222-break-list" \ - "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"$line_callee4_body\",times=\"1\"\},bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",what=\"C\",times=\"0\"\}\\\]\}" \ + "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",what=\"C\",times=\"0\"\}\\\]\}" \ "list of watchpoints" } |