Go to file
H.J. Lu 35be58119e Add x32 support to strace
X32 support is added to Linux kernel 3.4. In a nutshell, x32 is x86-64 with
32bit pointers.  At system call level, x32 is also identical to x86-64,
as shown by many changes like "defined(X86_64) || defined(X32)".  The
main differerence bewteen x32 and x86-64 is off_t in x32 is long long
instead of long.

This patch adds x32 support to strace.  Tested on Linux/x32.

* configure.ac: Support X32.
* defs.h: Set SUPPORTED_PERSONALITIES to 3 for X86_64,
Set PERSONALITY2_WORDSIZE to 4 for X86_64.
Add tcb::ext_arg for X32.
* file.c (stat): New for X32.
(sys_lseek): Use 64-bit version for X32.
(printstat64): Check current_personality != 1 for X86_64.
* ipc.c (indirect_ipccall): Check current_personality == 1
for X86_64.
* mem.c (sys_mmap64): Also use tcp->u_arg for X32.  Print NULL
for zero address.  Call printllval for offset for X32.
* pathtrace.c (pathtrace_match): Don't check sys_old_mmap for
X32.
* process.c (ARG_FLAGS): Defined for X32.
(ARG_STACK): Likewise.
(ARG_PTID): Likewise.
(change_syscall): Handle X32.
(struct_user_offsets): Support X32.
(sys_arch_prctl): Likewise.
* signal.c: Include <asm/sigcontext.h> for X32.
(SA_RESTORER): Also define for X32.
* syscall.c (update_personality): Support X32 for X86_64.
(is_restart_error): Likewise.
(syscall_fixup_on_sysenter): Likewise.
(get_syscall_args): Likewise.
(get_syscall_result): Likewise.
(get_error): Likewise.
(__X32_SYSCALL_BIT): Define if not defined.
(__X32_SYSCALL_MASK): Likewise.
(get_scno): Check DS register value for X32.  Use
__X32_SYSCALL_MASK on X32 system calls.
* util.c (printllval): Use ext_arg for X32.
(printcall): Support X32.
(change_syscall): Likewise.
(arg0_offset): Likewise.
(arg1_offset): Likewise.
* Makefile.am (EXTRA_DIST): Add linux/x32/errnoent.h,
linux/x32/ioctlent.h.in, linux/x32/signalent.h,
linux/x32/syscallent.h, linux/x86_64/errnoent2.h,
linux/x86_64/ioctlent2.h, linux/x86_64/signalent2.h and
linux/x86_64/syscallent2.h.
* linux/x32/errnoent.h: New.
* linux/x32/ioctlent.h.in: Likewise.
* linux/x32/signalent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/errnoent2.h: Likewise.
* linux/x86_64/ioctlent2.h: Likewise.
* linux/x86_64/signalent2.h: Likewise.
* linux/x86_64/syscallent2.h: Likewise.

