public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFC][PATCH] Preliminary `catch syscall' support for ARM Linux.
@ 2013-07-31 21:04 Samuel Bronson
  2013-08-02 16:56 ` Tom Tromey
       [not found] ` <E1V4dYl-0006Y8-79 at hydrogen>
  0 siblings, 2 replies; 12+ messages in thread
From: Samuel Bronson @ 2013-07-31 21:04 UTC (permalink / raw)
  To: gdb-patches

This seems to work okay, but needs a better arm-linux.xml file and
some cleanup, as well as a changelog.
---
 gdb/arm-linux-tdep.c           |   61 ++++++++++++++
 gdb/data-directory/Makefile.in |    1 +
 gdb/syscalls/arm-linux.xml     |  181 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 243 insertions(+)
 create mode 100644 gdb/syscalls/arm-linux.xml

diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 1502bdc..449f87c 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -33,6 +33,7 @@
 #include "tramp-frame.h"
 #include "breakpoint.h"
 #include "auxv.h"
+#include "xml-syscall.h"
 
 #include "arm-tdep.h"
 #include "arm-linux-tdep.h"
@@ -794,6 +795,62 @@ arm_linux_sigreturn_return_addr (struct frame_info *frame,
   return 0;
 }
 
+/* When FRAME is at a syscall instruction, return the syscall number.
+   This either comes from the SWI (OABI) or from r7 (EABI).
+
+   When the function fails, it SHOULD return -1.  */
+
+static LONGEST
+arm_linux_get_syscall_number (struct gdbarch *gdbarch,
+			      ptid_t ptid)
+{
+  struct regcache *regs = get_thread_regcache (ptid);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  ULONGEST pc;
+  ULONGEST cpsr;
+  ULONGEST t_bit = arm_psr_thumb_bit (gdbarch);
+  int is_thumb;
+  ULONGEST svc_number = -1;
+
+  regcache_cooked_read_unsigned (regs, ARM_PC_REGNUM, &pc);
+  regcache_cooked_read_unsigned (regs, ARM_PS_REGNUM, &cpsr);
+  is_thumb = (cpsr & t_bit) != 0;
+
+  if (is_thumb)
+    {
+      /* XXX ensure SWI? */
+      regcache_cooked_read_unsigned (regs, 7, &svc_number);
+    }
+  else
+    {
+      enum bfd_endian byte_order_for_code = 
+	gdbarch_byte_order_for_code (gdbarch);
+      unsigned long this_instr = 
+	read_memory_unsigned_integer (pc - 4, 4, byte_order_for_code);
+
+      unsigned long svc_operand = (0x00ffffff & this_instr);
+
+      /*
+      if ((this_instr & 0xff000000) != 0xef000000)
+        {
+          return -1;
+        }
+      */
+
+      if (svc_operand)  /* OABI.  */
+	{
+	  svc_number = svc_operand - 0x900000;
+	}
+      else /* EABI.  */
+	{
+          regcache_cooked_read_unsigned (regs, 7, &svc_number);
+	}
+    }
+
+  return svc_number;
+}
+
 /* When FRAME is at a syscall instruction, return the PC of the next
    instruction to be executed.  */
 
@@ -1294,6 +1351,10 @@ arm_linux_init_abi (struct gdbarch_info info,
 
   tdep->syscall_next_pc = arm_linux_syscall_next_pc;
 
+  /* `catch syscall' */
+  set_xml_syscall_file_name ("syscalls/arm-linux.xml");
+  set_gdbarch_get_syscall_number (gdbarch, arm_linux_get_syscall_number);
+
   /* Syscall record.  */
   tdep->arm_swi_record = NULL;
 }
diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
index dec6207..3d05213 100644
--- a/gdb/data-directory/Makefile.in
+++ b/gdb/data-directory/Makefile.in
@@ -45,6 +45,7 @@ SYSCALLS_DIR = syscalls
 SYSCALLS_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSCALLS_DIR)
 SYSCALLS_FILES = \
 	gdb-syscalls.dtd \
+	arm-linux.xml \
 	ppc-linux.xml ppc64-linux.xml \
 	i386-linux.xml amd64-linux.xml \
 	sparc-linux.xml sparc64-linux.xml \
diff --git a/gdb/syscalls/arm-linux.xml b/gdb/syscalls/arm-linux.xml
new file mode 100644
index 0000000..28e1b9d
--- /dev/null
+++ b/gdb/syscalls/arm-linux.xml
@@ -0,0 +1,181 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2009-2013 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 copied from ppc-linux.xml because *somebody* didn't
+     provide his generation script.  (It has been truncated where the
+     syscall numbers diverge.) -->
+
+<syscalls_info>
+  <syscall name="restart_syscall" number="0"/>
+  <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="waitpid" 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="break" number="17"/>
+  <syscall name="oldstat" number="18"/>
+  <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="oldfstat" number="28"/>
+  <syscall name="pause" number="29"/>
+  <syscall name="utime" number="30"/>
+  <syscall name="stty" number="31"/>
+  <syscall name="gtty" number="32"/>
+  <syscall name="access" number="33"/>
+  <syscall name="nice" number="34"/>
+  <syscall name="ftime" number="35"/>
+  <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="prof" number="44"/>
+  <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="lock" number="53"/>
+  <syscall name="ioctl" number="54"/>
+  <syscall name="fcntl" number="55"/>
+  <syscall name="mpx" number="56"/>
+  <syscall name="setpgid" number="57"/>
+  <syscall name="ulimit" number="58"/>
+  <syscall name="oldolduname" number="59"/>
+  <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="sgetmask" number="68"/>
+  <syscall name="ssetmask" number="69"/>
+  <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="select" number="82"/>
+  <syscall name="symlink" number="83"/>
+  <syscall name="oldlstat" number="84"/>
+  <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="profil" number="98"/>
+  <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="olduname" number="109"/>
+  <syscall name="iopl" number="110"/>
+  <syscall name="vhangup" number="111"/>
+  <syscall name="idle" number="112"/>
+  <syscall name="vm86" number="113"/>
+  <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="modify_ldt" number="123"/>
+  <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"/>
+</syscalls_info>
-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [RFC][PATCH] Preliminary `catch syscall' support for ARM Linux.
  2013-07-31 21:04 [RFC][PATCH] Preliminary `catch syscall' support for ARM Linux Samuel Bronson
@ 2013-08-02 16:56 ` Tom Tromey
       [not found] ` <E1V4dYl-0006Y8-79 at hydrogen>
  1 sibling, 0 replies; 12+ messages in thread
From: Tom Tromey @ 2013-08-02 16:56 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: gdb-patches

>>>>> ">" == Samuel Bronson <naesten@gmail.com> writes:

>> This seems to work okay, but needs a better arm-linux.xml file and
>> some cleanup, as well as a changelog.

