* gdb.cp/classes.exp (do_tests): Always step to the line after the
authorDaniel Jacobowitz <drow@false.org>
Tue, 2 Oct 2007 14:57:46 +0000 (14:57 +0000)
committerDaniel Jacobowitz <drow@false.org>
Tue, 2 Oct 2007 14:57:46 +0000 (14:57 +0000)
call.
* gdb.mi/mi-simplerun.exp (test_controlled_execution): Allow finish
to return to the call.
* gdb.mi/mi2-simplerun.exp (test_controlled_execution): Likewise.
* gdb.mi/mi-return.exp (test_return_simple): Likewise.
* gdb.mi/mi2-return.exp (test_return_simple): Likewise.
* gdb.mi/mi-until.exp (test_until): Likewise.
* gdb.mi/mi2-until.exp (test_until): Likewise.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/classes.exp
gdb/testsuite/gdb.mi/mi-return.exp
gdb/testsuite/gdb.mi/mi-simplerun.exp
gdb/testsuite/gdb.mi/mi-until.exp
gdb/testsuite/gdb.mi/mi2-return.exp
gdb/testsuite/gdb.mi/mi2-simplerun.exp
gdb/testsuite/gdb.mi/mi2-until.exp

index 63d998dc1c225f593a3d5956c29ad26040cee9e7..4e319658157608d99b9e3753f9352e45371472e0 100644 (file)
@@ -1,3 +1,15 @@
+2007-10-02  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * gdb.cp/classes.exp (do_tests): Always step to the line after the
+       call.
+       * gdb.mi/mi-simplerun.exp (test_controlled_execution): Allow finish
+       to return to the call.
+       * gdb.mi/mi2-simplerun.exp (test_controlled_execution): Likewise.
+       * gdb.mi/mi-return.exp (test_return_simple): Likewise.
+       * gdb.mi/mi2-return.exp (test_return_simple): Likewise.
+       * gdb.mi/mi-until.exp (test_until): Likewise.
+       * gdb.mi/mi2-until.exp (test_until): Likewise.
+
 2007-10-01  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * gdb.mi/var-cmd.c (do_locals_tests): Define lcharacter as a