Signed-off-by: H.J. Lu <hongjiu.lu@intel.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-04-16 13:00:01 +02:00
debian Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
linux Add x32 support to strace 2012-04-16 13:00:01 +02:00
m4 Implement prlimit64 decoding, rewrite [gs]etrlimit decoding 2012-03-16 19:05:21 +00:00
qemu_multiarch_testing Slight tweak to qemu_multiarch_testing scripts 2012-03-21 11:32:55 +01:00
test test/threaded_execve: make it also test a case when leader is not in syscall 2012-03-17 01:24:25 +01:00
tests tests: robustify again buggy shells 2012-03-15 20:17:49 +00:00
.gitignore linux/ioctlent: unify them all 2011-03-14 15:32:38 +00:00
.mailmap Generate much of the CREDITS file from git log 2011-02-24 01:51:15 +00:00
AUTHORS 2002-12-22 Roland McGrath <roland@redhat.com> 2002-12-30 00:51:30 +00:00
bjm.c Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
block.c Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
ChangeLog-CVS Generate ChangeLog from git log 2009-07-08 21:01:21 +00:00
configure.ac Add x32 support to strace 2012-04-16 13:00:01 +02:00
COPYRIGHT Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
count.c Optimize code if we have only one personality 2012-03-19 09:36:42 +01:00
CREDITS.in * CREDITS.in: Fix typo. 2011-03-15 15:46:52 +00:00
defs.h Add x32 support to strace 2012-04-16 13:00:01 +02:00
desc.c Optimize code if we have only one personality 2012-03-19 09:36:42 +01:00
errnoent.sh Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
file.c Add x32 support to strace 2012-04-16 13:00:01 +02:00
git-set-file-times * git-set-file-times: Import from rsync. 2009-10-09 23:07:28 +00:00
gitlog-to-changelog gitlog-to-changelog: update from gnulib 2011-11-05 13:32:27 +00:00
HACKING-scripts HACKING-scripts: new doc file by Mike Frysinger 2009-02-23 07:56:01 +00:00
INSTALL Remove and update documentation 2012-02-25 15:29:21 +01:00
io.c Decode mtd ioctls 2012-04-06 14:39:15 +00:00
ioctl.c Decode mtd ioctls 2012-04-06 14:39:15 +00:00
ioctlsort.c Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
ipc.c Add x32 support to strace 2012-04-16 13:00:01 +02:00
make-dist Generate an xz tar archive of the distribution 2011-02-27 14:05:58 +00:00
Makefile.am Add x32 support to strace 2012-04-16 13:00:01 +02:00
mem.c Add x32 support to strace 2012-04-16 13:00:01 +02:00
mtd.c Decode mtd ioctls 2012-04-06 14:39:15 +00:00
net.c Reindent case labels. No code changes 2012-03-17 04:42:07 +01:00
NEWS Prepare for 4.6 release 2011-03-14 15:39:36 +00:00
pathtrace.c Add x32 support to strace 2012-04-16 13:00:01 +02:00
process.c Add x32 support to strace 2012-04-16 13:00:01 +02:00
quota.c Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
README Remove and update documentation 2012-02-25 15:29:21 +01:00
README-hacking Generate ChangeLog from git log 2009-07-08 21:01:21 +00:00
README-linux Cleanup trailing whitespaces and indentation that uses spaces before tabs 2009-07-08 14:57:27 +00:00
README-linux-ptrace README-linux-ptrace: correct the description of suppressed signals 2012-02-09 19:57:52 +01:00
resource.c Optimize code if we have only one personality 2012-03-19 09:36:42 +01:00
scsi.c Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
signal.c Add x32 support to strace 2012-04-16 13:00:01 +02:00
signalent.sh Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
sock.c Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
strace-graph Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
strace-log-merge strace-log-merge: fix file suffix calculation 2012-03-26 12:10:01 +00:00
strace.1 manpage: remove false info about -p being limited to 32 processes 2012-03-26 13:31:11 +02:00
strace.c Fix indefinite hang on no-mmu systems 2012-04-05 14:53:49 +00:00
strace.spec Remove and update documentation 2012-02-25 15:29:21 +01:00
stream.c Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
syscall.c Add x32 support to strace 2012-04-16 13:00:01 +02:00
syscallent.sh Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
system.c Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
term.c Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
time.c Optimize code if we have only one personality 2012-03-19 09:36:42 +01:00
util.c Add x32 support to strace 2012-04-16 13:00:01 +02:00
xlate.el Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00

This is strace, a system call tracer for Linux.

strace is released under a Berkeley-style license at the request
of Paul Kranenburg; see the file COPYRIGHT for details.

See the file CREDITS for a list of authors and other contributors.

See the file INSTALL for compilation and installation instructions.

See the file NEWS for information on what has changed in recent
versions.

You can get the latest version of strace from its homepage at
http://sourceforge.net/projects/strace/ .

Please send bug reports and enhancements to the strace
mailinglist at strace-devel@lists.sourceforge.net.