This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Set unknown_syscall differently on arm linux
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 29 Jun 2016 14:56:33 +0100
- Subject: Re: [PATCH] Set unknown_syscall differently on arm linux
- Authentication-results: sourceware.org; auth=none
- References: <1467105996-18063-1-git-send-email-yao dot qi at linaro dot org> <9e39007b-b89a-4f54-02f3-fc76a77f91cd at redhat dot com>
On Wed, Jun 29, 2016 at 10:53 AM, Pedro Alves <palves@redhat.com> wrote:
> On 06/28/2016 10:26 AM, Yao Qi wrote:
>> 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.
>>
>
> I think it'd be good if this was converted to a comment in the source.
>
OK, I move them into the comments as below,
+#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
patch is pushed in.
--
Yao (éå)