index 60c163240b743fb8a91c236c06975b12db2fdc8e..79a88d882a7b8b002272c86d8d211871074e297f 100644 (file)
@@ -581,7 +581,14 @@ proc do_tests {} {
 
     gdb_breakpoint enums2
     gdb_test "continue" ".*Breakpoint .* enums2.*" "continue to enums2(\\(\\)|)"
-    gdb_test "finish" "" ""
+    # Leave enums2.  Make sure we reach the next line, in case there
+    # are any more instructions to finish the function call.
+    gdb_test_multiple "finish" "" {
+       -re "enums2 \\(\\);.*$gdb_prompt $" {
+           gdb_test "next" "" ""
+       }
+       -re "$gdb_prompt $" { }
+    }
     test_enums
 
     gdb_test "finish" "" ""
index f1e9921e716a11beb192d291bfbb7fbd43db9da8..b18c058c1e7b7fcaebecb6aea65377a2a723a99a 100644 (file)
@@ -50,11 +50,12 @@ proc test_return_simple {} {
     global hex fullname_syntax srcfile
 
     set line_callee3_head         [gdb_get_line_number "callee3 ("]
+    set line_callee3_call         [expr $line_callee3_head + 2]
     set line_callee3_close_brace  [expr $line_callee3_head + 3]
 
     send_gdb "111-exec-return\n"
     gdb_expect {
-       -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
+       -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"($line_callee3_call|$line_callee3_close_brace)\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
        -re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
        timeout { fail "return from callee4 now (timeout)"
        }
index 86eaf5f5755354d96dfdcaf973b67f9262359092..d4f340913e78c60866c56f09df71d7f4c3da3ab8 100644 (file)
@@ -130,6 +130,7 @@ proc test_controlled_execution {} {
     set line_callee4_head         [gdb_get_line_number "callee4 ("]
     set line_callee4_body         [expr $line_callee4_head + 2]
     set line_callee3_head         [gdb_get_line_number "callee3 ("]
+    set line_callee3_call         [expr $line_callee3_head + 2]
     set line_callee3_close_brace  [expr $line_callee3_head + 3]
     set line_callee1_head         [gdb_get_line_number "callee1 ("]
     set line_callee1_body         [expr $line_callee1_head + 2]
@@ -162,7 +163,8 @@ proc test_controlled_execution {} {
     # FIXME: A string argument is not printed right; should be fixed and
     #        we should look for the right thing here.
     # NOTE: The ``.'' is part of ``gdb-result-var="$1"''
-    mi_finish_to "callee3" ".*" "basics.c" $line_callee3_close_brace ".1" "0" "exec-finish"
+    mi_finish_to "callee3" ".*" "basics.c" \
+       "($line_callee3_call|$line_callee3_close_brace)" ".1" "0" "exec-finish"
 }
 
 proc test_controlling_breakpoints {} {
index 2da2a3e284c2859291376f39579925a3eb5e57ba..59538ef359a8ea6eaf55cdb2deefea5356d3224f 100644 (file)
@@ -113,7 +113,7 @@ proc test_until {} {
 
     send_gdb "444-exec-until until.c:25\n"
     gdb_expect {
-       -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
+       -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"(23|24)\"\}\r\n$mi_gdb_prompt$" {
            pass "until after current function"
        }
        timeout {
index ef5c18ca000d6a1a49189bb21466e8358e7471b5..65a60a8040aa7559763caed24721914bfc39e2fb 100644 (file)
@@ -50,11 +50,12 @@ proc test_return_simple {} {
     global hex fullname_syntax srcfile
 
     set line_callee3_head         [gdb_get_line_number "callee3 ("]
+    set line_callee3_call         [expr $line_callee3_head + 2]
     set line_callee3_close_brace  [expr $line_callee3_head + 3]
 
     send_gdb "111-exec-return\n"
     gdb_expect {
-       -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
+       -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"($line_callee3_call|$line_callee3_close_brace)\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
        -re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
        timeout { fail "return from callee4 now (timeout)"
        }
index cc237de82aa7fdff8755f861c4e5fca63b36e3ff..0c0e951c4a40eb7b395763c46eb53cd5f3d54134 100644 (file)
@@ -131,6 +131,7 @@ proc test_controlled_execution {} {
     set line_callee4_head         [gdb_get_line_number "callee4 ("]
     set line_callee4_body         [expr $line_callee4_head + 2]
     set line_callee3_head         [gdb_get_line_number "callee3 ("]
+    set line_callee3_call         [expr $line_callee3_head + 2]
     set line_callee3_close_brace  [expr $line_callee3_head + 3]
     set line_callee1_head         [gdb_get_line_number "callee1 ("]
     set line_callee1_body         [expr $line_callee1_head + 2]
@@ -163,7 +164,8 @@ proc test_controlled_execution {} {
     # FIXME: A string argument is not printed right; should be fixed and
     #        we should look for the right thing here.
     # NOTE: The ``.'' is part of ``gdb-result-var="$1"''
-    mi_finish_to "callee3" ".*" "basics.c" $line_callee3_close_brace ".1" "0" "exec-finish"
+    mi_finish_to "callee3" ".*" "basics.c" \
+       "($line_callee3_call|$line_callee3_close_brace)" ".1" "0" "exec-finish"
 }
 
 proc test_controlling_breakpoints {} {
index d9f3882ee7c9cb4cbb1452cdb4abe3b173eb3d2c..c7f3a3b13303f816700eec73dfb82f38b5ba9efe 100644 (file)
@@ -113,7 +113,7 @@ proc test_until {} {
 
     send_gdb "444-exec-until until.c:25\n"
     gdb_expect {
-       -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
+       -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"(23|24)\"\}\r\n$mi_gdb_prompt$" {
            pass "until after current function"
        }
        timeout {
This page took 0.039473 seconds and 4 git commands to generate.