set libname $testfile-jit
set srcfile_lib $srcdir/$subdir/$libname.c
set binfile_lib [standard_output_file $libname.so]
+set binfile_lib2 [standard_output_file ${libname}2.so]
# Build a standalone JIT binary.
proc build_shared_jit {{options ""}} {
global testfile
- global srcfile_lib binfile_lib
+ global srcfile_lib binfile_lib binfile_lib2
lappend options "debug additional_flags=-fPIC"
if { [gdb_compile_shlib $srcfile_lib $binfile_lib $options] != "" } {
return -1
}
+ if { [gdb_compile_shlib $srcfile_lib $binfile_lib2 $options] != "" } {
+ return -1
+ }
return 0
}
return -1
}
+# Build the program that loads *two* JIT libraries.
+set binfile_dl2 $binfile-dl2
+set options [list debug shlib=${binfile_lib} shlib=${binfile_lib2}]
+if {[gdb_compile ${srcdir}/${subdir}/${srcfile_dl} $binfile_dl2 executable \
+ $options] == -1 } {
+ untested "failed to compile two-jitter binary"
+ return -1
+}
+
# STANDALONE is true when the JIT reader is included directly in the
# main program. False when the JIT reader is in a separate shared
# library. If CHANGE_ADDR is true, force changing the JIT descriptor
}
}
}
+
+# Now start the program that loads two JITer libraries and expect to
+# see JIT breakpoints defined for both.
+
+with_test_prefix "two JITers" {
+ clean_restart $binfile_dl2
+
+ if {![runto_main]} {
+ untested "could not run to main"
+ return -1
+ }
+
+ set num_bps 0
+ set ws "\[ \t\]+"
+ gdb_test_multiple "maint info breakpoints" "have two jit breakpoints" {
+ -re "jit events${ws}keep y${ws}$hex <__jit_debug_register_code> inf 1\r\n" {
+ incr num_bps
+ exp_continue
+ }
+ -re "$gdb_prompt $" {
+ if {$num_bps == 2} {
+ pass $gdb_test_name
+ } else {
+ fail $gdb_test_name
+ }
+ }
+ }
+}