int shr2(int x)
{
- return 2*x;
+ int y = 2*x;
+ return y;
}
int shr2_local(int x)
pass $gdb_test_name
}
}
-gdb_test "reverse-step" "return 2.x.*" "reverse-step within solib function one"
-gdb_test "reverse-step" " middle part two.*" "reverse-step back to main one"
+# Depending on wether the closing } has a line associated, we might have
+# different acceptable results here
+gdb_test_multiple "reverse-step" "reverse-step within solib function one" {
+ -re -wrap "return y;.*" {
+ pass $gdb_test_name
+ }
+ -re -wrap "int y =.*" {
+ pass $gdb_test_name
+ }
+}
+repeat_cmd_until "reverse-step" "" "main .. at" "reverse-step back to main one"
gdb_test_multiple "reverse-step" "reverse-step into solib function two" {
-re -wrap "begin part two.*" {
pass $gdb_test_name
}
}
-gdb_test "reverse-step" "return 2.x.*" "reverse-step within solib function two"
-gdb_test "reverse-step" " begin part two.*" "reverse-step back to main two"
+gdb_test_multiple "reverse-step" "reverse-step within solib function two" {
+ -re -wrap "return y;.*" {
+ pass $gdb_test_name
+ }
+ -re -wrap "int y =.*" {
+ pass $gdb_test_name
+ }
+}
+repeat_cmd_until "reverse-step" "" "main .. at" "reverse-step back to main two"
#
# Test reverse-next over debuggable solib function
shr1 ("message 2\n"); /* shr1 two */
shr1 ("message 3\n"); /* shr1 three */
- return 0; /* end part one */
-} /* end of main */
+ b[0] = 0; /* end part one */
+ return 0; /* end of main */
+}
pass $gdb_test_name
}
}
-gdb_test "reverse-step" "return 2.x.*" "reverse-step within solib function one"
-gdb_test "reverse-step" " middle part two.*" "reverse-step back to main one"
+# Depending on wether the closing } has a line associated, we might have
+# different acceptable results here
+gdb_test_multiple "reverse-step" "reverse-step within solib function one" {
+ -re -wrap "return y;.*" {
+ pass $gdb_test_name
+ }
+ -re -wrap "int y =.*" {
+ pass $gdb_test_name
+ }
+}
+repeat_cmd_until "reverse-step" "" "main .. at" "reverse-step back to main one"
gdb_test_multiple "reverse-step" "reverse-step into solib function two" {
-re -wrap "begin part two.*" {
pass $gdb_test_name
}
}
-gdb_test "reverse-step" "return 2.x.*" "reverse-step within solib function two"
-gdb_test "reverse-step" " begin part two.*" "reverse-step back to main two"
+gdb_test_multiple "reverse-step" "reverse-step within solib function two" {
+ -re -wrap "return y;.*" {
+ pass $gdb_test_name
+ }
+ -re -wrap "int y =.*" {
+ pass $gdb_test_name
+ }
+}
+repeat_cmd_until "reverse-step" "" "main .. at" "reverse-step back to main two"
#
# Test reverse-next over debuggable solib function
set count 0
gdb_test_multiple "$command" "$test_name" {
+ -re "$target.*$gdb_prompt $" {
+ pass "$test_name"
+ }
-re "$current.*$gdb_prompt $" {
incr count
if { $count < $max_steps } {
fail "$test_name"
}
}
- -re "$target.*$gdb_prompt $" {
- pass "$test_name"
- }
}
}