binutils-gdb/gdb/syscalls
Yao Qi f68f11b76d Support catch syscall on aarch64 linux
Hi,
This patch is to support catch syscall on aarch64 linux.  We
implement gdbarch method get_syscall_number for aarch64-linux,
and add aarch64-linux.xml file, which looks straightforward, however
the changes to test case doesn't.

First of all, we enable catch-syscall.exp on aarch64-linux target,
but skip the multi_arch testing on current stage.  I plan to touch
multi arch debugging on aarch64-linux later.

Then, when I run catch-syscall.exp on aarch64-linux, gcc errors that
SYS_pipe isn't defined.  We find that aarch64 kernel only has pipe2
syscall and libc already convert pipe to pipe2.  As a result, I change
catch-syscall.c to use SYS_pipe if it is defined, otherwise use
SYS_pipe2 instead.  The vector all_syscalls in catch-syscall.exp can't
be pre-determined, so I add a new proc setup_all_syscalls to fill it,
according to the availability of SYS_pipe.

Regression tested on {x86_64, aarch64}-linux x {native, gdbserver}.

gdb:

2015-03-18  Yao Qi  <yao.qi@linaro.org>

	PR tdep/18107
	* aarch64-linux-tdep.c: Include xml-syscall.h
	(aarch64_linux_get_syscall_number): New function.
	(aarch64_linux_init_abi): Call
	set_gdbarch_get_syscall_number.
	* syscalls/aarch64-linux.xml: New file.

gdb/testsuite:

2015-03-18  Yao Qi  <yao.qi@linaro.org>

	PR tdep/18107
	* gdb.base/catch-syscall.c [!SYS_pipe] (pipe2_syscall): New
	variable.
	* gdb.base/catch-syscall.exp: Don't skip it on
	aarch64*-*-linux* target.  Remove elements in all_syscalls.
	(test_catch_syscall_multi_arch): Skip it on aarch64*-linux*
	target.
	(setup_all_syscalls): New proc.
2015-03-18 10:47:45 +00:00
..
aarch64-linux.xml Support catch syscall on aarch64 linux 2015-03-18 10:47:45 +00:00
amd64-linux.xml Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
arm-linux.py Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
arm-linux.xml Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
bfin-linux.xml Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
gdb-syscalls.dtd Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
i386-linux.xml Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mips-n32-linux.xml Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mips-n64-linux.xml Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mips-o32-linux.xml Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
ppc-linux.xml Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
ppc64-linux.xml Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
s390-linux.xml Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
s390x-linux.xml Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
sparc-linux.xml Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
sparc64-linux.xml Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00