]> granicus.if.org Git - strace/commitdiff
2003-02-26 Stuart Menefy <stuart.menefy@st.com>
authorRoland McGrath <roland@redhat.com>
Mon, 31 Mar 2003 01:03:33 +0000 (01:03 +0000)
committerRoland McGrath <roland@redhat.com>
Mon, 31 Mar 2003 01:03:33 +0000 (01:03 +0000)
Various fixes for SuperH [SH]:
* mem.c(sys_old_mmap): mmap() parameters passed in registers
* net.c(sys_pipe), syscall.c(getrval2): pipe() results returned
in registers
* process.c (change_syscall): Fixed register which holds system
call number
* util.c (arg0_offset, arg1_offset): provide definition
* Makefile.am: Added new files in linux/sh
* linux/sh/{syscallent,errnoent,ioctlent,signalent}.h: New files

Makefile.am
process.c
util.c

index 1272c7c164b99d3bdcc5a5790172cd0036bb7981..5e5f4ae703c37858bc469e36fc340b2d921e5414 100644 (file)
@@ -42,6 +42,8 @@ EXTRA_DIST = $(man_MANS) errnoent.sh signalent.sh syscallent.sh ioctlsort.c \
             linux/s390/signalent.h linux/s390/syscallent.h \
             linux/s390x/errnoent.h linux/s390x/ioctlent.h \
             linux/s390x/signalent.h linux/s390x/syscallent.h \
+            linux/sh/syscallent.h linux/sh/errnoent.h \
+            linux/sh/ioctlent.h linux/sh/signalent.h \
             linux/sparc/dummy2.h \
             linux/sparc/errnoent.h linux/sparc/errnoent1.h \
             linux/sparc/ioctlent.h linux/sparc/ioctlent1.h \
index 1b69d214e51759664e65cc14b54d4d1cc53970de..aeb3377c4adcafa20c3b9d2c197f84e2ea87cabe 100644 (file)
--- a/process.c
+++ b/process.c
@@ -658,7 +658,7 @@ int new;
                return -1;
        return 0;
 #elif defined(SH)
-       if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_SYSCALL), new)<0)
+       if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*(REG_REG0+3)), new)<0)
                return -1;
        return 0;
 #else
diff --git a/util.c b/util.c
index 8343e2425df70ebf0f8eec0bed7449fc14fbfc9d..a3cde446cd025d2ffd4095c647789308c4259da0 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1223,10 +1223,13 @@ typedef struct regs arg_setup_state;
 # elif defined (X86_64)
 #  define arg0_offset  ((long)(8*(current_personality ? RBX : RDI)))
 #  define arg1_offset  ((long)(8*(current_personality ? RCX : RSI)))
+# elif defined (SH)
+#  define arg0_offset  (4*(REG_REG0+4))
+#  define arg1_offset  (4*(REG_REG0+5))
 # else
 #  define arg0_offset  0
 #  define arg1_offset  4
-#  if defined SH || defined ARM
+#  if defined ARM
 #   define restore_arg0(tcp, state, val) 0
 #  endif
 # endif