This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Set unknown_syscall differently on arm linux
- From: Yao Qi <qiyao at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 29 Jun 2016 13:56:38 -0000
- Subject: [binutils-gdb] Set unknown_syscall differently on arm linux
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=28244707d9e4f35cab1f9069cee1d44b38be095f
commit 28244707d9e4f35cab1f9069cee1d44b38be095f
Author: Yao Qi <yao.qi@linaro.org>
Date: Wed Jun 29 14:51:41 2016 +0100
Set unknown_syscall differently on arm linux
Currently, we use 123456789 as unknown or illegal syscall number, and
expect program return ENOSYS. Although 123456789 is an illegal syscall
number on arm linux, kernel sends SIGILL rather than returns -ENOSYS.
However, arm linux kernel returns -ENOSYS if syscall number is within
0xf0001..0xf07ff, so we can use 0xf07ff for unknown_syscall in test.
gdb/testsuite:
2016-06-29 Yao Qi <yao.qi@linaro.org>
* gdb.base/catch-syscall.c [__arm__]: Set unknown_syscall to
0x0f07ff.
Diff:
---
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/gdb.base/catch-syscall.c | 8 ++++++++
2 files changed, 13 insertions(+)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 8ce6ee8..9f8f40c 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-06-29 Yao Qi <yao.qi@linaro.org>
+
+ * gdb.base/catch-syscall.c [__arm__]: Set unknown_syscall to
+ 0x0f07ff.
+
2016-06-28 Yao Qi <yao.qi@linaro.org>
* gdb.base/catch-syscall.exp: Remove check on isnative and target
diff --git a/gdb/testsuite/gdb.base/catch-syscall.c b/gdb/testsuite/gdb.base/catch-syscall.c
index 98222fa..0ab9631 100644
--- a/gdb/testsuite/gdb.base/catch-syscall.c
+++ b/gdb/testsuite/gdb.base/catch-syscall.c
@@ -28,7 +28,15 @@ int pipe_syscall = SYS_pipe;
int pipe2_syscall = SYS_pipe2;
#endif
int write_syscall = SYS_write;
+#if defined(__arm__)
+/* Although 123456789 is an illegal syscall umber on arm linux, kernel
+ sends SIGILL rather than returns -ENOSYS. However, arm linux kernel
+ returns -ENOSYS if syscall number is within 0xf0001..0xf07ff, so we
+ can use 0xf07ff for unknown_syscall in test. */
+int unknown_syscall = 0x0f07ff;
+#else
int unknown_syscall = 123456789;
+#endif
int exit_group_syscall = SYS_exit_group;
/* Set by the test when it wants execve. */