This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH v7 3/8] Use xml-syscall to compare syscall numbers in arm_linux_sigreturn_return-addr.
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>, Antoine Tremblay <antoine dot tremblay at ericsson dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 11 Dec 2015 11:59:13 +0000
- Subject: Re: [PATCH v7 3/8] Use xml-syscall to compare syscall numbers in arm_linux_sigreturn_return-addr.
- Authentication-results: sourceware.org; auth=none
- References: <1449583641-18156-1-git-send-email-antoine dot tremblay at ericsson dot com> <1449583641-18156-4-git-send-email-antoine dot tremblay at ericsson dot com> <86io45ql3x dot fsf at gmail dot com>
On 12/11/2015 11:29 AM, Yao Qi wrote:
> Antoine Tremblay <email@example.com> writes:
>> It also adds a new function to xml-syscall.h/c to compare syscalls numbers
>> called is_syscall.
> Why don't we use existing get_syscall_by_name in
> arm_linux_sigreturn_return_addr rather than adding a new function is_syscall?
I wonder whether going through xml is really best. E.g., writing a syscall
call by name as a string is more typo prone than a macro constant. If you
typo the string, you get a runtime error. If you typo a macro you get a
compile time error. You could fix that by adding macros like:
#define ARM_SIGRETURN_NAME "sigreturn"
but then you might as well just do:
#define ARM_SIGRETURN 119
and avoid the xml look up. Syscall numbers are ABI, they can't ever change.