I glanced over it and it seems reasonable to me.

>> +      /* XXX ensure SWI? */

No new FIXMEs though.

Tom

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] ARM Linux support for `catch syscall'
       [not found] ` <E1V4dYl-0006Y8-79 at hydrogen>
@ 2013-08-02 20:33   ` Samuel Bronson
  2013-08-05 17:47     ` Sergio Durigan Junior
  0 siblings, 1 reply; 12+ messages in thread
From: Samuel Bronson @ 2013-08-02 20:33 UTC (permalink / raw)
  To: gdb-patches

This works alright except for the incomplete syscalls/arm-linux.xml,
for which I am waiting on a copy of sergiodj's scripts.

(It only fails one test in catch-syscall.exp, and that's because of a
syscall missing from the XML file, but I decided that adding just that
syscall to the XML file would be cheating.)

gdb/
2013-08-02  Samuel Bronson  <naesten@gmail.com>

	ARM Linux support for`catch syscall'.
	* syscalls/arm-linux.xml: New (stub) syscall file for ARM Linux.
	* arm-linux-tdep.c (arm_linux_get_syscall_number): New function.
	(arm_linux_init_abi): Register the new function and syscall file.
	* data-directory/Makefile.in: Install the new syscall file.

gdb/testsuite/
2013-08-02  Samuel Bronson  <naesten@gmail.com>

	ARM Linux support for`catch syscall'.
	* gdb.base/catch-syscall.exp: Test this on ARM now.
	(fill_all_syscalls_numbers): ARM has close/chroot on 6/61, too.
---
 gdb/arm-linux-tdep.c                     |  56 ++++++++++
 gdb/data-directory/Makefile.in           |   1 +
 gdb/syscalls/arm-linux.xml               | 181 +++++++++++++++++++++++++++++++
 gdb/testsuite/gdb.base/catch-syscall.exp |   9 +-
 4 files changed, 243 insertions(+), 4 deletions(-)
 create mode 100644 gdb/syscalls/arm-linux.xml

diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 1502bdc..9d8238f 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -33,6 +33,7 @@
 #include "tramp-frame.h"
 #include "breakpoint.h"
 #include "auxv.h"
+#include "xml-syscall.h"
 
 #include "arm-tdep.h"
 #include "arm-linux-tdep.h"
@@ -794,6 +795,57 @@ arm_linux_sigreturn_return_addr (struct frame_info *frame,
   return 0;
 }
 
+/* At a ptrace syscall-stop, return the syscall number.  This either
+   comes from the SVC instruction (OABI) or from r7 (EABI).
+
+   When the function fails, it should return -1.  */
+
+static LONGEST
+arm_linux_get_syscall_number (struct gdbarch *gdbarch,
+			      ptid_t ptid)
+{
+  struct regcache *regs = get_thread_regcache (ptid);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  ULONGEST pc;
+  ULONGEST cpsr;
+  ULONGEST t_bit = arm_psr_thumb_bit (gdbarch);
+  int is_thumb;
+  ULONGEST svc_number = -1;
+
+  regcache_cooked_read_unsigned (regs, ARM_PC_REGNUM, &pc);
+  regcache_cooked_read_unsigned (regs, ARM_PS_REGNUM, &cpsr);
+  is_thumb = (cpsr & t_bit) != 0;
+
+  if (is_thumb)
+    {
+      regcache_cooked_read_unsigned (regs, 7, &svc_number);
+    }
+  else
+    {
+      enum bfd_endian byte_order_for_code = 
+	gdbarch_byte_order_for_code (gdbarch);
+
+      /* PC gets incremented before the syscall-stop, so read the
+	 previous instruction.  */
+      unsigned long this_instr = 
+	read_memory_unsigned_integer (pc - 4, 4, byte_order_for_code);
+
+      unsigned long svc_operand = (0x00ffffff & this_instr);
+
+      if (svc_operand)  /* OABI.  */
+	{
+	  svc_number = svc_operand - 0x900000;
+	}
+      else /* EABI.  */
+	{
+	  regcache_cooked_read_unsigned (regs, 7, &svc_number);
+	}
+    }
+
+  return svc_number;
+}
+
 /* When FRAME is at a syscall instruction, return the PC of the next
    instruction to be executed.  */
 
@@ -1294,6 +1346,10 @@ arm_linux_init_abi (struct gdbarch_info info,
 
   tdep->syscall_next_pc = arm_linux_syscall_next_pc;
 
+  /* `catch syscall' */
+  set_xml_syscall_file_name ("syscalls/arm-linux.xml");
+  set_gdbarch_get_syscall_number (gdbarch, arm_linux_get_syscall_number);
+
   /* Syscall record.  */
   tdep->arm_swi_record = NULL;
 }
diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
index dec6207..3d05213 100644
--- a/gdb/data-directory/Makefile.in
+++ b/gdb/data-directory/Makefile.in
@@ -45,6 +45,7 @@ SYSCALLS_DIR = syscalls
 SYSCALLS_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSCALLS_DIR)
 SYSCALLS_FILES = \
 	gdb-syscalls.dtd \
+	arm-linux.xml \
 	ppc-linux.xml ppc64-linux.xml \
 	i386-linux.xml amd64-linux.xml \
 	sparc-linux.xml sparc64-linux.xml \
diff --git a/gdb/syscalls/arm-linux.xml b/gdb/syscalls/arm-linux.xml
new file mode 100644
index 0000000..28e1b9d
--- /dev/null
+++ b/gdb/syscalls/arm-linux.xml
@@ -0,0 +1,181 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2009-2013 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 copied from ppc-linux.xml because *somebody* didn't
+     provide his generation script.  (It has been truncated where the
+     syscall numbers diverge.) -->
+
+<syscalls_info>
+  <syscall name="restart_syscall" number="0"/>
+  <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="waitpid" 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="break" number="17"/>
+  <syscall name="oldstat" number="18"/>
+  <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="oldfstat" number="28"/>
+  <syscall name="pause" number="29"/>
+  <syscall name="utime" number="30"/>
+  <syscall name="stty" number="31"/>
+  <syscall name="gtty" number="32"/>
+  <syscall name="access" number="33"/>
+  <syscall name="nice" number="34"/>
+  <syscall name="ftime" number="35"/>
+  <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="prof" number="44"/>
+  <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="lock" number="53"/>
+  <syscall name="ioctl" number="54"/>
+  <syscall name="fcntl" number="55"/>
+  <syscall name="mpx" number="56"/>
+  <syscall name="setpgid" number="57"/>
+  <syscall name="ulimit" number="58"/>
+  <syscall name="oldolduname" number="59"/>
+  <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="sgetmask" number="68"/>
+  <syscall name="ssetmask" number="69"/>
+  <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="select" number="82"/>
+  <syscall name="symlink" number="83"/>
+  <syscall name="oldlstat" number="84"/>
+  <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="profil" number="98"/>
+  <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="olduname" number="109"/>
+  <syscall name="iopl" number="110"/>
+  <syscall name="vhangup" number="111"/>
+  <syscall name="idle" number="112"/>
+  <syscall name="vm86" number="113"/>
+  <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="modify_ldt" number="123"/>
+  <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"/>
+</syscalls_info>
diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp
index 395fcd4..1066caf 100644
--- a/gdb/testsuite/gdb.base/catch-syscall.exp
+++ b/gdb/testsuite/gdb.base/catch-syscall.exp
@@ -34,7 +34,7 @@ if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then {
 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 "mips*-linux*"] && ![istarget "arm*-linux*"] } {
      continue
 }
 
