# "stop" at the call sites before entering them.
runto_main
-set msg "step into func1"
-set saw_call_site 0
-gdb_test_multiple "list" $msg {
- -re "($first|$opt).*$gdb_prompt $" {
+set saw_call_site false
+set saw_main_frame false
+# Don't send the command using gdb_test_multiple, as it will be
+# injected into the regexp that start with '^' and use '-wrap', and we
+# send a different command using 'send_gdb' within the gdb_test_multiple.
+send_gdb "list\r"
+gdb_test_multiple "" "step into func1" {
+ -re "^(list|step)\r\n" {
+ exp_continue
+ }
+ -re -wrap "^\[^\r\n\]*($first|$opt)\[^\r\n\]*" {
send_gdb "step\r"
exp_continue
}
- -re "result = func1.*$gdb_prompt $" {
- set saw_call_site 1
+ -re -wrap "^\[^\r\n\]*y = 8\[^\r\n\]*" {
+ send_gdb "step\r"
+ exp_continue
+ }
+ -re "^main \\(\\) at \[^\r\n\]+\r\n" {
+ set saw_main_frame true
+ exp_continue
+ }
+ -re -wrap "^\[^\r\n\]*result = func1 \\(\\);" {
+ set saw_call_site true
send_gdb "step\r"
exp_continue
}
-re "func1 \\\(\\\) at .*\r\n$decimal.*bar \\\(\\\);\r\n$gdb_prompt $" {
- if { $saw_call_site } {
- pass $msg
- } else {
- fail $msg
- }
+ gdb_assert { $saw_call_site && !$saw_main_frame } $gdb_test_name
}
}