This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v7 3/8] Use xml-syscall to compare syscall numbers in arm_linux_sigreturn_return-addr.


On 12/11/2015 11:29 AM, Yao Qi wrote:
> Antoine Tremblay <antoine.tremblay@ericsson.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.

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]