Bunch of stuff

This commit is contained in:
Wichert Akkerman 1999-12-23 14:20:14 +00:00
parent e5be0de044
commit 4dc8a2aec6
24 changed files with 359 additions and 142 deletions

View File

@ -37,3 +37,4 @@ porting to new systems:
John Hughes <john@Calva.COM>
Richard Braakman <dark@xs4all.nl>
Florian Lohoff <flo@rfc822.org>
D.J. Barrow <djbarrow@de.ibm.com>

View File

@ -1,7 +1,20 @@
Thu Dec 23 15:01:37 CET 1999 Wichert Akkerman <wakkerma@debian.org>
* Merge patch from ftp://oss.software.ibm.com/linux390/ to add
support for Linux on the IBM S/390 architecture
Mon Dec 20 00:27:50 CET 1999 Wichert Akkerman <wakkerma@debian.org>
* Rewrite mmap-handling to support mmap2 on Linux
Tue Dec 14 11:35:16 CET 1999 Wichert Akkerman <wakkerma@debian.org>
* Note that Linux can handle sys_semop() as well
Tue Nov 30 11:05:26 CET 1999 Wichert Akkerman <wakkerma@debian.org>
* Include linux/in6.h for glibc2.0 and older
Mon Nov 29 16:33:04 CET 1999 Wichert Akkerman <wakkerma@debian.org>
* Merge patches from John Hughes to make configure support UnixWare

6
NEWS
View File

@ -1,3 +1,9 @@
Changes in 4.2
==============
* Compiles on glibc2.0 systems again
* Linux/S390 port added
* The usual Linux syscall updates
Changes in 4.1
================
* Linux/MIPS port added

31
bjm.c
View File

@ -1,3 +1,34 @@
/*
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/
#include "defs.h"
#if defined(LINUX)

7
config.sub vendored
View File

@ -155,7 +155,7 @@ case $basic_machine in
| alpha | alphaev5 | alphaev56 | alphapca56 | we32k | ns16k | clipper \
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
| mipstx39 | mipstx39el \
| mipstx39 | mipstx39el | s390 \
| sparc | sparclet | sparclite | sparc64 | v850)
basic_machine=$basic_machine-unknown
;;
@ -182,7 +182,7 @@ case $basic_machine in
| sparc64-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| mipstx39-* | mipstx39el-* \
| f301-*)
| f301-* | s390-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@ -511,6 +511,9 @@ case $basic_machine in
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
s390)
basic_machine=s390-ibm
;;
sequent)
basic_machine=i386-sequent
;;

View File

@ -56,6 +56,9 @@ ppc|powerpc)
arm)
arch=arm
;;
s390)
arch=s390
;;
*)
AC_MSG_ERROR(this architecture is not yet supported by strace)
;;

1
desc.c
View File

@ -2,6 +2,7 @@
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

1
file.c
View File

@ -2,6 +2,7 @@
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

1
io.c
View File

@ -2,6 +2,7 @@
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -2,6 +2,7 @@
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

1
ipc.c
View File

@ -2,6 +2,7 @@
* Copyright (c) 1993 Ulrich Pegelow <pegelow@moorea.uni-muenster.de>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -81,7 +81,7 @@ int sys_getresuid(), sys_getresgid(), sys_pread(), sys_pwrite(), sys_getcwd();
int sys_sigaltstack(), sys_rt_sigprocmask(), sys_rt_sigaction();
int sys_rt_sigpending(), sys_rt_sigsuspend(), sys_rt_sigqueueinfo();
int sys_rt_sigtimedwait(), sys_prctl(), sys_poll(), sys_vfork();
int sys_sendfile();
int sys_sendfile(), sys_old_mmap();
/* sys_socketcall subcalls */

View File

