set jit_solib_srcfile ${srcdir}/${subdir}/${jit_solib_basename}.c
# Detach, restart GDB, and re-attach to the program.
+# Return 0 if attach failed, otherwise return 1.
proc clean_reattach {} {
global decimal gdb_prompt
global main_binfile main_srcfile
clean_restart ${main_binfile}
- set test "attach"
- gdb_test_multiple "attach $testpid" "$test" {
- -re "Attaching to program.*.*main.*at .*$main_srcfile:.*$gdb_prompt $" {
- pass "$test"
- }
+ if { ![gdb_attach $testpid \
+ -pattern "main.*at .*$::main_srcfile:.*"] } {
+ return 0
}
gdb_test_no_output "set var wait_for_gdb = 0"
+ return 1
}
# Continue to LOCATION in the program. If REATTACH, detach and
# re-attach to the program from scratch.
+# Return 0 if clean_reattach failed, otherwise return 1.
proc continue_to_test_location {location reattach} {
global main_srcfile
gdb_continue_to_breakpoint $location
if {$reattach} {
with_test_prefix "$location" {
- clean_reattach
+ if { ![clean_reattach] } {
+ return 0
+ }
}
}
+ return 1
}
proc one_jit_test {jit_solibs_target match_str reattach} {
gdb_continue_to_breakpoint "break here 0"
- continue_to_test_location "break here 1" $reattach
+ if { ![continue_to_test_location "break here 1" $reattach] } {
+ return
+ }
gdb_test "info function ^jit_function" "$match_str"
gdb_test "maintenance info break"
}
- continue_to_test_location "break here 2" $reattach
+ if { ![continue_to_test_location "break here 2" $reattach] } {
+ return
+ }
# All jit librares must have been unregistered
gdb_test "info function jit_function" \