[v3,1/1] testsuite, trace: add guards if In-Process Agent library is not found
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Test passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-arm |
fail
|
Test failed
|
Commit Message
Several tests in gdb.trace trigger TCL errors if the In-Process Agent
library is not found, e.g.:
Running gdb/testsuite/gdb.trace/change-loc.exp ...
ERROR: tcl error sourcing gdb/testsuite/gdb.trace/change-loc.exp.
ERROR: error copying "gdb/gdb/testsuite/../../gdbserver/libinproctrace.so":
no such file or directory
while executing
"file copy -force $fromfile $tofile"
(procedure "gdb_remote_download" line 29)
invoked from within
"gdb_remote_download target $target_file"
(procedure "gdb_download_shlib" line 6)
invoked from within
"gdb_download_shlib $file"
(procedure "gdb_load_shlib" line 2)
invoked from within
"gdb_load_shlib $libipa"
(file "gdb/testsuite/gdb.trace/change-loc.exp" line 354)
invoked from within
"source gdb/testsuite/gdb.trace/change-loc.exp"
("uplevel" body line 1)
invoked from within
"uplevel #0 source gdb/testsuite/gdb.trace/change-loc.exp"
invoked from within
"catch "uplevel #0 source $test_file_name""
Protect against this error by checking if the library is available.
---
gdb/testsuite/gdb.arch/ftrace-insn-reloc.exp | 1 +
gdb/testsuite/gdb.trace/basic-libipa.exp | 6 +-----
gdb/testsuite/gdb.trace/change-loc.exp | 1 +
gdb/testsuite/gdb.trace/ftrace-lock.exp | 1 +
gdb/testsuite/gdb.trace/ftrace.exp | 1 +
gdb/testsuite/gdb.trace/pending.exp | 1 +
gdb/testsuite/gdb.trace/range-stepping.exp | 1 +
gdb/testsuite/gdb.trace/strace.exp | 1 +
gdb/testsuite/gdb.trace/trace-break.exp | 1 +
gdb/testsuite/gdb.trace/trace-condition.exp | 1 +
gdb/testsuite/gdb.trace/trace-enable-disable.exp | 1 +
gdb/testsuite/gdb.trace/trace-mt.exp | 1 +
gdb/testsuite/gdb.trace/tspeed.exp | 1 +
gdb/testsuite/lib/trace-support.exp | 14 ++++++++++++++
14 files changed, 27 insertions(+), 5 deletions(-)
@@ -33,6 +33,7 @@ if ![gdb_target_supports_trace] {
return -1
}
+require allow_in_proc_agent
set libipa [get_in_proc_agent]
# Can't use prepare_for_testing, because that splits compiling into
@@ -25,13 +25,9 @@ require allow_shlib_tests
standard_testfile
+require allow_in_proc_agent
set libipa [get_in_proc_agent]
-if { ![file exists $libipa] } {
- unsupported "missing libinproctrace.so"
- return -1
-}
-
gdb_download_shlib $libipa
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
@@ -346,6 +346,7 @@ tracepoint_change_loc_2 "trace"
tracepoint_install_in_trace_disabled "trace"
# Re-compile test case with IPA.
+require allow_in_proc_agent
set libipa [get_in_proc_agent]
gdb_load_shlib $libipa
@@ -48,6 +48,7 @@ with_test_prefix "runtime trace support check" {
}
# Compile the test case with the in-process agent library.
+require allow_in_proc_agent
set libipa [get_in_proc_agent]
set remote_libipa [gdb_load_shlib $libipa]
@@ -39,6 +39,7 @@ if ![gdb_target_supports_trace] {
return -1
}
+require allow_in_proc_agent
set libipa [get_in_proc_agent]
set remote_libipa [gdb_load_shlib $libipa]
@@ -494,6 +494,7 @@ pending_tracepoint_with_action_resolved "trace"
pending_tracepoint_installed_during_trace "trace"
# Re-compile test case with IPA.
+require allow_in_proc_agent
set libipa [get_in_proc_agent]
gdb_load_shlib $libipa
@@ -67,6 +67,7 @@ range_stepping_with_tracepoint "trace"
require allow_shlib_tests
+require allow_in_proc_agent
set libipa [get_in_proc_agent]
set remote_libipa [gdb_load_shlib $libipa]
@@ -19,6 +19,7 @@ require allow_shlib_tests
standard_testfile
set executable $testfile
+require allow_in_proc_agent
set libipa [get_in_proc_agent]
set lib_opts debug
@@ -344,6 +344,7 @@ break_trace_same_addr_6 "trace" "disable" "trace" "enable"
require allow_shlib_tests
+require allow_in_proc_agent
set libipa [get_in_proc_agent]
set remote_libipa [gdb_load_shlib $libipa]
@@ -39,6 +39,7 @@ if ![gdb_target_supports_trace] {
return -1
}
+require allow_in_proc_agent
set libipa [get_in_proc_agent]
set remote_libipa [gdb_load_shlib $libipa]
@@ -42,6 +42,7 @@ if ![gdb_target_supports_trace] {
}
# Compile the test case with the in-process agent library.
+require allow_in_proc_agent
set libipa [get_in_proc_agent]
gdb_load_shlib $libipa
@@ -103,6 +103,7 @@ step_over_tracepoint $binfile "trace"
require allow_shlib_tests
+require allow_in_proc_agent
set libipa [get_in_proc_agent]
set remote_libipa [gdb_load_shlib $libipa]
@@ -43,6 +43,7 @@ if ![gdb_target_supports_trace] {
}
# Compile the test case with the in-process agent library.
+require allow_in_proc_agent
set ipalib [get_in_proc_agent]
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
@@ -366,6 +366,20 @@ proc gdb_find_recursion_test_baseline { filename } {
return $baseline
}
+# Return 1 if the IPA library is available and 0 otherwise.
+
+proc allow_in_proc_agent {} {
+ global objdir
+
+ if [target_info exists in_proc_agent] {
+ return 1
+ } elseif [file exists "$objdir/../../gdbserver/libinproctrace.so"] {
+ return 1
+ } else {
+ return 0
+ }
+}
+
# Return the location of the IPA library.
proc get_in_proc_agent {} {