@@ -407,11 +407,12 @@ proc do_syscall_tests_without_xml {} {
 proc fill_all_syscalls_numbers {} {
     global all_syscalls_numbers
 
-    # For Linux on x86, PPC, PPC64, SPARC and SPARC64, the numbers for the syscalls
-    # "close" and "chroot" are the same.
+    # For Linux on x86, PPC, PPC64, SPARC, SPARC64 and ARM,
+    # the numbers for the syscalls "close" and "chroot" are the same.
     if { [istarget "i\[34567\]86-*-linux*"]
          || [istarget "powerpc-*-linux*"] || [istarget "powerpc64-*-linux*"]
-         || [istarget "sparc-*-linux*"] || [istarget "sparc64-*-linux*"] } {
+         || [istarget "sparc-*-linux*"] || [istarget "sparc64-*-linux*"]
+         || [istarget "arm*-linux*"] } {
          set all_syscalls_numbers { "6" "61" }
     }
 }
-- 
1.8.3.2

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] ARM Linux support for `catch syscall'
  2013-08-02 20:33   ` [PATCH] ARM Linux support for `catch syscall' Samuel Bronson
@ 2013-08-05 17:47     ` Sergio Durigan Junior
  2013-08-07 15:28       ` Doug Evans
  0 siblings, 1 reply; 12+ messages in thread
From: Sergio Durigan Junior @ 2013-08-05 17:47 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: gdb-patches

On Wednesday, July 31 2013, Samuel Bronson wrote:

> This works alright except for the incomplete syscalls/arm-linux.xml,
> for which I am waiting on a copy of sergiodj's scripts.

Hey Samuel,

Thanks for the patch, and sorry about the delay.

Well, when I told you about some scripts that I used (back in 2009), I
was actually trying to say that it's just a matter of doing some grep's
and sed's in the Linux files.  I guess I didn't provide the script at
that time because the indentation inside the files does not always
follow a pattern, so I thought it would be easier to just deal with each
file separately (and it took me less than 10 minutes to create the XML
file, after all).

Unfortunately, I don't have this script anymore, but if you really want
it, I can create one for the ARM file and send it to you.

> (It only fails one test in catch-syscall.exp, and that's because of a
> syscall missing from the XML file, but I decided that adding just that
> syscall to the XML file would be cheating.)

I wouldn't call it "cheating" :-).

> gdb/
> 2013-08-02  Samuel Bronson  <naesten@gmail.com>
>
> 	ARM Linux support for`catch syscall'.

Missing space between "for`catch syscall'".

> 	* syscalls/arm-linux.xml: New (stub) syscall file for ARM Linux.

New file.

> 	* arm-linux-tdep.c (arm_linux_get_syscall_number): New function.
> 	(arm_linux_init_abi): Register the new function and syscall file.
> 	* data-directory/Makefile.in: Install the new syscall file.
>
> gdb/testsuite/
> 2013-08-02  Samuel Bronson  <naesten@gmail.com>
>
> 	ARM Linux support for`catch syscall'.

Missing space.

> 	* gdb.base/catch-syscall.exp: Test this on ARM now.
> 	(fill_all_syscalls_numbers): ARM has close/chroot on 6/61, too.
> ---
>  gdb/arm-linux-tdep.c                     |  56 ++++++++++
>  gdb/data-directory/Makefile.in           |   1 +
>  gdb/syscalls/arm-linux.xml               | 181 +++++++++++++++++++++++++++++++
>  gdb/testsuite/gdb.base/catch-syscall.exp |   9 +-
>  4 files changed, 243 insertions(+), 4 deletions(-)
>  create mode 100644 gdb/syscalls/arm-linux.xml
>
> diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
> index 1502bdc..9d8238f 100644
> --- a/gdb/arm-linux-tdep.c
> +++ b/gdb/arm-linux-tdep.c
> @@ -33,6 +33,7 @@
>  #include "tramp-frame.h"
>  #include "breakpoint.h"
>  #include "auxv.h"
> +#include "xml-syscall.h"
>  
>  #include "arm-tdep.h"
>  #include "arm-linux-tdep.h"
> @@ -794,6 +795,57 @@ arm_linux_sigreturn_return_addr (struct frame_info *frame,
>    return 0;
>  }
>  
> +/* At a ptrace syscall-stop, return the syscall number.  This either
> +   comes from the SVC instruction (OABI) or from r7 (EABI).
> +
> +   When the function fails, it should return -1.  */
> +
> +static LONGEST
> +arm_linux_get_syscall_number (struct gdbarch *gdbarch,
> +			      ptid_t ptid)
> +{
> +  struct regcache *regs = get_thread_regcache (ptid);
> +  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
> +
> +  ULONGEST pc;
> +  ULONGEST cpsr;
> +  ULONGEST t_bit = arm_psr_thumb_bit (gdbarch);
> +  int is_thumb;
> +  ULONGEST svc_number = -1;
> +
> +  regcache_cooked_read_unsigned (regs, ARM_PC_REGNUM, &pc);
> +  regcache_cooked_read_unsigned (regs, ARM_PS_REGNUM, &cpsr);
> +  is_thumb = (cpsr & t_bit) != 0;
> +
> +  if (is_thumb)
> +    {
> +      regcache_cooked_read_unsigned (regs, 7, &svc_number);
> +    }
> +  else
> +    {
> +      enum bfd_endian byte_order_for_code = 
> +	gdbarch_byte_order_for_code (gdbarch);
> +
> +      /* PC gets incremented before the syscall-stop, so read the
> +	 previous instruction.  */
> +      unsigned long this_instr = 
> +	read_memory_unsigned_integer (pc - 4, 4, byte_order_for_code);
> +
> +      unsigned long svc_operand = (0x00ffffff & this_instr);
> +
> +      if (svc_operand)  /* OABI.  */
> +	{
> +	  svc_number = svc_operand - 0x900000;
> +	}
> +      else /* EABI.  */
> +	{
> +	  regcache_cooked_read_unsigned (regs, 7, &svc_number);
> +	}

I find it a little odd to write comments in the front of the "if/else".
I guess you could write them inside the blocks.

> +    }
> +
> +  return svc_number;
> +}
> +

Well, I'm not very familiar with ARM, but I guess your code looks OK
according to your explanation.

> diff --git a/gdb/syscalls/arm-linux.xml b/gdb/syscalls/arm-linux.xml
> new file mode 100644
> index 0000000..28e1b9d
> --- /dev/null
> +++ b/gdb/syscalls/arm-linux.xml
> @@ -0,0 +1,181 @@
> +<?xml version="1.0"?>
> +<!-- Copyright (C) 2009-2013 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 copied from ppc-linux.xml because *somebody* didn't
> +     provide his generation script.  (It has been truncated where the
> +     syscall numbers diverge.) -->

This comment is unecessary IMO, given what I said above :-).

The rest looks OK to me.  I am not a GDB maintainer, so you may wish to
wait until someone gives his final word.

Thanks a lot,

-- 
Sergio

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] ARM Linux support for `catch syscall'
  2013-08-05 17:47     ` Sergio Durigan Junior
@ 2013-08-07 15:28       ` Doug Evans
       [not found]         ` <E1V9fPE-00060l-WC@hydrogen>
  0 siblings, 1 reply; 12+ messages in thread
From: Doug Evans @ 2013-08-07 15:28 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: Samuel Bronson, gdb-patches

On Mon, Aug 5, 2013 at 10:47 AM, Sergio Durigan Junior
<sergiodj@redhat.com> wrote:
> On Wednesday, July 31 2013, Samuel Bronson wrote:
>
>> This works alright except for the incomplete syscalls/arm-linux.xml,
>> for which I am waiting on a copy of sergiodj's scripts.
>
> [...]
>
> The rest looks OK to me.  I am not a GDB maintainer, so you may wish to
> wait until someone gives his final word.

Needs a NEWS entry.
With that and sergio's changes I think it's ready.
Thanks!
[Best submit the revised patch to the list for final approval I think.]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] ARM Linux support for `catch syscall'
       [not found]         ` <E1V9fPE-00060l-WC@hydrogen>
@ 2013-08-14 19:29           ` Sergio Durigan Junior
  2013-08-16 18:50             ` Samuel Bronson
  2013-08-15 20:05           ` Doug Evans
  1 sibling, 1 reply; 12+ messages in thread