@ -122,7 +122,7 @@
{ 1, TF, sys_swapon, "swapon" }, /* 87 */
{ 3, 0, sys_reboot, "reboot" }, /* 88 */
{ 3, 0, sys_readdir, "readdir" }, /* 89 */
{ 6, 0, sys_mmap, "mmap" }, /* 90 */
{ 6, 0, sys_old_mmap, "old_mmap" }, /* 90 */
{ 2, 0, sys_munmap, "munmap" }, /* 91 */
{ 2, TF, sys_truncate, "truncate" }, /* 92 */
{ 2, 0, sys_ftruncate, "ftruncate" }, /* 93 */
@ -236,10 +236,10 @@
{ 5, 0, printargs, "SYS_188" }, /* 188 */
{ 5, 0, printargs, "SYS_189" }, /* 189 */
{ 0, TP, sys_vfork, "vfork" }, /* 190 */
{ 5, 0, printargs, "SYS_191" }, /* 191 */
{ 5, 0, printargs, "SYS_192" }, /* 192 */
{ 5, 0, printargs, "SYS_193" }, /* 193 */
{ 5, 0, printargs, "SYS_194" }, /* 194 */
{ 5, 0, printargs, "getrlimit" }, /* 191 */
{ 6, 0, sys_mmap, "mmap2" }, /* 192 */
{ 5, 0, printargs, "truncate64" }, /* 193 */
{ 5, 0, printargs, "ftruncate64" }, /* 194 */
{ 5, 0, printargs, "SYS_195" }, /* 195 */
{ 5, 0, printargs, "SYS_196" }, /* 196 */
{ 5, 0, printargs, "SYS_197" }, /* 197 */

41
mem.c
View File

