From 471ba8c90c7a40273fabd5821b1a10125463f3fa Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Tue, 2 Oct 2007 14:57:46 +0000 Subject: * 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. --- gdb/testsuite/gdb.mi/mi-return.exp | 3 ++- gdb/testsuite/gdb.mi/mi-simplerun.exp | 4 +++- gdb/testsuite/gdb.mi/mi-until.exp | 2 +- gdb/testsuite/gdb.mi/mi2-return.exp | 3 ++- gdb/testsuite/gdb.mi/mi2-simplerun.exp | 4 +++- gdb/testsuite/gdb.mi/mi2-until.exp | 2 +- 6 files changed, 12 insertions(+), 6 deletions(-) (limited to 'gdb/testsuite/gdb.mi') diff --git a/gdb/testsuite/gdb.mi/mi-return.exp b/gdb/testsuite/gdb.mi/mi-return.exp index f1e9921..b18c058 100644 --- a/gdb/testsuite/gdb.mi/mi-return.exp +++ b/gdb/testsuite/gdb.mi/mi-return.exp @@ -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)" } diff --git a/gdb/testsuite/gdb.mi/mi-simplerun.exp b/gdb/testsuite/gdb.mi/mi-simplerun.exp index 86eaf5f..d4f3409 100644 --- a/gdb/testsuite/gdb.mi/mi-simplerun.exp +++ b/gdb/testsuite/gdb.mi/mi-simplerun.exp @@ -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 {} { diff --git a/gdb/testsuite/gdb.mi/mi-until.exp b/gdb/testsuite/gdb.mi/mi-until.exp index 2da2a3e..59538ef 100644 --- a/gdb/testsuite/gdb.mi/mi-until.exp +++ b/gdb/testsuite/gdb.mi/mi-until.exp @@ -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 { diff --git a/gdb/testsuite/gdb.mi/mi2-return.exp b/gdb/testsuite/gdb.mi/mi2-return.exp index ef5c18c..65a60a8 100644 --- a/gdb/testsuite/gdb.mi/mi2-return.exp +++ b/gdb/testsuite/gdb.mi/mi2-return.exp @@ -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)" } diff --git a/gdb/testsuite/gdb.mi/mi2-simplerun.exp b/gdb/testsuite/gdb.mi/mi2-simplerun.exp index cc237de..0c0e951 100644 --- a/gdb/testsuite/gdb.mi/mi2-simplerun.exp +++ b/gdb/testsuite/gdb.mi/mi2-simplerun.exp @@ -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 {} { diff --git a/gdb/testsuite/gdb.mi/mi2-until.exp b/gdb/testsuite/gdb.mi/mi2-until.exp index d9f3882..c7f3a3b 100644 --- a/gdb/testsuite/gdb.mi/mi2-until.exp +++ b/gdb/testsuite/gdb.mi/mi2-until.exp @@ -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 { -- cgit v1.1