From: Sergio Durigan Junior @ 2013-08-14 19:29 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: gdb-patches, Doug Evans

Hi Samuel,

Thanks for the patch.  A few comments.

On Wednesday, July 31 2013, Samuel Bronson wrote:

> This time, it passes all the tests and comes with a nearly complete
> XML file (plus a script that can nearly regenerate the XML file).

So the XML file is not complete?  What's missing?  IMO it should
certainly be complete, even if the script can't generate it entirely (in
which case it should be hand editted).

> diff --git a/gdb/syscalls/arm-linux.py b/gdb/syscalls/arm-linux.py
> new file mode 100755
> index 0000000..0814dd4
> --- /dev/null
> +++ b/gdb/syscalls/arm-linux.py
> @@ -0,0 +1,60 @@
> +# Copyright (C) 2013 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.  This file is offered as-is,
> +# without any warranty.
> +
> +import sys
> +import re
> +import time
> +
> +infname = sys.argv[1]
> +inf = file(infname)
> +
> +print("""\
> +<?xml version="1.0"?>
> +<!-- Copyright (C) 2009-%s Free Software Foundation, Inc.

The copyright year should be from 2013 to %s, I guess.

> +
> +     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.  This file is offered as-is,
> +     without any warranty. -->
> +
> +<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
> +
> +<!-- This file was generated using the following file:
> +
> +     %s
> +
> +     The file mentioned above belongs to the Linux Kernel.
> +     Some small hand-edits were made. -->
> +
> +<syscalls_info>""" % (time.strftime("%Y"), infname))
> +
> +def record(name, number, comment=None):
> +    #nm = 'name="%s"' % name
> +    #s = '  <syscall %-30s number="%d"/>' % (nm, number)
> +    s = '  <syscall name="%s" number="%d"/>' % (name, number)
> +    if comment:
> +        s += ' <!-- %s -->' % comment
> +    print(s)
> +
> +for line in inf:
> +    m = re.match(r'^#define __NR_(\w+)\s+\(__NR_SYSCALL_BASE\+\s*(\d+)\)',
> +                 line)
> +    if m:
> +        record(m.group(1), int(m.group(2)))
> +        continue
> +
> +    m = re.match(r'^\s+/\* (\d+) was sys_(\w+) \*/$', line)
> +    if m:
> +        record(m.group(2), int(m.group(1)), 'removed')

I don't get the 'removed' comment.  Looking at
<include/linux/arch/arm/include/uapi/asm/unistd.h>, I don't see the
syscalls marked as "removed" in the XML file below.  Where did they come
from?

> +
> +    m = re.match(r'^#define __ARM_NR_(\w+)\s+\(__ARM_NR_BASE\+\s*(\d+)\)',
> +                 line)
> +    if m:
> +        record('ARM_'+m.group(1), 0x0f0000+int(m.group(2)))
> +        continue
> +
> +print('</syscalls_info>')
> diff --git a/gdb/syscalls/arm-linux.xml b/gdb/syscalls/arm-linux.xml
> new file mode 100644
> index 0000000..b35125c
> --- /dev/null
> +++ b/gdb/syscalls/arm-linux.xml
> @@ -0,0 +1,398 @@
> +<?xml version="1.0"?>
> +<!-- Copyright (C) 2009-2013 Free Software Foundation, Inc.
[...]

The rest looks good to me!  Thanks a lot, and thanks for the script :-).

-- 
Sergio

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] ARM Linux support for `catch syscall'
       [not found]         ` <E1V9fPE-00060l-WC@hydrogen>
  2013-08-14 19:29           ` [PATCH v2] " Sergio Durigan Junior
@ 2013-08-15 20:05           ` Doug Evans
  2013-08-15 20:08             ` Sergio Durigan Junior
  2013-08-16 18:53             ` Samuel Bronson
  1 sibling, 2 replies; 12+ messages in thread
From: Doug Evans @ 2013-08-15 20:05 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: Sergio Durigan Junior, gdb-patches

