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.
#
require supports_reverse
+require {have_system_header sys/random.h}
standard_testfile
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