@ -2,6 +2,7 @@
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -136,27 +137,13 @@ static struct xlat mmap_flags[] = {
{ 0, NULL },
};
static
int
sys_mmap(tcp)
print_mmap(tcp,u_arg)
struct tcb *tcp;
long *u_arg;
{
#ifdef LINUX
# if defined(ALPHA) || defined(sparc) || defined(POWERPC) || defined(MIPS)
long *u_arg = tcp->u_arg;
# else /* !ALPHA */
long u_arg[6];
# endif /* !ALPHA */
#else /* !LINUX */
long *u_arg = tcp->u_arg;
#endif /* !LINUX */
if (entering(tcp)) {
#if defined(LINUX) && !defined(ALPHA) && !defined(sparc) && !defined(POWERPC) && !defined(MIPS)
if (umoven(tcp, tcp->u_arg[0], sizeof u_arg,
(char *) u_arg) == -1)
return 0;
#endif /* LINUX && !ALPHA && !sparc && !POWERPC */
/* addr */
if (!u_arg[0])
tprintf("NULL, ");
@ -178,6 +165,26 @@ struct tcb *tcp;
return RVAL_HEX;
}
#ifdef LINUX
int sys_old_mmap(tcp)
struct tcb *tcp;
{
long u_arg[6];
if (umoven(tcp, tcp->u_arg[0], sizeof u_arg, (char *) u_arg) == -1)
return 0;
return print_mmap(tcp, u_arg);
}
#endif
int
sys_mmap(tcp)
struct tcb *tcp;
{
return print_mmap(tcp, tcp->u_arg);
}
int
sys_munmap(tcp)
struct tcb *tcp;

3
net.c
View File

@ -2,6 +2,7 @@
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -45,7 +46,7 @@
#endif
#endif /* LINUX */
#if defined(LINUX) && defined(MIPS)
#if defined (__GLIBC__) && ((__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1))
#if defined(HAVE_LINUX_IN6_H)
#include <linux/in6.h>
#endif

297
process.c
View File

@ -2,6 +2,11 @@
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Linux for s390 port by D.J. Barrow
* <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -166,7 +171,7 @@ struct tcb *tcp;
#ifdef PR_GET_PDEATHSIG
case PR_GET_PDEATHSIG:
for (i=1; i<tcp->u_nargs; i++)
tprintf(", %@lx", tcp->u_arg[i]);
tprintf(", %#lx", tcp->u_arg[i]);
break;
#endif
default:
@ -1421,116 +1426,189 @@ static
#endif /* !SUNOS4_KERNEL_ARCH_KLUDGE */
struct xlat struct_user_offsets[] = {
#ifdef LINUX
#ifdef SPARC
#ifdef S390
{ PT_PSWMASK, "psw_mask" },
{ PT_PSWADDR, "psw_addr" },
{ PT_GPR0, "gpr0" },
{ PT_GPR1, "gpr1" },
{ PT_GPR2, "gpr2" },
{ PT_GPR3, "gpr3" },
{ PT_GPR4, "gpr4" },
{ PT_GPR5, "gpr5" },
{ PT_GPR6, "gpr6" },
{ PT_GPR7, "gpr7" },
{ PT_GPR8, "gpr8" },
{ PT_GPR9, "gpr9" },
{ PT_GPR10, "gpr10" },
{ PT_GPR11, "gpr11" },
{ PT_GPR12, "gpr12" },
{ PT_GPR13, "gpr13" },
{ PT_GPR14, "gpr14" },
{ PT_GPR15, "gpr15" },
{ PT_ACR0, "acr0" },
{ PT_ACR1, "acr1" },
{ PT_ACR2, "acr2" },
{ PT_ACR3, "acr3" },
{ PT_ACR4, "acr4" },
{ PT_ACR5, "acr5" },
{ PT_ACR6, "acr6" },
{ PT_ACR7, "acr7" },
{ PT_ACR8, "acr8" },
{ PT_ACR9, "acr9" },
{ PT_ACR10, "acr10" },
{ PT_ACR11, "acr11" },
{ PT_ACR12, "acr12" },
{ PT_ACR13, "acr13" },
{ PT_ACR14, "acr14" },
{ PT_ACR15, "acr15" },
{ PT_ORIGGPR2, "orig_gpr2" },
{ PT_FPC, "fpc" },
{ PT_FPR0_HI, "fpr0.hi" },
{ PT_FPR0_LO, "fpr0.lo" },
{ PT_FPR1_HI, "fpr1.hi" },
{ PT_FPR1_LO, "fpr1.lo" },
{ PT_FPR2_HI, "fpr2.hi" },
{ PT_FPR2_LO, "fpr2.lo" },
{ PT_FPR3_HI, "fpr3.hi" },
{ PT_FPR3_LO, "fpr3.lo" },
{ PT_FPR4_HI, "fpr4.hi" },
{ PT_FPR4_LO, "fpr4.lo" },
{ PT_FPR5_HI, "fpr5.hi" },
{ PT_FPR5_LO, "fpr5.lo" },
{ PT_FPR6_HI, "fpr6.hi" },
{ PT_FPR6_LO, "fpr6.lo" },
{ PT_FPR7_HI, "fpr7.hi" },
{ PT_FPR7_LO, "fpr7.lo" },
{ PT_FPR8_HI, "fpr8.hi" },
{ PT_FPR8_LO, "fpr8.lo" },
{ PT_FPR9_HI, "fpr9.hi" },
{ PT_FPR9_LO, "fpr9.lo" },
{ PT_FPR10_HI, "fpr10.hi" },
{ PT_FPR10_LO, "fpr10.lo" },
{ PT_FPR11_HI, "fpr11.hi" },
{ PT_FPR11_LO, "fpr11.lo" },
{ PT_FPR12_HI, "fpr12.hi" },
{ PT_FPR12_LO, "fpr12.lo" },
{ PT_FPR13_HI, "fpr13.hi" },
{ PT_FPR13_LO, "fpr13.lo" },
{ PT_FPR14_HI, "fpr14.hi" },
{ PT_FPR14_LO, "fpr14.lo" },
{ PT_FPR15_HI, "fpr15.hi" },
{ PT_FPR15_LO, "fpr15.lo" },
{ PT_CR_9, "cr9" },
{ PT_CR_10, "cr10" },
{ PT_CR_11, "cr11" },
#endif
#if defined(SPARC)
/* XXX No support for these offsets yet. */
#elif defined(POWERPC)
{ 4*PT_R0, "4*PT_R0" },
{ 4*PT_R1, "4*PT_R1" },
{ 4*PT_R2, "4*PT_R2" },
{ 4*PT_R3, "4*PT_R3" },
{ 4*PT_R4, "4*PT_R4" },
{ 4*PT_R5, "4*PT_R5" },
{ 4*PT_R6, "4*PT_R6" },
{ 4*PT_R7, "4*PT_R7" },
{ 4*PT_R8, "4*PT_R8" },
{ 4*PT_R9, "4*PT_R9" },
{ 4*PT_R10, "4*PT_R10" },
{ 4*PT_R11, "4*PT_R11" },
{ 4*PT_R12, "4*PT_R12" },
{ 4*PT_R13, "4*PT_R13" },
{ 4*PT_R14, "4*PT_R14" },
{ 4*PT_R15, "4*PT_R15" },
{ 4*PT_R16, "4*PT_R16" },
{ 4*PT_R17, "4*PT_R17" },
{ 4*PT_R18, "4*PT_R18" },
{ 4*PT_R19, "4*PT_R19" },
{ 4*PT_R20, "4*PT_R20" },
{ 4*PT_R21, "4*PT_R21" },
{ 4*PT_R22, "4*PT_R22" },
{ 4*PT_R23, "4*PT_R23" },
{ 4*PT_R24, "4*PT_R24" },
{ 4*PT_R25, "4*PT_R25" },
{ 4*PT_R26, "4*PT_R26" },
{ 4*PT_R27, "4*PT_R27" },
{ 4*PT_R28, "4*PT_R28" },
{ 4*PT_R29, "4*PT_R29" },
{ 4*PT_R30, "4*PT_R30" },
{ 4*PT_R31, "4*PT_R31" },
{ 4*PT_NIP, "4*PT_NIP" },
{ 4*PT_MSR, "4*PT_MSR" },
{ 4*PT_ORIG_R3, "4*PT_ORIG_R3" },
{ 4*PT_CTR, "4*PT_CTR" },
{ 4*PT_LNK, "4*PT_LNK" },
{ 4*PT_XER, "4*PT_XER" },
{ 4*PT_CCR, "4*PT_CCR" },
{ 4*PT_FPR0, "4*PT_FPR0" },
{ 4*PT_R0, "4*PT_R0" },
{ 4*PT_R1, "4*PT_R1" },
{ 4*PT_R2, "4*PT_R2" },
{ 4*PT_R3, "4*PT_R3" },
{ 4*PT_R4, "4*PT_R4" },
{ 4*PT_R5, "4*PT_R5" },
{ 4*PT_R6, "4*PT_R6" },
{ 4*PT_R7, "4*PT_R7" },
{ 4*PT_R8, "4*PT_R8" },
{ 4*PT_R9, "4*PT_R9" },
{ 4*PT_R10, "4*PT_R10" },
{ 4*PT_R11, "4*PT_R11" },
{ 4*PT_R12, "4*PT_R12" },
{ 4*PT_R13, "4*PT_R13" },
{ 4*PT_R14, "4*PT_R14" },
{ 4*PT_R15, "4*PT_R15" },
{ 4*PT_R16, "4*PT_R16" },
{ 4*PT_R17, "4*PT_R17" },
{ 4*PT_R18, "4*PT_R18" },
{ 4*PT_R19, "4*PT_R19" },
{ 4*PT_R20, "4*PT_R20" },
{ 4*PT_R21, "4*PT_R21" },
{ 4*PT_R22, "4*PT_R22" },
{ 4*PT_R23, "4*PT_R23" },
{ 4*PT_R24, "4*PT_R24" },
{ 4*PT_R25, "4*PT_R25" },
{ 4*PT_R26, "4*PT_R26" },
{ 4*PT_R27, "4*PT_R27" },
{ 4*PT_R28, "4*PT_R28" },
{ 4*PT_R29, "4*PT_R29" },
{ 4*PT_R30, "4*PT_R30" },
{ 4*PT_R31, "4*PT_R31" },
{ 4*PT_NIP, "4*PT_NIP" },
{ 4*PT_MSR, "4*PT_MSR" },
{ 4*PT_ORIG_R3, "4*PT_ORIG_R3" },
{ 4*PT_CTR, "4*PT_CTR" },
{ 4*PT_LNK, "4*PT_LNK" },
{ 4*PT_XER, "4*PT_XER" },
{ 4*PT_CCR, "4*PT_CCR" },
{ 4*PT_FPR0, "4*PT_FPR0" },
#else
#ifdef ALPHA
{ 0, "r0" },
{ 1, "r1" },
{ 2, "r2" },
{ 3, "r3" },
{ 4, "r4" },
{ 5, "r5" },
{ 6, "r6" },
{ 7, "r7" },
{ 8, "r8" },
{ 9, "r9" },
{ 10, "r10" },
{ 11, "r11" },
{ 12, "r12" },
{ 13, "r13" },
{ 14, "r14" },
{ 15, "r15" },
{ 16, "r16" },
{ 17, "r17" },
{ 18, "r18" },
{ 19, "r19" },
{ 20, "r20" },
{ 21, "r21" },
{ 22, "r22" },
{ 23, "r23" },
{ 24, "r24" },
{ 25, "r25" },
{ 26, "r26" },
{ 27, "r27" },
{ 28, "r28" },
{ 29, "gp" },
{ 30, "fp" },
{ 31, "zero" },
{ 32, "fp0" },
{ 33, "fp" },
{ 34, "fp2" },
{ 35, "fp3" },
{ 36, "fp4" },
{ 37, "fp5" },
{ 38, "fp6" },
{ 39, "fp7" },
{ 40, "fp8" },
{ 41, "fp9" },
{ 42, "fp10" },
{ 43, "fp11" },
{ 44, "fp12" },
{ 45, "fp13" },
{ 46, "fp14" },
{ 47, "fp15" },
{ 48, "fp16" },
{ 49, "fp17" },
{ 50, "fp18" },
{ 51, "fp19" },
{ 52, "fp20" },
{ 53, "fp21" },
{ 54, "fp22" },
{ 55, "fp23" },
{ 56, "fp24" },
{ 57, "fp25" },
{ 58, "fp26" },
{ 59, "fp27" },
{ 60, "fp28" },
{ 61, "fp29" },
{ 62, "fp30" },
{ 63, "fp31" },
{ 64, "pc" },
{ 0, "r0" },
{ 1, "r1" },
{ 2, "r2" },
{ 3, "r3" },
{ 4, "r4" },
{ 5, "r5" },
{ 6, "r6" },
{ 7, "r7" },
{ 8, "r8" },
{ 9, "r9" },
{ 10, "r10" },
{ 11, "r11" },
{ 12, "r12" },
{ 13, "r13" },
{ 14, "r14" },
{ 15, "r15" },
{ 16, "r16" },
{ 17, "r17" },
{ 18, "r18" },
{ 19, "r19" },
{ 20, "r20" },
{ 21, "r21" },
{ 22, "r22" },
{ 23, "r23" },
{ 24, "r24" },
{ 25, "r25" },
{ 26, "r26" },
{ 27, "r27" },
{ 28, "r28" },
{ 29, "gp" },
{ 30, "fp" },
{ 31, "zero" },
{ 32, "fp0" },
{ 33, "fp" },
{ 34, "fp2" },
{ 35, "fp3" },
{ 36, "fp4" },
{ 37, "fp5" },
{ 38, "fp6" },
{ 39, "fp7" },
{ 40, "fp8" },
{ 41, "fp9" },
{ 42, "fp10" },
{ 43, "fp11" },
{ 44, "fp12" },
{ 45, "fp13" },
{ 46, "fp14" },
{ 47, "fp15" },
{ 48, "fp16" },
{ 49, "fp17" },
{ 50, "fp18" },
{ 51, "fp19" },
{ 52, "fp20" },
{ 53, "fp21" },
{ 54, "fp22" },
{ 55, "fp23" },
{ 56, "fp24" },
{ 57, "fp25" },
{ 58, "fp26" },
{ 59, "fp27" },
{ 60, "fp28" },
{ 61, "fp29" },
{ 62, "fp30" },
{ 63, "fp31" },
{ 64, "pc" },
#else /* !ALPHA */
#ifdef I386
{ 4*EBX, "4*EBX" },
@ -1573,6 +1651,9 @@ struct xlat struct_user_offsets[] = {
{ 4*PT_PC, "4*PT_PC" },
#endif /* M68K */
#endif /* !I386 */
#ifdef S390
{ uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" },
#endif
#ifndef MIPS
{ uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" },
#endif
@ -1593,7 +1674,7 @@ struct xlat struct_user_offsets[] = {
{ uoff(reserved), "offsetof(struct user, reserved)" },
#endif
{ uoff(u_ar0), "offsetof(struct user, u_ar0)" },
#if !defined(ARM) && !defined(MIPS)
#if !defined(ARM) && !defined(MIPS) && !defined(S390)
{ uoff(u_fpstate), "offsetof(struct user, u_fpstate)" },
#endif
{ uoff(magic), "offsetof(struct user, magic)" },

View File

@ -2,6 +2,7 @@
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -2,6 +2,10 @@
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Linux for s390 port by D.J. Barrow
* <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -692,6 +696,27 @@ int
sys_sigreturn(tcp)
struct tcb *tcp;
{
#ifdef S390
long usp;
struct sigcontext_struct sc;
if (entering(tcp)) {
tcp->u_arg[0] = 0;
if (upeek(tcp->pid,PT_GPR15,&usp)<0)
return 0;
if (umove(tcp, usp+__SIGNAL_FRAMESIZE, &sc) < 0)
return 0;
tcp->u_arg[0] = 1;
memcpy(&tcp->u_arg[1],&sc.oldmask[0],sizeof(sigset_t));
} else {
tcp->u_rval = tcp->u_error = 0;
if (tcp->u_arg[0] == 0)
return 0;
tcp->auxstr = sprintsigmask("mask now ",(sigset_t *)&tcp->u_arg[1]);
return RVAL_NONE | RVAL_STR;
}
return 0;
#else
#ifdef I386
long esp;
struct sigcontext_struct sc;
@ -843,6 +868,7 @@ struct tcb *tcp;
#endif /* !M68K */
#endif /* !POWERPC */
#endif /* !I386 */
#endif /* S390 */
}
int

View File

@ -306,7 +306,7 @@ Print all non-ASCII strings in hexadecimal string format.
Print all strings in hexadecimal string format.
.TP
.BI "\-a " column
Align return values in a secific column (default column 40).
Align return values in a specific column (default column 40).
.TP
.BI "\-e " expr
A qualifying expression which modifies which events to trace

View File

@ -2,6 +2,7 @@
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -2,6 +2,10 @@
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Linux for s390 port by D.J. Barrow
* <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -590,6 +594,9 @@ struct tcb *tcp;
#elif defined (SPARC)
struct regs regs;
unsigned long trap;
#elif defined(S390)
long gpr2;
long pc;
#endif
#endif /* LINUX */
@ -601,7 +608,14 @@ struct tcb *tcp;
if (dtime && (tcp->flags & TCB_INSYSCALL))
gettimeofday(&tv, NULL);
#ifdef LINUX
#if defined (POWERPC)
#if defined(S390)
if (upeek(tcp->pid,PT_PSWADDR,&pc) < 0)
return -1;
scno = ptrace(PTRACE_PEEKTEXT, tcp->pid, (char *)(pc-4),0);
if (errno)
return -1;
scno&=0xFF;
#elif defined (POWERPC)
if (upeek(pid, 4*PT_R0, &scno) < 0)
return -1;
if (!(tcp->flags & TCB_INSYSCALL)) {
@ -1086,7 +1100,16 @@ struct tcb *tcp;
/* Entering system call */
tcp->scno = scno;
#ifdef LINUX
#if defined (ALPHA)
#if defined(S390)
{
int i;
tcp->u_nargs = sysent[tcp->scno].nargs;
for (i = 0; i < tcp->u_nargs; i++) {
if (upeek(pid,i==0 ? PT_ORIGGPR2:PT_GPR2+(i<<2), &tcp->u_arg[i]) < 0)
return -1;
}
}
#elif defined (ALPHA)
{
int i;
tcp->u_nargs = sysent[tcp->scno].nargs;

View File

@ -2,6 +2,7 @@
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

23
util.c
View File

@ -2,6 +2,10 @@
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Linux for s390 port by D.J. Barrow
* <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -891,7 +895,11 @@ struct tcb *tcp;
if (ptrace(PTRACE_GETREGS,tcp->pid,(char *)&regs,0) < 0)
return -1;
pc = regs.r_pc;
#endif
#elif defined(S390)
if(upeek(tcp->pid,PT_PSWADDR,&pc) < 0)
return -1;
#else
return pc;
#endif /* LINUX */
@ -1045,13 +1053,15 @@ struct tcb *tcp;
#elif defined (M68K)
#define LOOP 0x60fe0000
#elif defined (ALPHA)
#define LOOP 0xc3ffffff
#define LOOP 0xc3ffffff
#elif defined (POWERPC)
#define LOOP 0x0000feeb
#define LOOP 0x0000feeb
#elif defined(ARM)
#define LOOP -1 /* almost certainly wrong, jws */
#define LOOP -1 /* almost certainly wrong, jws */
#elif defined(MIPS)
#define LOOP 0x1000ffff
#define LOOP 0x1000ffff
#elif defined(S390)
#define LOOP 0xa7f40000 /* BRC 15,0 */
#else
#error unknown architecture
#endif
@ -1075,6 +1085,9 @@ struct tcb *tcp;
#elif defined (POWERPC)
if (upeek(tcp->pid, 4*PT_NIP, &tcp->baddr) < 0)
return -1;
#elif defined(S390)
if (upeek(tcp->pid,PT_PSWADDR, &tcp->baddr) < 0)
return -1;
#else
#error unknown architecture
#endif