On Wed, Jul 31, 2013 at 1:47 PM, Samuel Bronson <naesten@gmail.com> wrote:
> This time, it passes all the tests and comes with a nearly complete
> XML file (plus a script that can nearly regenerate the XML file).
>
> (I elected to leave out __ARM_NR_cmpxchg, since it has dire warnings
> to the effect that the only pieces of code that should be aware of it
> are the implementation and the __kuser_cmpxchg code in entry-armv.S.)
>
> gdb/
> 2013-08-14  Samuel Bronson  <naesten@gmail.com>
>
>         ARM Linux support for `catch syscall'.
>         * syscalls/arm-linux.py: New file.
>         * syscalls/arm-linux.xml: Likewise.
>         * arm-linux-tdep.c (arm_linux_get_syscall_number): New function.
>         (arm_linux_init_abi): Register the new function and syscall xml file.
>         * data-directory/Makefile.in: Install the new syscall xml file.
>         * NEWS: Brag about this.
>
> gdb/testsuite/
> 2013-08-14  Samuel Bronson  <naesten@gmail.com>
>
>         ARM Linux support for `catch syscall'.
>         * gdb.base/catch-syscall.exp: Test this on ARM now.
>         (fill_all_syscalls_numbers): ARM has close/chroot on 6/61, too.

Hi.
The patch is ok with me (but see beow).
[Do you have a copyright assignment on file?]

From sergio's comments:

