aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Arnez <arnez@vnet.linux.ibm.com>2014-01-22 18:54:43 +0100
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>2014-01-22 18:54:43 +0100
commit237b092b9f52d90716e537d624e9a8c60a4cd4b5 (patch)
treebfe2e78b5ca16b2d49af5b82ac99e789e4890b60
parentd674a7090f3ae01552e9df5044acc2df1127a7c0 (diff)
downloadgdb-237b092b9f52d90716e537d624e9a8c60a4cd4b5.zip
gdb-237b092b9f52d90716e537d624e9a8c60a4cd4b5.tar.gz
gdb-237b092b9f52d90716e537d624e9a8c60a4cd4b5.tar.bz2
gdb/ChangeLog:
* syscalls/s390x-linux.xml: New file. * syscalls/s390-linux.xml: New file. * s390-linux-tdep.c (XML_SYSCALL_FILENAME_S390): New macro. (XML_SYSCALL_FILENAME_S390X): Likewise. (op_svc): New enum value for SVC opcode. (s390_sigtramp_frame_sniffer): Replace literal by 'op_svc'. (s390_linux_get_syscall_number): New function. (s390_gdbarch_init): Register '*get_syscall_number' and the syscall xml file name. * data-directory/Makefile.in (SYSCALLS_FILES): Add "s390-linux.xml" and "s390x-linux.xml". * NEWS: Announce new feature. gdb/testsuite/ChangeLog: * gdb.base/catch-syscall.exp: Activate test on s390*-linux.
-rw-r--r--gdb/ChangeLog15
-rw-r--r--gdb/NEWS2
-rw-r--r--gdb/data-directory/Makefile.in3
-rw-r--r--gdb/s390-linux-tdep.c44
-rw-r--r--gdb/syscalls/s390-linux.xml331
-rw-r--r--gdb/syscalls/s390x-linux.xml298
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.base/catch-syscall.exp3
8 files changed, 697 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 10aaefe..ef14841 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,18 @@
+2014-01-22 Andreas Arnez <arnez@vnet.linux.ibm.com>
+
+ * syscalls/s390x-linux.xml: New file.
+ * syscalls/s390-linux.xml: New file.
+ * s390-linux-tdep.c (XML_SYSCALL_FILENAME_S390): New macro.
+ (XML_SYSCALL_FILENAME_S390X): Likewise.
+ (op_svc): New enum value for SVC opcode.
+ (s390_sigtramp_frame_sniffer): Replace literal by 'op_svc'.
+ (s390_linux_get_syscall_number): New function.
+ (s390_gdbarch_init): Register '*get_syscall_number' and the
+ syscall xml file name.
+ * data-directory/Makefile.in (SYSCALLS_FILES): Add
+ "s390-linux.xml" and "s390x-linux.xml".
+ * NEWS: Announce new feature.
+
2014-01-22 Baruch Siach <baruch@tkos.co.il>
* xtensa-tdep.h (xtensa_elf_greg_t): Change type to uint32_t.
diff --git a/gdb/NEWS b/gdb/NEWS
index 44189d5..5a44a67 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -26,6 +26,8 @@
The target does not record data and therefore does not allow reading
memory or registers.
+* The "catch syscall" command now works on s390*-linux* targets.
+
* New remote packets
qXfer:btrace:read's annex
diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
index e535316..29a48e4 100644
--- a/gdb/data-directory/Makefile.in
+++ b/gdb/data-directory/Makefile.in
@@ -49,7 +49,8 @@ SYSCALLS_FILES = \
ppc-linux.xml ppc64-linux.xml \
i386-linux.xml amd64-linux.xml \
sparc-linux.xml sparc64-linux.xml \
- mips-o32-linux.xml mips-n32-linux.xml mips-n64-linux.xml
+ mips-o32-linux.xml mips-n32-linux.xml mips-n64-linux.xml \
+ s390-linux.xml s390x-linux.xml
PYTHON_DIR = python
PYTHON_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(PYTHON_DIR)
diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
index 8b71e78..3084b32 100644
--- a/gdb/s390-linux-tdep.c
+++ b/gdb/s390-linux-tdep.c
@@ -45,6 +45,7 @@
#include "linux-tdep.h"
#include "s390-linux-tdep.h"
#include "auxv.h"
+#include "xml-syscall.h"
#include "stap-probe.h"
#include "ax.h"
@@ -66,6 +67,9 @@
#include "features/s390x-linux64v2.c"
#include "features/s390x-te-linux64.c"
+#define XML_SYSCALL_FILENAME_S390 "syscalls/s390-linux.xml"
+#define XML_SYSCALL_FILENAME_S390X "syscalls/s390x-linux.xml"
+
/* The tdep structure. */
struct gdbarch_tdep
@@ -905,6 +909,7 @@ enum
op1_brxhg= 0xec, op2_brxhg= 0x44,
op_brxle = 0x85,
op1_brxlg= 0xec, op2_brxlg= 0x45,
+ op_svc = 0x0a,
};
@@ -2328,7 +2333,7 @@ s390_sigtramp_frame_sniffer (const struct frame_unwind *self,
if (target_read_memory (pc, sigreturn, 2))
return 0;
- if (sigreturn[0] != 0x0a /* svc */)
+ if (sigreturn[0] != op_svc)
return 0;
if (sigreturn[1] != 119 /* sigreturn */
@@ -2347,6 +2352,36 @@ static const struct frame_unwind s390_sigtramp_frame_unwind = {
s390_sigtramp_frame_sniffer
};
+/* Retrieve the syscall number at a ptrace syscall-stop. Return -1
+ upon error. */
+
+static LONGEST
+s390_linux_get_syscall_number (struct gdbarch *gdbarch,
+ ptid_t ptid)
+{
+ struct regcache *regs = get_thread_regcache (ptid);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ ULONGEST pc;
+ ULONGEST svc_number = -1;
+ unsigned opcode;
+
+ /* Assume that the PC points after the 2-byte SVC instruction. We
+ don't currently support SVC via EXECUTE. */
+ regcache_cooked_read_unsigned (regs, tdep->pc_regnum, &pc);
+ pc -= 2;
+ opcode = read_memory_unsigned_integer ((CORE_ADDR) pc, 1, byte_order);
+ if (opcode != op_svc)
+ return -1;
+
+ svc_number = read_memory_unsigned_integer ((CORE_ADDR) pc + 1, 1,
+ byte_order);
+ if (svc_number == 0)
+ regcache_cooked_read_unsigned (regs, S390_R1_REGNUM, &svc_number);
+
+ return svc_number;
+}
+
/* Frame base handling. */
@@ -3265,6 +3300,9 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_align (gdbarch, s390_frame_align);
set_gdbarch_return_value (gdbarch, s390_return_value);
+ /* Syscall handling. */
+ set_gdbarch_get_syscall_number (gdbarch, s390_linux_get_syscall_number);
+
/* Frame handling. */
dwarf2_frame_set_init_reg (gdbarch, s390_dwarf2_frame_init_reg);
dwarf2_frame_set_adjust_regnum (gdbarch, s390_adjust_frame_regnum);
@@ -3303,6 +3341,8 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_ilp32_fetch_link_map_offsets);
+ set_xml_syscall_file_name (XML_SYSCALL_FILENAME_S390);
+
if (have_upper)
{
if (have_linux_v2)
@@ -3347,6 +3387,8 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_address_class_name_to_type_flags (gdbarch,
s390_address_class_name_to_type_flags);
+ set_xml_syscall_file_name (XML_SYSCALL_FILENAME_S390);
+
if (have_linux_v2)
set_gdbarch_core_regset_sections (gdbarch,
s390x_linux64v2_regset_sections);
diff --git a/gdb/syscalls/s390-linux.xml b/gdb/syscalls/s390-linux.xml
new file mode 100644
index 0000000..5a755ad
--- /dev/null
+++ b/gdb/syscalls/s390-linux.xml
@@ -0,0 +1,331 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2009-2014 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. -->
+
+<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
+
+<!-- This file was generated using the following file:
+
+ /usr/include/asm/unistd.h
+
+ The file mentioned above belongs to the Linux Kernel. -->
+
+<syscalls_info>
+ <syscall name="exit" number="1"/>
+ <syscall name="fork" number="2"/>
+ <syscall name="read" number="3"/>
+ <syscall name="write" number="4"/>
+ <syscall name="open" number="5"/>
+ <syscall name="close" number="6"/>
+ <syscall name="restart_syscall" number="7"/>
+ <syscall name="creat" number="8"/>
+ <syscall name="link" number="9"/>
+ <syscall name="unlink" number="10"/>
+ <syscall name="execve" number="11"/>
+ <syscall name="chdir" number="12"/>
+ <syscall name="time" number="13"/>
+ <syscall name="mknod" number="14"/>
+ <syscall name="chmod" number="15"/>
+ <syscall name="lchown" number="16"/>
+ <syscall name="lseek" number="19"/>
+ <syscall name="getpid" number="20"/>
+ <syscall name="mount" number="21"/>
+ <syscall name="umount" number="22"/>
+ <syscall name="setuid" number="23"/>
+ <syscall name="getuid" number="24"/>
+ <syscall name="stime" number="25"/>
+ <syscall name="ptrace" number="26"/>
+ <syscall name="alarm" number="27"/>
+ <syscall name="pause" number="29"/>
+ <syscall name="utime" number="30"/>
+ <syscall name="access" number="33"/>
+ <syscall name="nice" number="34"/>
+ <syscall name="sync" number="36"/>
+ <syscall name="kill" number="37"/>
+ <syscall name="rename" number="38"/>
+ <syscall name="mkdir" number="39"/>
+ <syscall name="rmdir" number="40"/>
+ <syscall name="dup" number="41"/>
+ <syscall name="pipe" number="42"/>
+ <syscall name="times" number="43"/>
+ <syscall name="brk" number="45"/>
+ <syscall name="setgid" number="46"/>
+ <syscall name="getgid" number="47"/>
+ <syscall name="signal" number="48"/>
+ <syscall name="geteuid" number="49"/>
+ <syscall name="getegid" number="50"/>
+ <syscall name="acct" number="51"/>
+ <syscall name="umount2" number="52"/>
+ <syscall name="ioctl" number="54"/>
+ <syscall name="fcntl" number="55"/>
+ <syscall name="setpgid" number="57"/>
+ <syscall name="umask" number="60"/>
+ <syscall name="chroot" number="61"/>
+ <syscall name="ustat" number="62"/>
+ <syscall name="dup2" number="63"/>
+ <syscall name="getppid" number="64"/>
+ <syscall name="getpgrp" number="65"/>
+ <syscall name="setsid" number="66"/>
+ <syscall name="sigaction" number="67"/>
+ <syscall name="setreuid" number="70"/>
+ <syscall name="setregid" number="71"/>
+ <syscall name="sigsuspend" number="72"/>
+ <syscall name="sigpending" number="73"/>
+ <syscall name="sethostname" number="74"/>
+ <syscall name="setrlimit" number="75"/>
+ <syscall name="getrlimit" number="76"/>
+ <syscall name="getrusage" number="77"/>
+ <syscall name="gettimeofday" number="78"/>
+ <syscall name="settimeofday" number="79"/>
+ <syscall name="getgroups" number="80"/>
+ <syscall name="setgroups" number="81"/>
+ <syscall name="symlink" number="83"/>
+ <syscall name="readlink" number="85"/>
+ <syscall name="uselib" number="86"/>
+ <syscall name="swapon" number="87"/>
+ <syscall name="reboot" number="88"/>
+ <syscall name="readdir" number="89"/>
+ <syscall name="mmap" number="90"/>
+ <syscall name="munmap" number="91"/>
+ <syscall name="truncate" number="92"/>
+ <syscall name="ftruncate" number="93"/>
+ <syscall name="fchmod" number="94"/>
+ <syscall name="fchown" number="95"/>
+ <syscall name="getpriority" number="96"/>
+ <syscall name="setpriority" number="97"/>
+ <syscall name="statfs" number="99"/>
+ <syscall name="fstatfs" number="100"/>
+ <syscall name="ioperm" number="101"/>
+ <syscall name="socketcall" number="102"/>
+ <syscall name="syslog" number="103"/>
+ <syscall name="setitimer" number="104"/>
+ <syscall name="getitimer" number="105"/>
+ <syscall name="stat" number="106"/>
+ <syscall name="lstat" number="107"/>
+ <syscall name="fstat" number="108"/>
+ <syscall name="lookup_dcookie" number="110"/>
+ <syscall name="vhangup" number="111"/>
+ <syscall name="idle" number="112"/>
+ <syscall name="wait4" number="114"/>
+ <syscall name="swapoff" number="115"/>
+ <syscall name="sysinfo" number="116"/>
+ <syscall name="ipc" number="117"/>
+ <syscall name="fsync" number="118"/>
+ <syscall name="sigreturn" number="119"/>
+ <syscall name="clone" number="120"/>
+ <syscall name="setdomainname" number="121"/>
+ <syscall name="uname" number="122"/>
+ <syscall name="adjtimex" number="124"/>
+ <syscall name="mprotect" number="125"/>
+ <syscall name="sigprocmask" number="126"/>
+ <syscall name="create_module" number="127"/>
+ <syscall name="init_module" number="128"/>
+ <syscall name="delete_module" number="129"/>
+ <syscall name="get_kernel_syms" number="130"/>
+ <syscall name="quotactl" number="131"/>
+ <syscall name="getpgid" number="132"/>
+ <syscall name="fchdir" number="133"/>
+ <syscall name="bdflush" number="134"/>
+ <syscall name="sysfs" number="135"/>
+ <syscall name="personality" number="136"/>
+ <syscall name="afs_syscall" number="137"/>
+ <syscall name="setfsuid" number="138"/>
+ <syscall name="setfsgid" number="139"/>
+ <syscall name="_llseek" number="140"/>
+ <syscall name="getdents" number="141"/>
+ <syscall name="_newselect" number="142"/>
+ <syscall name="flock" number="143"/>
+ <syscall name="msync" number="144"/>
+ <syscall name="readv" number="145"/>
+ <syscall name="writev" number="146"/>
+ <syscall name="getsid" number="147"/>
+ <syscall name="fdatasync" number="148"/>
+ <syscall name="_sysctl" number="149"/>
+ <syscall name="mlock" number="150"/>
+ <syscall name="munlock" number="151"/>
+ <syscall name="mlockall" number="152"/>
+ <syscall name="munlockall" number="153"/>
+ <syscall name="sched_setparam" number="154"/>
+ <syscall name="sched_getparam" number="155"/>
+ <syscall name="sched_setscheduler" number="156"/>
+ <syscall name="sched_getscheduler" number="157"/>
+ <syscall name="sched_yield" number="158"/>
+ <syscall name="sched_get_priority_max" number="159"/>
+ <syscall name="sched_get_priority_min" number="160"/>
+ <syscall name="sched_rr_get_interval" number="161"/>
+ <syscall name="nanosleep" number="162"/>
+ <syscall name="mremap" number="163"/>
+ <syscall name="setresuid" number="164"/>
+ <syscall name="getresuid" number="165"/>
+ <syscall name="query_module" number="167"/>
+ <syscall name="poll" number="168"/>
+ <syscall name="nfsservctl" number="169"/>
+ <syscall name="setresgid" number="170"/>
+ <syscall name="getresgid" number="171"/>
+ <syscall name="prctl" number="172"/>
+ <syscall name="rt_sigreturn" number="173"/>
+ <syscall name="rt_sigaction" number="174"/>
+ <syscall name="rt_sigprocmask" number="175"/>
+ <syscall name="rt_sigpending" number="176"/>
+ <syscall name="rt_sigtimedwait" number="177"/>
+ <syscall name="rt_sigqueueinfo" number="178"/>
+ <syscall name="rt_sigsuspend" number="179"/>
+ <syscall name="pread64" number="180"/>
+ <syscall name="pwrite64" number="181"/>
+ <syscall name="chown" number="182"/>
+ <syscall name="getcwd" number="183"/>
+ <syscall name="capget" number="184"/>
+ <syscall name="capset" number="185"/>
+ <syscall name="sigaltstack" number="186"/>
+ <syscall name="sendfile" number="187"/>
+ <syscall name="getpmsg" number="188"/>
+ <syscall name="putpmsg" number="189"/>
+ <syscall name="vfork" number="190"/>
+ <syscall name="ugetrlimit" number="191"/>
+ <syscall name="mmap2" number="192"/>
+ <syscall name="truncate64" number="193"/>
+ <syscall name="ftruncate64" number="194"/>
+ <syscall name="stat64" number="195"/>
+ <syscall name="lstat64" number="196"/>
+ <syscall name="fstat64" number="197"/>
+ <syscall name="lchown32" number="198"/>
+ <syscall name="getuid32" number="199"/>
+ <syscall name="getgid32" number="200"/>
+ <syscall name="geteuid32" number="201"/>
+ <syscall name="getegid32" number="202"/>
+ <syscall name="setreuid32" number="203"/>
+ <syscall name="setregid32" number="204"/>
+ <syscall name="getgroups32" number="205"/>
+ <syscall name="setgroups32" number="206"/>
+ <syscall name="fchown32" number="207"/>
+ <syscall name="setresuid32" number="208"/>
+ <syscall name="getresuid32" number="209"/>
+ <syscall name="setresgid32" number="210"/>
+ <syscall name="getresgid32" number="211"/>
+ <syscall name="chown32" number="212"/>
+ <syscall name="setuid32" number="213"/>
+ <syscall name="setgid32" number="214"/>
+ <syscall name="setfsuid32" number="215"/>
+ <syscall name="setfsgid32" number="216"/>
+ <syscall name="pivot_root" number="217"/>
+ <syscall name="mincore" number="218"/>
+ <syscall name="madvise" number="219"/>
+ <syscall name="getdents64" number="220"/>
+ <syscall name="fcntl64" number="221"/>
+ <syscall name="readahead" number="222"/>
+ <syscall name="sendfile64" number="223"/>
+ <syscall name="setxattr" number="224"/>
+ <syscall name="lsetxattr" number="225"/>
+ <syscall name="fsetxattr" number="226"/>
+ <syscall name="getxattr" number="227"/>
+ <syscall name="lgetxattr" number="228"/>
+ <syscall name="fgetxattr" number="229"/>
+ <syscall name="listxattr" number="230"/>
+ <syscall name="llistxattr" number="231"/>
+ <syscall name="flistxattr" number="232"/>
+ <syscall name="removexattr" number="233"/>
+ <syscall name="lremovexattr" number="234"/>
+ <syscall name="fremovexattr" number="235"/>
+ <syscall name="gettid" number="236"/>
+ <syscall name="tkill" number="237"/>
+ <syscall name="futex" number="238"/>
+ <syscall name="sched_setaffinity" number="239"/>
+ <syscall name="sched_getaffinity" number="240"/>
+ <syscall name="tgkill" number="241"/>
+ <syscall name="io_setup" number="243"/>
+ <syscall name="io_destroy" number="244"/>
+ <syscall name="io_getevents" number="245"/>
+ <syscall name="io_submit" number="246"/>
+ <syscall name="io_cancel" number="247"/>
+ <syscall name="exit_group" number="248"/>
+ <syscall name="epoll_create" number="249"/>
+ <syscall name="epoll_ctl" number="250"/>
+ <syscall name="epoll_wait" number="251"/>
+ <syscall name="set_tid_address" number="252"/>
+ <syscall name="fadvise64" number="253"/>
+ <syscall name="timer_create" number="254"/>
+ <syscall name="timer_settime" number="255"/>
+ <syscall name="timer_gettime" number="256"/>
+ <syscall name="timer_getoverrun" number="257"/>
+ <syscall name="timer_delete" number="258"/>
+ <syscall name="clock_settime" number="259"/>
+ <syscall name="clock_gettime" number="260"/>
+ <syscall name="clock_getres" number="261"/>
+ <syscall name="clock_nanosleep" number="262"/>
+ <syscall name="fadvise64_64" number="264"/>
+ <syscall name="statfs64" number="265"/>
+ <syscall name="fstatfs64" number="266"/>
+ <syscall name="remap_file_pages" number="267"/>
+ <syscall name="mq_open" number="271"/>
+ <syscall name="mq_unlink" number="272"/>
+ <syscall name="mq_timedsend" number="273"/>
+ <syscall name="mq_timedreceive" number="274"/>
+ <syscall name="mq_notify" number="275"/>
+ <syscall name="mq_getsetattr" number="276"/>
+ <syscall name="kexec_load" number="277"/>
+ <syscall name="add_key" number="278"/>
+ <syscall name="request_key" number="279"/>
+ <syscall name="keyctl" number="280"/>
+ <syscall name="waitid" number="281"/>
+ <syscall name="ioprio_set" number="282"/>
+ <syscall name="ioprio_get" number="283"/>
+ <syscall name="inotify_init" number="284"/>
+ <syscall name="inotify_add_watch" number="285"/>
+ <syscall name="inotify_rm_watch" number="286"/>
+ <syscall name="openat" number="288"/>
+ <syscall name="mkdirat" number="289"/>
+ <syscall name="mknodat" number="290"/>
+ <syscall name="fchownat" number="291"/>
+ <syscall name="futimesat" number="292"/>
+ <syscall name="fstatat64" number="293"/>
+ <syscall name="unlinkat" number="294"/>
+ <syscall name="renameat" number="295"/>
+ <syscall name="linkat" number="296"/>
+ <syscall name="symlinkat" number="297"/>
+ <syscall name="readlinkat" number="298"/>
+ <syscall name="fchmodat" number="299"/>
+ <syscall name="faccessat" number="300"/>
+ <syscall name="pselect6" number="301"/>
+ <syscall name="ppoll" number="302"/>
+ <syscall name="unshare" number="303"/>
+ <syscall name="set_robust_list" number="304"/>
+ <syscall name="get_robust_list" number="305"/>
+ <syscall name="splice" number="306"/>
+ <syscall name="sync_file_range" number="307"/>
+ <syscall name="tee" number="308"/>
+ <syscall name="vmsplice" number="309"/>
+ <syscall name="getcpu" number="311"/>
+ <syscall name="epoll_pwait" number="312"/>
+ <syscall name="utimes" number="313"/>
+ <syscall name="fallocate" number="314"/>
+ <syscall name="utimensat" number="315"/>
+ <syscall name="signalfd" number="316"/>
+ <syscall name="timerfd" number="317"/>
+ <syscall name="eventfd" number="318"/>
+ <syscall name="timerfd_create" number="319"/>
+ <syscall name="timerfd_settime" number="320"/>
+ <syscall name="timerfd_gettime" number="321"/>
+ <syscall name="signalfd4" number="322"/>
+ <syscall name="eventfd2" number="323"/>
+ <syscall name="inotify_init1" number="324"/>
+ <syscall name="pipe2" number="325"/>
+ <syscall name="dup3" number="326"/>
+ <syscall name="epoll_create1" number="327"/>
+ <syscall name="rt_tgsigqueueinfo" number="330"/>
+ <syscall name="perf_event_open" number="331"/>
+ <syscall name="fanotify_init" number="332"/>
+ <syscall name="fanotify_mark" number="333"/>
+ <syscall name="prlimit64" number="334"/>
+ <syscall name="name_to_handle_at" number="335"/>
+ <syscall name="open_by_handle_at" number="336"/>
+ <syscall name="clock_adjtime" number="337"/>
+ <syscall name="syncfs" number="338"/>
+ <syscall name="setns" number="339"/>
+ <syscall name="process_vm_readv" number="340"/>
+ <syscall name="process_vm_writev" number="341"/>
+ <syscall name="s390_runtime_instr" number="342"/>
+ <syscall name="kcmp" number="343"/>
+</syscalls_info>
diff --git a/gdb/syscalls/s390x-linux.xml b/gdb/syscalls/s390x-linux.xml
new file mode 100644
index 0000000..9f2b60f
--- /dev/null
+++ b/gdb/syscalls/s390x-linux.xml
@@ -0,0 +1,298 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2009-2014 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. -->
+
+<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
+
+<!-- This file was generated using the following file:
+
+ /usr/include/asm/unistd.h
+
+ The file mentioned above belongs to the Linux Kernel. -->
+
+<syscalls_info>
+ <syscall name="exit" number="1"/>
+ <syscall name="fork" number="2"/>
+ <syscall name="read" number="3"/>
+ <syscall name="write" number="4"/>
+ <syscall name="open" number="5"/>
+ <syscall name="close" number="6"/>
+ <syscall name="restart_syscall" number="7"/>
+ <syscall name="creat" number="8"/>
+ <syscall name="link" number="9"/>
+ <syscall name="unlink" number="10"/>
+ <syscall name="execve" number="11"/>
+ <syscall name="chdir" number="12"/>
+ <syscall name="mknod" number="14"/>
+ <syscall name="chmod" number="15"/>
+ <syscall name="lseek" number="19"/>
+ <syscall name="getpid" number="20"/>
+ <syscall name="mount" number="21"/>
+ <syscall name="umount" number="22"/>
+ <syscall name="ptrace" number="26"/>
+ <syscall name="alarm" number="27"/>
+ <syscall name="pause" number="29"/>
+ <syscall name="utime" number="30"/>
+ <syscall name="access" number="33"/>
+ <syscall name="nice" number="34"/>
+ <syscall name="sync" number="36"/>
+ <syscall name="kill" number="37"/>
+ <syscall name="rename" number="38"/>
+ <syscall name="mkdir" number="39"/>
+ <syscall name="rmdir" number="40"/>
+ <syscall name="dup" number="41"/>
+ <syscall name="pipe" number="42"/>
+ <syscall name="times" number="43"/>
+ <syscall name="brk" number="45"/>
+ <syscall name="signal" number="48"/>
+ <syscall name="acct" number="51"/>
+ <syscall name="umount2" number="52"/>
+ <syscall name="ioctl" number="54"/>
+ <syscall name="fcntl" number="55"/>
+ <syscall name="setpgid" number="57"/>
+ <syscall name="umask" number="60"/>
+ <syscall name="chroot" number="61"/>
+ <syscall name="ustat" number="62"/>
+ <syscall name="dup2" number="63"/>
+ <syscall name="getppid" number="64"/>
+ <syscall name="getpgrp" number="65"/>
+ <syscall name="setsid" number="66"/>
+ <syscall name="sigaction" number="67"/>
+ <syscall name="sigsuspend" number="72"/>
+ <syscall name="sigpending" number="73"/>
+ <syscall name="sethostname" number="74"/>
+ <syscall name="setrlimit" number="75"/>
+ <syscall name="getrusage" number="77"/>
+ <syscall name="gettimeofday" number="78"/>
+ <syscall name="settimeofday" number="79"/>
+ <syscall name="symlink" number="83"/>
+ <syscall name="readlink" number="85"/>
+ <syscall name="uselib" number="86"/>
+ <syscall name="swapon" number="87"/>
+ <syscall name="reboot" number="88"/>
+ <syscall name="readdir" number="89"/>
+ <syscall name="mmap" number="90"/>
+ <syscall name="munmap" number="91"/>
+ <syscall name="truncate" number="92"/>
+ <syscall name="ftruncate" number="93"/>
+ <syscall name="fchmod" number="94"/>
+ <syscall name="getpriority" number="96"/>
+ <syscall name="setpriority" number="97"/>
+ <syscall name="statfs" number="99"/>
+ <syscall name="fstatfs" number="100"/>
+ <syscall name="socketcall" number="102"/>
+ <syscall name="syslog" number="103"/>
+ <syscall name="setitimer" number="104"/>
+ <syscall name="getitimer" number="105"/>
+ <syscall name="stat" number="106"/>
+ <syscall name="lstat" number="107"/>
+ <syscall name="fstat" number="108"/>
+ <syscall name="lookup_dcookie" number="110"/>
+ <syscall name="vhangup" number="111"/>
+ <syscall name="idle" number="112"/>
+ <syscall name="wait4" number="114"/>
+ <syscall name="swapoff" number="115"/>
+ <syscall name="sysinfo" number="116"/>
+ <syscall name="ipc" number="117"/>
+ <syscall name="fsync" number="118"/>
+ <syscall name="sigreturn" number="119"/>
+ <syscall name="clone" number="120"/>
+ <syscall name="setdomainname" number="121"/>
+ <syscall name="uname" number="122"/>
+ <syscall name="adjtimex" number="124"/>
+ <syscall name="mprotect" number="125"/>
+ <syscall name="sigprocmask" number="126"/>
+ <syscall name="create_module" number="127"/>
+ <syscall name="init_module" number="128"/>
+ <syscall name="delete_module" number="129"/>
+ <syscall name="get_kernel_syms" number="130"/>
+ <syscall name="quotactl" number="131"/>
+ <syscall name="getpgid" number="132"/>
+ <syscall name="fchdir" number="133"/>
+ <syscall name="bdflush" number="134"/>
+ <syscall name="sysfs" number="135"/>
+ <syscall name="personality" number="136"/>
+ <syscall name="afs_syscall" number="137"/>
+ <syscall name="getdents" number="141"/>
+ <syscall name="select" number="142"/>
+ <syscall name="flock" number="143"/>
+ <syscall name="msync" number="144"/>
+ <syscall name="readv" number="145"/>
+ <syscall name="writev" number="146"/>
+ <syscall name="getsid" number="147"/>
+ <syscall name="fdatasync" number="148"/>
+ <syscall name="_sysctl" number="149"/>
+ <syscall name="mlock" number="150"/>
+ <syscall name="munlock" number="151"/>
+ <syscall name="mlockall" number="152"/>
+ <syscall name="munlockall" number="153"/>
+ <syscall name="sched_setparam" number="154"/>
+ <syscall name="sched_getparam" number="155"/>
+ <syscall name="sched_setscheduler" number="156"/>
+ <syscall name="sched_getscheduler" number="157"/>
+ <syscall name="sched_yield" number="158"/>
+ <syscall name="sched_get_priority_max" number="159"/>
+ <syscall name="sched_get_priority_min" number="160"/>
+ <syscall name="sched_rr_get_interval" number="161"/>
+ <syscall name="nanosleep" number="162"/>
+ <syscall name="mremap" number="163"/>
+ <syscall name="query_module" number="167"/>
+ <syscall name="poll" number="168"/>
+ <syscall name="nfsservctl" number="169"/>
+ <syscall name="prctl" number="172"/>
+ <syscall name="rt_sigreturn" number="173"/>
+ <syscall name="rt_sigaction" number="174"/>
+ <syscall name="rt_sigprocmask" number="175"/>
+ <syscall name="rt_sigpending" number="176"/>
+ <syscall name="rt_sigtimedwait" number="177"/>
+ <syscall name="rt_sigqueueinfo" number="178"/>
+ <syscall name="rt_sigsuspend" number="179"/>
+ <syscall name="pread64" number="180"/>
+ <syscall name="pwrite64" number="181"/>
+ <syscall name="getcwd" number="183"/>
+ <syscall name="capget" number="184"/>
+ <syscall name="capset" number="185"/>
+ <syscall name="sigaltstack" number="186"/>
+ <syscall name="sendfile" number="187"/>
+ <syscall name="getpmsg" number="188"/>
+ <syscall name="putpmsg" number="189"/>
+ <syscall name="vfork" number="190"/>
+ <syscall name="getrlimit" number="191"/>
+ <syscall name="lchown" number="198"/>
+ <syscall name="getuid" number="199"/>
+ <syscall name="getgid" number="200"/>
+ <syscall name="geteuid" number="201"/>
+ <syscall name="getegid" number="202"/>
+ <syscall name="setreuid" number="203"/>
+ <syscall name="setregid" number="204"/>
+ <syscall name="getgroups" number="205"/>
+ <syscall name="setgroups" number="206"/>
+ <syscall name="fchown" number="207"/>
+ <syscall name="setresuid" number="208"/>
+ <syscall name="getresuid" number="209"/>
+ <syscall name="setresgid" number="210"/>
+ <syscall name="getresgid" number="211"/>
+ <syscall name="chown" number="212"/>
+ <syscall name="setuid" number="213"/>
+ <syscall name="setgid" number="214"/>
+ <syscall name="setfsuid" number="215"/>
+ <syscall name="setfsgid" number="216"/>
+ <syscall name="pivot_root" number="217"/>
+ <syscall name="mincore" number="218"/>
+ <syscall name="madvise" number="219"/>
+ <syscall name="getdents64" number="220"/>
+ <syscall name="readahead" number="222"/>
+ <syscall name="setxattr" number="224"/>
+ <syscall name="lsetxattr" number="225"/>
+ <syscall name="fsetxattr" number="226"/>
+ <syscall name="getxattr" number="227"/>
+ <syscall name="lgetxattr" number="228"/>
+ <syscall name="fgetxattr" number="229"/>
+ <syscall name="listxattr" number="230"/>
+ <syscall name="llistxattr" number="231"/>
+ <syscall name="flistxattr" number="232"/>
+ <syscall name="removexattr" number="233"/>
+ <syscall name="lremovexattr" number="234"/>
+ <syscall name="fremovexattr" number="235"/>
+ <syscall name="gettid" number="236"/>
+ <syscall name="tkill" number="237"/>
+ <syscall name="futex" number="238"/>
+ <syscall name="sched_setaffinity" number="239"/>
+ <syscall name="sched_getaffinity" number="240"/>
+ <syscall name="tgkill" number="241"/>
+ <syscall name="io_setup" number="243"/>
+ <syscall name="io_destroy" number="244"/>
+ <syscall name="io_getevents" number="245"/>
+ <syscall name="io_submit" number="246"/>
+ <syscall name="io_cancel" number="247"/>
+ <syscall name="exit_group" number="248"/>
+ <syscall name="epoll_create" number="249"/>
+ <syscall name="epoll_ctl" number="250"/>
+ <syscall name="epoll_wait" number="251"/>
+ <syscall name="set_tid_address" number="252"/>
+ <syscall name="fadvise64" number="253"/>
+ <syscall name="timer_create" number="254"/>
+ <syscall name="timer_settime" number="255"/>
+ <syscall name="timer_gettime" number="256"/>
+ <syscall name="timer_getoverrun" number="257"/>
+ <syscall name="timer_delete" number="258"/>
+ <syscall name="clock_settime" number="259"/>
+ <syscall name="clock_gettime" number="260"/>
+ <syscall name="clock_getres" number="261"/>
+ <syscall name="clock_nanosleep" number="262"/>
+ <syscall name="statfs64" number="265"/>
+ <syscall name="fstatfs64" number="266"/>
+ <syscall name="remap_file_pages" number="267"/>
+ <syscall name="mq_open" number="271"/>
+ <syscall name="mq_unlink" number="272"/>
+ <syscall name="mq_timedsend" number="273"/>
+ <syscall name="mq_timedreceive" number="274"/>
+ <syscall name="mq_notify" number="275"/>
+ <syscall name="mq_getsetattr" number="276"/>
+ <syscall name="kexec_load" number="277"/>
+ <syscall name="add_key" number="278"/>
+ <syscall name="request_key" number="279"/>
+ <syscall name="keyctl" number="280"/>
+ <syscall name="waitid" number="281"/>
+ <syscall name="ioprio_set" number="282"/>
+ <syscall name="ioprio_get" number="283"/>
+ <syscall name="inotify_init" number="284"/>
+ <syscall name="inotify_add_watch" number="285"/>
+ <syscall name="inotify_rm_watch" number="286"/>
+ <syscall name="openat" number="288"/>
+ <syscall name="mkdirat" number="289"/>
+ <syscall name="mknodat" number="290"/>
+ <syscall name="fchownat" number="291"/>
+ <syscall name="futimesat" number="292"/>
+ <syscall name="newfstatat" number="293"/>
+ <syscall name="unlinkat" number="294"/>
+ <syscall name="renameat" number="295"/>
+ <syscall name="linkat" number="296"/>
+ <syscall name="symlinkat" number="297"/>
+ <syscall name="readlinkat" number="298"/>
+ <syscall name="fchmodat" number="299"/>
+ <syscall name="faccessat" number="300"/>
+ <syscall name="pselect6" number="301"/>
+ <syscall name="ppoll" number="302"/>
+ <syscall name="unshare" number="303"/>
+ <syscall name="set_robust_list" number="304"/>
+ <syscall name="get_robust_list" number="305"/>
+ <syscall name="splice" number="306"/>
+ <syscall name="sync_file_range" number="307"/>
+ <syscall name="tee" number="308"/>
+ <syscall name="vmsplice" number="309"/>
+ <syscall name="getcpu" number="311"/>
+ <syscall name="epoll_pwait" number="312"/>
+ <syscall name="utimes" number="313"/>
+ <syscall name="fallocate" number="314"/>
+ <syscall name="utimensat" number="315"/>
+ <syscall name="signalfd" number="316"/>
+ <syscall name="timerfd" number="317"/>
+ <syscall name="eventfd" number="318"/>
+ <syscall name="timerfd_create" number="319"/>
+ <syscall name="timerfd_settime" number="320"/>
+ <syscall name="timerfd_gettime" number="321"/>
+ <syscall name="signalfd4" number="322"/>
+ <syscall name="eventfd2" number="323"/>
+ <syscall name="inotify_init1" number="324"/>
+ <syscall name="pipe2" number="325"/>
+ <syscall name="dup3" number="326"/>
+ <syscall name="epoll_create1" number="327"/>
+ <syscall name="rt_tgsigqueueinfo" number="330"/>
+ <syscall name="perf_event_open" number="331"/>
+ <syscall name="fanotify_init" number="332"/>
+ <syscall name="fanotify_mark" number="333"/>
+ <syscall name="prlimit64" number="334"/>
+ <syscall name="name_to_handle_at" number="335"/>
+ <syscall name="open_by_handle_at" number="336"/>
+ <syscall name="clock_adjtime" number="337"/>
+ <syscall name="syncfs" number="338"/>
+ <syscall name="setns" number="339"/>
+ <syscall name="process_vm_readv" number="340"/>
+ <syscall name="process_vm_writev" number="341"/>
+ <syscall name="s390_runtime_instr" number="342"/>
+ <syscall name="kcmp" number="343"/>
+</syscalls_info>
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index dbbd0ec2..e45fda3 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2014-01-22 Andreas Arnez <arnez@vnet.linux.ibm.com>
+ * gdb.base/catch-syscall.exp: Activate test on s390*-linux.
+
+2014-01-22 Andreas Arnez <arnez@vnet.linux.ibm.com>
+
* gdb.trace/entry-values.exp: Remove excess space character from
regex patterns. Handle s390 call instruction.
diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp
index 8ff4220..da838f7 100644
--- a/gdb/testsuite/gdb.base/catch-syscall.exp
+++ b/gdb/testsuite/gdb.base/catch-syscall.exp
@@ -34,7 +34,8 @@ if { ![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"] } {
if { ![istarget "x86_64-*-linux*"] && ![istarget "i\[34567\]86-*-linux*"]
&& ![istarget "powerpc-*-linux*"] && ![istarget "powerpc64-*-linux*"]
&& ![istarget "sparc-*-linux*"] && ![istarget "sparc64-*-linux*"]
- && ![istarget "mips*-linux*"] && ![istarget "arm*-linux*"] } {
+ && ![istarget "mips*-linux*"] && ![istarget "arm*-linux*"]
+ && ![istarget "s390*-linux*"] } {
continue
}