aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib/gdb.exp
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-08-29 11:02:08 +0200
committerTom de Vries <tdevries@suse.de>2023-08-29 11:02:08 +0200
commit130e33d8617e7663b397f35d34f3c2b2f48d9cfc (patch)
tree903f3bbb8c9fdf07cd171df98481e596fe42deec /gdb/testsuite/lib/gdb.exp
parentc58d51c612cdfd8914cefab80c350e1aa9ea3ed4 (diff)
downloadbinutils-130e33d8617e7663b397f35d34f3c2b2f48d9cfc.zip
binutils-130e33d8617e7663b397f35d34f3c2b2f48d9cfc.tar.gz
binutils-130e33d8617e7663b397f35d34f3c2b2f48d9cfc.tar.bz2
[gdb/testsuite] Check for sys/random.h in gdb.reverse/getrandom.exp
When running test-case gdb.reverse/getrandom.exp on a system with eglibc 2.19, we run into: ... gdb compile failed, gdb.reverse/getrandom.c:18:24: fatal error: \ sys/random.h: No such file or directory #include <sys/random.h> ^ compilation terminated. === gdb Summary === # of untested testcases 1 ... and: ... UNTESTED: gdb.reverse/getrandom.exp: failed to prepare ... Fix this by testing for the presence of the header, such that we have instead: ... UNSUPPORTED: gdb.reverse/getrandom.exp: require failed: \ have_system_header sys/random.h ... Tested on x86_64-linux and i686-linux.
Diffstat (limited to 'gdb/testsuite/lib/gdb.exp')
-rw-r--r--gdb/testsuite/lib/gdb.exp8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 8432e63..bcf536e 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -9952,5 +9952,13 @@ proc have_host_locale { locale } {
return [expr $idx != -1]
}
+# Return 1 if we can use '#include <$file>' in source file.
+
+gdb_caching_proc have_system_header { file } {
+ set src "#include <$file>"
+ set name [string map { "/" "_sep_" } $file]
+ return [gdb_can_simple_compile have_system_header_$name $src object]
+}
+
# Always load compatibility stuff.
load_lib future.exp