>> +print("""\
>> +<?xml version="1.0"?>
>> +<!-- Copyright (C) 2009-%s Free Software Foundation, Inc.
>
>The copyright year should be from 2013 to %s, I guess.

Yeah, I think so.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] ARM Linux support for `catch syscall'
  2013-08-15 20:05           ` Doug Evans
@ 2013-08-15 20:08             ` Sergio Durigan Junior
  2013-08-16 18:53             ` Samuel Bronson
  1 sibling, 0 replies; 12+ messages in thread
From: Sergio Durigan Junior @ 2013-08-15 20:08 UTC (permalink / raw)
  To: Doug Evans; +Cc: Samuel Bronson, gdb-patches

On Thursday, August 15 2013, Doug Evans wrote:

> Hi.
> The patch is ok with me (but see beow).
> [Do you have a copyright assignment on file?]

If you don't, mail me offlist and I can get you started in the process.

-- 
Sergio

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] ARM Linux support for `catch syscall'
  2013-08-14 19:29           ` [PATCH v2] " Sergio Durigan Junior
@ 2013-08-16 18:50             ` Samuel Bronson
  0 siblings, 0 replies; 12+ messages in thread
From: Samuel Bronson @ 2013-08-16 18:50 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: gdb-patches, Doug Evans

On Wed, Aug 14, 2013 at 3:29 PM, Sergio Durigan Junior
<sergiodj@redhat.com> wrote:
>
> Hi Samuel,
>
> Thanks for the patch.  A few comments.
>
> On Wednesday, July 31 2013, Samuel Bronson wrote:
>
> > This time, it passes all the tests and comes with a nearly complete
> > XML file (plus a script that can nearly regenerate the XML file).
>
> So the XML file is not complete?  What's missing?  IMO it should
> certainly be complete, even if the script can't generate it entirely (in
> which case it should be hand editted).

Well the only thing I know is missing is __ARM_NR_cmpxchg; it's a
little hard to tell about the others.  It has every syscall actually
listed for userspace as of the tag v3.11-rc5, plus the obvious removed
ones.

> > +    m = re.match(r'^\s+/\* (\d+) was sys_(\w+) \*/$', line)
> > +    if m:
> > +        record(m.group(2), int(m.group(1)), 'removed')
>
> I don't get the 'removed' comment.  Looking at
> <include/linux/arch/arm/include/uapi/asm/unistd.h>, I don't see the
> syscalls marked as "removed" in the XML file below.  Where did they come
> from?

(It seems that Sergio was looking at a bad copy of the headers, since resolved.)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] ARM Linux support for `catch syscall'
  2013-08-15 20:05           ` Doug Evans
  2013-08-15 20:08             ` Sergio Durigan Junior
@ 2013-08-16 18:53             ` Samuel Bronson
  1 sibling, 0 replies; 12+ messages in thread
From: Samuel Bronson @ 2013-08-16 18:53 UTC (permalink / raw)
  To: Doug Evans; +Cc: Sergio Durigan Junior, gdb-patches

On Thu, Aug 15, 2013 at 4:05 PM, Doug Evans <dje@google.com> wrote:

> Hi.
> The patch is ok with me (but see beow).
> [Do you have a copyright assignment on file?]

Yes, I do.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] ARM Linux support for `catch syscall'
  2013-08-16 18:19 Doug Evans
@ 2013-08-22 20:35 ` Sergio Durigan Junior
  0 siblings, 0 replies; 12+ messages in thread
From: Sergio Durigan Junior @ 2013-08-22 20:35 UTC (permalink / raw)
  To: Doug Evans; +Cc: Samuel Bronson, gdb-patches

On Friday, August 16 2013, Doug Evans wrote:

> Hi.
> Re: http://sourceware.org/ml/gdb-patches/2013-08/msg00408.html
>
> Given that some of the generated output is copied from ppc-linux.xml,
> I guess keeping 2009 is TRTTD.
>
> Patch is ok by me.

I committed the following patch for Samuel.

  http://sourceware.org/ml/gdb-cvs/2013-08/msg00114.html

-- 
Sergio

This time, it passes all the tests and comes with a nearly complete
XML file (plus a script that can nearly regenerate the XML file).

(I elected to leave out __ARM_NR_cmpxchg, since it has dire warnings
to the effect that the only pieces of code that should be aware of it
are the implementation and the __kuser_cmpxchg code in entry-armv.S.)

gdb/
2013-08-14  Samuel Bronson  <naesten@gmail.com>

	ARM Linux support for `catch syscall'.
	* syscalls/arm-linux.py: New file.
	* syscalls/arm-linux.xml: Likewise.
	* arm-linux-tdep.c (arm_linux_get_syscall_number): New function.
	(arm_linux_init_abi): Register the new function and syscall xml file.
	* data-directory/Makefile.in: Install the new syscall xml file.
	* NEWS: Brag about this.

gdb/testsuite/
2013-08-14  Samuel Bronson  <naesten@gmail.com>

	ARM Linux support for `catch syscall'.
	* gdb.base/catch-syscall.exp: Test this on ARM now.
	(fill_all_syscalls_numbers): ARM has close/chroot on 6/61, too.
---
 gdb/NEWS                                 |   2 +
 gdb/arm-linux-tdep.c                     |  58 +++++
 gdb/data-directory/Makefile.in           |   1 +
 gdb/syscalls/arm-linux.py                |  60 +++++
 gdb/syscalls/arm-linux.xml               | 398 +++++++++++++++++++++++++++++++
 gdb/testsuite/gdb.base/catch-syscall.exp |   9 +-
 6 files changed, 524 insertions(+), 4 deletions(-)
 create mode 100755 gdb/syscalls/arm-linux.py
 create mode 100644 gdb/syscalls/arm-linux.xml

diff --git a/gdb/NEWS b/gdb/NEWS
index 6ee82f7..f246ee1 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,6 +3,8 @@
 
 *** Changes since GDB 7.6
 
+* The "catch syscall" command now works on arm*-linux* targets.
+
 * Python scripting
 
   ** Frame filters and frame decorators have been added.
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 1502bdc..6ac61cc 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -33,6 +33,7 @@
 #include "tramp-frame.h"
 #include "breakpoint.h"
 #include "auxv.h"
+#include "xml-syscall.h"
 
 #include "arm-tdep.h"
 #include "arm-linux-tdep.h"
@@ -794,6 +795,59 @@ arm_linux_sigreturn_return_addr (struct frame_info *frame,
   return 0;
 }
 
+/* At a ptrace syscall-stop, return the syscall number.  This either
+   comes from the SWI instruction (OABI) or from r7 (EABI).
+
+   When the function fails, it should return -1.  */
+
+static LONGEST
+arm_linux_get_syscall_number (struct gdbarch *gdbarch,
+			      ptid_t ptid)
+{
+  struct regcache *regs = get_thread_regcache (ptid);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  ULONGEST pc;
+  ULONGEST cpsr;
+  ULONGEST t_bit = arm_psr_thumb_bit (gdbarch);
+  int is_thumb;
+  ULONGEST svc_number = -1;
+
+  regcache_cooked_read_unsigned (regs, ARM_PC_REGNUM, &pc);
+  regcache_cooked_read_unsigned (regs, ARM_PS_REGNUM, &cpsr);
+  is_thumb = (cpsr & t_bit) != 0;
+
+  if (is_thumb)
+    {
+      regcache_cooked_read_unsigned (regs, 7, &svc_number);
+    }
+  else
+    {
+      enum bfd_endian byte_order_for_code = 
+	gdbarch_byte_order_for_code (gdbarch);
+
+      /* PC gets incremented before the syscall-stop, so read the
+	 previous instruction.  */
+      unsigned long this_instr = 
+	read_memory_unsigned_integer (pc - 4, 4, byte_order_for_code);
+
+      unsigned long svc_operand = (0x00ffffff & this_instr);
+
+      if (svc_operand)
+	{
+          /* OABI */
+	  svc_number = svc_operand - 0x900000;
+	}
+      else
+	{
+          /* EABI */
+	  regcache_cooked_read_unsigned (regs, 7, &svc_number);
+	}
+    }
+
+  return svc_number;
+}
+
 /* When FRAME is at a syscall instruction, return the PC of the next
    instruction to be executed.  */
 
@@ -1294,6 +1348,10 @@ arm_linux_init_abi (struct gdbarch_info info,
 
   tdep->syscall_next_pc = arm_linux_syscall_next_pc;
 
+  /* `catch syscall' */
+  set_xml_syscall_file_name ("syscalls/arm-linux.xml");
+  set_gdbarch_get_syscall_number (gdbarch, arm_linux_get_syscall_number);
+
   /* Syscall record.  */
   tdep->arm_swi_record = NULL;
 }
diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
index dec6207..3d05213 100644
--- a/gdb/data-directory/Makefile.in
+++ b/gdb/data-directory/Makefile.in
@@ -45,6 +45,7 @@ SYSCALLS_DIR = syscalls
 SYSCALLS_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSCALLS_DIR)
 SYSCALLS_FILES = \
 	gdb-syscalls.dtd \
+	arm-linux.xml \
 	ppc-linux.xml ppc64-linux.xml \
 	i386-linux.xml amd64-linux.xml \
 	sparc-linux.xml sparc64-linux.xml \
diff --git a/gdb/syscalls/arm-linux.py b/gdb/syscalls/arm-linux.py
new file mode 100755
index 0000000..0814dd4
--- /dev/null
+++ b/gdb/syscalls/arm-linux.py
@@ -0,0 +1,60 @@
+# Copyright (C) 2013 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.  This file is offered as-is,
+# without any warranty.
+
+import sys
+import re
+import time
+
+infname = sys.argv[1]
+inf = file(infname)
+
+print("""\
+<?xml version="1.0"?>
+<!-- Copyright (C) 2009-%s 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.  This file is offered as-is,
+     without any warranty. -->
+
+<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
+
+<!-- This file was generated using the following file:
+
+     %s
+
+     The file mentioned above belongs to the Linux Kernel.
+     Some small hand-edits were made. -->
+
+<syscalls_info>""" % (time.strftime("%Y"), infname))
+
+def record(name, number, comment=None):
+    #nm = 'name="%s"' % name
+    #s = '  <syscall %-30s number="%d"/>' % (nm, number)
+    s = '  <syscall name="%s" number="%d"/>' % (name, number)
+    if comment:
+        s += ' <!-- %s -->' % comment
+    print(s)
+
+for line in inf:
+    m = re.match(r'^#define __NR_(\w+)\s+\(__NR_SYSCALL_BASE\+\s*(\d+)\)',
+                 line)
+    if m:
+        record(m.group(1), int(m.group(2)))
+        continue
+
+    m = re.match(r'^\s+/\* (\d+) was sys_(\w+) \*/$', line)
+    if m:
+        record(m.group(2), int(m.group(1)), 'removed')
+
+    m = re.match(r'^#define __ARM_NR_(\w+)\s+\(__ARM_NR_BASE\+\s*(\d+)\)',
+                 line)
+    if m:
+        record('ARM_'+m.group(1), 0x0f0000+int(m.group(2)))
+        continue
+
+print('</syscalls_info>')
diff --git a/gdb/syscalls/arm-linux.xml b/gdb/syscalls/arm-linux.xml
new file mode 100644
index 0000000..b35125c
--- /dev/null
+++ b/gdb/syscalls/arm-linux.xml
@@ -0,0 +1,398 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2009-2013 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.  This file is offered as-is,
+     without any warranty. -->
+
+<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
+
+<!-- This file was generated using the following file:
+
+     linux/arch/arm/include/uapi/asm/unistd.h
+
+     The file mentioned above belongs to the Linux Kernel.
+     Some small hand-edits were made. -->
+
+<syscalls_info>
+  <syscall name="restart_syscall" number="0"/>
+  <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="waitpid" number="7"/> <!-- removed -->
+  <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="break" number="17"/> <!-- removed -->
+  <syscall name="oldstat" number="18"/> <!-- removed -->
+  <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="oldfstat" number="28"/> <!-- removed -->
+  <syscall name="pause" number="29"/>
+  <syscall name="utime" number="30"/>
+  <syscall name="stty" number="31"/> <!-- removed -->
+  <syscall name="gtty" number="32"/> <!-- removed -->
+  <syscall name="access" number="33"/>
+  <syscall name="nice" number="34"/>
+  <syscall name="ftime" number="35"/> <!-- removed -->
+  <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="prof" number="44"/> <!-- removed -->
+  <syscall name="brk" number="45"/>
+  <syscall name="setgid" number="46"/>
+  <syscall name="getgid" number="47"/>
+  <syscall name="signal" number="48"/> <!-- removed -->
+  <syscall name="geteuid" number="49"/>
+  <syscall name="getegid" number="50"/>
+  <syscall name="acct" number="51"/>
+  <syscall name="umount2" number="52"/>
+  <syscall name="lock" number="53"/> <!-- removed -->
+  <syscall name="ioctl" number="54"/>
+  <syscall name="fcntl" number="55"/>
+  <syscall name="mpx" number="56"/> <!-- removed -->
+  <syscall name="setpgid" number="57"/>
+  <syscall name="ulimit" number="58"/> <!-- removed -->
+  <syscall name="oldolduname" number="59"/> <!-- removed -->
+  <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="sgetmask" number="68"/> <!-- removed -->
+  <syscall name="ssetmask" number="69"/> <!-- removed -->
+  <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="select" number="82"/>
+  <syscall name="symlink" number="83"/>
+  <syscall name="oldlstat" number="84"/> <!-- removed -->
+  <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="profil" number="98"/> <!-- removed -->
+  <syscall name="statfs" number="99"/>
+  <syscall name="fstatfs" number="100"/>
+  <syscall name="ioperm" number="101"/> <!-- removed -->
+  <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="olduname" number="109"/> <!-- removed -->
+  <syscall name="iopl" number="110"/> <!-- removed -->
+  <syscall name="vhangup" number="111"/>
+  <syscall name="idle" number="112"/> <!-- removed -->
+  <syscall name="syscall" number="113"/>
+  <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="modify_ldt" number="123"/> <!-- removed -->
+  <syscall name="adjtimex" number="124"/>
+  <syscall name="mprotect" number="125"/>
+  <syscall name="sigprocmask" number="126"/>
+  <syscall name="create_module" number="127"/> <!-- removed -->
+  <syscall name="init_module" number="128"/>
+  <syscall name="delete_module" number="129"/>
+  <syscall name="get_kernel_syms" number="130"/> <!-- removed -->
+  <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"/> <!-- removed -->
+  <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="vm86" number="166"/> <!-- removed -->
+  <syscall name="query_module" number="167"/> <!-- removed -->
+  <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="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="getdents64" number="217"/>
+  <syscall name="pivot_root" number="218"/>
+  <syscall name="mincore" number="219"/>
+  <syscall name="madvise" number="220"/>
+  <syscall name="fcntl64" number="221"/>
+  <syscall name="gettid" number="224"/>
+  <syscall name="readahead" number="225"/>
+  <syscall name="setxattr" number="226"/>
+  <syscall name="lsetxattr" number="227"/>
+  <syscall name="fsetxattr" number="228"/>
+  <syscall name="getxattr" number="229"/>
+  <syscall name="lgetxattr" number="230"/>
+  <syscall name="fgetxattr" number="231"/>
+  <syscall name="listxattr" number="232"/>
+  <syscall name="llistxattr" number="233"/>
+  <syscall name="flistxattr" number="234"/>
+  <syscall name="removexattr" number="235"/>
+  <syscall name="lremovexattr" number="236"/>
+  <syscall name="fremovexattr" number="237"/>
+  <syscall name="tkill" number="238"/>
+  <syscall name="sendfile64" number="239"/>
+  <syscall name="futex" number="240"/>
+  <syscall name="sched_setaffinity" number="241"/>
+  <syscall name="sched_getaffinity" number="242"/>
+  <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="lookup_dcookie" number="249"/>
+  <syscall name="epoll_create" number="250"/>
+  <syscall name="epoll_ctl" number="251"/>
+  <syscall name="epoll_wait" number="252"/>
+  <syscall name="remap_file_pages" number="253"/>
+  <syscall name="set_tid_address" number="256"/>
+  <syscall name="timer_create" number="257"/>
+  <syscall name="timer_settime" number="258"/>
+  <syscall name="timer_gettime" number="259"/>
+  <syscall name="timer_getoverrun" number="260"/>
+  <syscall name="timer_delete" number="261"/>
+  <syscall name="clock_settime" number="262"/>
+  <syscall name="clock_gettime" number="263"/>
+  <syscall name="clock_getres" number="264"/>
+  <syscall name="clock_nanosleep" number="265"/>
+  <syscall name="statfs64" number="266"/>
+  <syscall name="fstatfs64" number="267"/>
+  <syscall name="tgkill" number="268"/>
+  <syscall name="utimes" number="269"/>
+  <syscall name="arm_fadvise64_64" number="270"/>
+  <syscall name="pciconfig_iobase" number="271"/>
+  <syscall name="pciconfig_read" number="272"/>
+  <syscall name="pciconfig_write" number="273"/>
+  <syscall name="mq_open" number="274"/>
+  <syscall name="mq_unlink" number="275"/>
+  <syscall name="mq_timedsend" number="276"/>
+  <syscall name="mq_timedreceive" number="277"/>
+  <syscall name="mq_notify" number="278"/>
+  <syscall name="mq_getsetattr" number="279"/>
+  <syscall name="waitid" number="280"/>
+  <syscall name="socket" number="281"/>
+  <syscall name="bind" number="282"/>
+  <syscall name="connect" number="283"/>
+  <syscall name="listen" number="284"/>
+  <syscall name="accept" number="285"/>
+  <syscall name="getsockname" number="286"/>
+  <syscall name="getpeername" number="287"/>
+  <syscall name="socketpair" number="288"/>
+  <syscall name="send" number="289"/>
+  <syscall name="sendto" number="290"/>
+  <syscall name="recv" number="291"/>
+  <syscall name="recvfrom" number="292"/>
+  <syscall name="shutdown" number="293"/>
+  <syscall name="setsockopt" number="294"/>
+  <syscall name="getsockopt" number="295"/>
+  <syscall name="sendmsg" number="296"/>
+  <syscall name="recvmsg" number="297"/>
+  <syscall name="semop" number="298"/>
+  <syscall name="semget" number="299"/>
+  <syscall name="semctl" number="300"/>
+  <syscall name="msgsnd" number="301"/>
+  <syscall name="msgrcv" number="302"/>
+  <syscall name="msgget" number="303"/>
+  <syscall name="msgctl" number="304"/>
+  <syscall name="shmat" number="305"/>
+  <syscall name="shmdt" number="306"/>
+  <syscall name="shmget" number="307"/>
+  <syscall name="shmctl" number="308"/>
+  <syscall name="add_key" number="309"/>
+  <syscall name="request_key" number="310"/>
+  <syscall name="keyctl" number="311"/>
+  <syscall name="semtimedop" number="312"/>
+  <syscall name="vserver" number="313"/>
+  <syscall name="ioprio_set" number="314"/>
+  <syscall name="ioprio_get" number="315"/>
+  <syscall name="inotify_init" number="316"/>
+  <syscall name="inotify_add_watch" number="317"/>
+  <syscall name="inotify_rm_watch" number="318"/>
+  <syscall name="mbind" number="319"/>
+  <syscall name="get_mempolicy" number="320"/>
+  <syscall name="set_mempolicy" number="321"/>
+  <syscall name="openat" number="322"/>
+  <syscall name="mkdirat" number="323"/>
+  <syscall name="mknodat" number="324"/>
+  <syscall name="fchownat" number="325"/>
+  <syscall name="futimesat" number="326"/>
+  <syscall name="fstatat64" number="327"/>
+  <syscall name="unlinkat" number="328"/>
+  <syscall name="renameat" number="329"/>
+  <syscall name="linkat" number="330"/>
+  <syscall name="symlinkat" number="331"/>
+  <syscall name="readlinkat" number="332"/>
+  <syscall name="fchmodat" number="333"/>
+  <syscall name="faccessat" number="334"/>
+  <syscall name="pselect6" number="335"/>
+  <syscall name="ppoll" number="336"/>
+  <syscall name="unshare" number="337"/>
+  <syscall name="set_robust_list" number="338"/>
+  <syscall name="get_robust_list" number="339"/>
+  <syscall name="splice" number="340"/>
+  <syscall name="arm_sync_file_range" number="341"/>
+  <syscall name="tee" number="342"/>
+  <syscall name="vmsplice" number="343"/>
+  <syscall name="move_pages" number="344"/>
+  <syscall name="getcpu" number="345"/>
+  <syscall name="epoll_pwait" number="346"/>
+  <syscall name="kexec_load" number="347"/>
+  <syscall name="utimensat" number="348"/>
+  <syscall name="signalfd" number="349"/>
+  <syscall name="timerfd_create" number="350"/>
+  <syscall name="eventfd" number="351"/>
+  <syscall name="fallocate" number="352"/>
+  <syscall name="timerfd_settime" number="353"/>
+  <syscall name="timerfd_gettime" number="354"/>
+  <syscall name="signalfd4" number="355"/>
+  <syscall name="eventfd2" number="356"/>
+  <syscall name="epoll_create1" number="357"/>
+  <syscall name="dup3" number="358"/>
+  <syscall name="pipe2" number="359"/>
+  <syscall name="inotify_init1" number="360"/>
+  <syscall name="preadv" number="361"/>
+  <syscall name="pwritev" number="362"/>
+  <syscall name="rt_tgsigqueueinfo" number="363"/>
+  <syscall name="perf_event_open" number="364"/>
+  <syscall name="recvmmsg" number="365"/>
+  <syscall name="accept4" number="366"/>
+  <syscall name="fanotify_init" number="367"/>
+  <syscall name="fanotify_mark" number="368"/>
+  <syscall name="prlimit64" number="369"/>
+  <syscall name="name_to_handle_at" number="370"/>
+  <syscall name="open_by_handle_at" number="371"/>
+  <syscall name="clock_adjtime" number="372"/>
+  <syscall name="syncfs" number="373"/>
+  <syscall name="sendmmsg" number="374"/>
+  <syscall name="setns" number="375"/>
+  <syscall name="process_vm_readv" number="376"/>
+  <syscall name="process_vm_writev" number="377"/>
+  <syscall name="kcmp" number="378"/>
+  <syscall name="finit_module" number="379"/>
+  <syscall name="ARM_breakpoint" number="983041"/>
+  <syscall name="ARM_cacheflush" number="983042"/>
+  <syscall name="ARM_usr26" number="983043"/>
+  <syscall name="ARM_usr32" number="983044"/>
+  <syscall name="ARM_set_tls" number="983045"/>
+</syscalls_info>
diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp
index 395fcd4..1066caf 100644
--- a/gdb/testsuite/gdb.base/catch-syscall.exp
+++ b/gdb/testsuite/gdb.base/catch-syscall.exp
@@ -34,7 +34,7 @@ if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then {
 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 "mips*-linux*"] && ![istarget "arm*-linux*"] } {
      continue
 }
 
@@ -407,11 +407,12 @@ proc do_syscall_tests_without_xml {} {
 proc fill_all_syscalls_numbers {} {
     global all_syscalls_numbers
 
-    # For Linux on x86, PPC, PPC64, SPARC and SPARC64, the numbers for the syscalls
-    # "close" and "chroot" are the same.
+    # For Linux on x86, PPC, PPC64, SPARC, SPARC64 and ARM,
+    # the numbers for the syscalls "close" and "chroot" are the same.
     if { [istarget "i\[34567\]86-*-linux*"]
          || [istarget "powerpc-*-linux*"] || [istarget "powerpc64-*-linux*"]
-         || [istarget "sparc-*-linux*"] || [istarget "sparc64-*-linux*"] } {
+         || [istarget "sparc-*-linux*"] || [istarget "sparc64-*-linux*"]
+         || [istarget "arm*-linux*"] } {
          set all_syscalls_numbers { "6" "61" }
     }
 }
-- 
1.8.4.rc3

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] ARM Linux support for `catch syscall'
@ 2013-08-16 18:19 Doug Evans
  2013-08-22 20:35 ` Sergio Durigan Junior
  0 siblings, 1 reply; 12+ messages in thread
From: Doug Evans @ 2013-08-16 18:19 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: Sergio Durigan Junior, gdb-patches

Hi.
Re: http://sourceware.org/ml/gdb-patches/2013-08/msg00408.html

Given that some of the generated output is copied from ppc-linux.xml,
I guess keeping 2009 is TRTTD.

Patch is ok by me.

Thanks!

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-08-22 20:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-31 21:04 [RFC][PATCH] Preliminary `catch syscall' support for ARM Linux Samuel Bronson
2013-08-02 16:56 ` Tom Tromey
     [not found] ` <E1V4dYl-0006Y8-79 at hydrogen>
2013-08-02 20:33   ` [PATCH] ARM Linux support for `catch syscall' Samuel Bronson
2013-08-05 17:47     ` Sergio Durigan Junior
2013-08-07 15:28       ` Doug Evans
     [not found]         ` <E1V9fPE-00060l-WC@hydrogen>
2013-08-14 19:29           ` [PATCH v2] " Sergio Durigan Junior
2013-08-16 18:50             ` Samuel Bronson
2013-08-15 20:05           ` Doug Evans
2013-08-15 20:08             ` Sergio Durigan Junior
2013-08-16 18:53             ` Samuel Bronson
2013-08-16 18:19 Doug Evans
2013-08-22 20:35 ` Sergio Durigan Junior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).