diff options
author | Stephan Rohr <stephan.rohr@intel.com> | 2024-02-21 01:55:37 -0800 |
---|---|---|
committer | Stephan Rohr <stephan.rohr@intel.com> | 2024-09-13 04:05:13 -0700 |
commit | a1371f3288f2d84cea90a9157ed9a359226969e2 (patch) | |
tree | dc188ba0a8708a7e238153b13ffac6c4d912501a /gdb/testsuite/lib | |
parent | Automatic date update in version.in (diff) | |
download | binutils-gdb-a1371f3288f2d84cea90a9157ed9a359226969e2.tar.gz binutils-gdb-a1371f3288f2d84cea90a9157ed9a359226969e2.tar.bz2 binutils-gdb-a1371f3288f2d84cea90a9157ed9a359226969e2.zip |
testsuite, trace: add guards if In-Process Agent library is not found
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.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/trace-support.exp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/trace-support.exp b/gdb/testsuite/lib/trace-support.exp index c9c9697e180..770a930eda7 100644 --- a/gdb/testsuite/lib/trace-support.exp +++ b/gdb/testsuite/lib/trace-support.exp @@ -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 {} { |