}
proc_with_prefix check_pc_after_cross_syscall { displaced syscall syscall_insn_next_addr } {
- global gdb_prompt
-
set syscall_insn_next_addr_found [get_hexadecimal_valueof "\$pc" "0"]
# After the 'stepi' we expect thread 1 to still be selected.
- # However, when displaced stepping over a clone bug gdb/19675
- # means this might not be the case.
- #
- # Which thread we end up in depends on a race between the original
- # thread-1, and the new thread (created by the clone), so we can't
- # guarantee which thread we will be in at this point.
- #
- # For the fork/vfork syscalls, which are correctly handled by
- # displaced stepping we will always be in thread-1 or the original
- # process at this point.
set curr_thread "unknown"
- gdb_test_multiple "info threads" "" {
- -re "Id\\s+Target Id\\s+Frame\\s*\r\n" {
- exp_continue
- }
- -re "^\\* (\\d+)\\s+\[^\r\n\]+\r\n" {
+ gdb_test_multiple "thread" "" {
+ -re -wrap "Current thread is (\\d+) .*" {
set curr_thread $expect_out(1,string)
- exp_continue
- }
- -re "^\\s+\\d+\\s+\[^\r\n\]+\r\n" {
- exp_continue
- }
- -re "$gdb_prompt " {
+ pass $gdb_test_name
}
}
- # If we are displaced stepping over a clone, and we ended up in
- # the wrong thread then the following check of the $pc value will
- # fail.
- if { $displaced == "on" && $syscall == "clone" && $curr_thread != 1 } {
- # GDB doesn't support stepping over clone syscall with
- # displaced stepping.
- setup_kfail "*-*-*" "gdb/19675"
- }
-
gdb_assert {$syscall_insn_next_addr != 0 \
&& $syscall_insn_next_addr == $syscall_insn_next_addr_found \
&& $curr_thread == 1} \
gdb_test "break marker" "Breakpoint.*at.* file .*${testfile}.c, line.*"
- # If we are displaced stepping over a clone syscall then
- # we expect the following check to fail. See also the
- # code in check_pc_after_cross_syscall.
- if { $displaced == "on" && $syscall == "clone" } {
- # GDB doesn't support stepping over clone syscall with
- # displaced stepping.
- setup_kfail "*-*-*" "gdb/19675"
- }
-
gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, marker \\(\\) at.*" \
"continue to marker ($syscall)"
}