mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-29 08:24:05 +08:00
[gdb/testsuite] Require syscall time in gdb.reverse/time-reverse.exp
On aarch64-linux, I run into: ... Running gdb.reverse/time-reverse.exp ... gdb compile failed, gdb.reverse/time-reverse.c: In function 'main': gdb.reverse/time-reverse.c:39:12: error: 'SYS_time' undeclared \ (first use in this function); did you mean 'SYS_times'? syscall (SYS_time, &time_global); ^~~~~~~~ SYS_times gdb.reverse/time-reverse.c:39:12: note: each undeclared identifier is \ reported only once for each function it appears in UNTESTED: gdb.reverse/time-reverse.exp: failed to prepare ... Fix this by adding a new proc have_syscall, and requiring syscall time, such that we have instead: ... UNSUPPORTED: gdb.reverse/time-reverse.exp: require failed: \ expr [have_syscall time] ... Tested on x86_64-linux and aarch64-linux.
This commit is contained in:
@ -23,6 +23,8 @@ require supports_reverse
|
|||||||
|
|
||||||
standard_testfile
|
standard_testfile
|
||||||
|
|
||||||
|
require {expr [have_syscall time]}
|
||||||
|
|
||||||
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
|
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
@ -9397,5 +9397,16 @@ gdb_caching_proc linux_kernel_version {
|
|||||||
return [list $v1 $v2 $v3]
|
return [list $v1 $v2 $v3]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Return 1 if syscall NAME is supported.
|
||||||
|
|
||||||
|
proc have_syscall { name } {
|
||||||
|
set src \
|
||||||
|
[list \
|
||||||
|
"#include <sys/syscall.h>" \
|
||||||
|
"int var = SYS_$name;"]
|
||||||
|
set src [join $src "\n"]
|
||||||
|
return [gdb_can_simple_compile have_syscall_$name $src object]
|
||||||
|
}
|
||||||
|
|
||||||
# Always load compatibility stuff.
|
# Always load compatibility stuff.
|
||||||
load_lib future.exp
|
load_lib future.exp
|
||||||
|
Reference in New Issue
Block a user