diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2012-04-17 11:05:04 -0700 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2012-04-18 15:02:40 +0000 |
commit | 085e42886052190d3e515ca865546b527f59cdd1 (patch) | |
tree | f09fae3b106d16477db384dccf3b0e430e7dd52e /syscall.c | |
parent | 2bb4581ee501f6803df258ebb74c63a18a48422b (diff) | |
download | strace-085e42886052190d3e515ca865546b527f59cdd1.tar.gz strace-085e42886052190d3e515ca865546b527f59cdd1.tar.bz2 strace-085e42886052190d3e515ca865546b527f59cdd1.tar.xz |
x32: add ia32 support
* Makefile.am (EXTRA_DIST): Add linux/x32/errnoent1.h,
linux/x32/ioctlent1.h, linux/x32/signalent1.h and
linux/x32/syscallent1.h.
* configure.ac: Remove AC_GNU_SOURCE, obsoleted by
AC_USE_SYSTEM_EXTENSIONS.
* defs.h (SUPPORTED_PERSONALITIES): Set to 2 for X32.
(PERSONALITY1_WORDSIZE): Set to 4 for X32.
* file.c (stat64): New struct for X32.
(sys_lseek32): New function for X32.
(stat64): Undef.
(sys_fstat64): Likewise.
(sys_stat64): Likewise.
(realprintstat64): New function for X32.
(sys_fstat64): Likewise.
(sys_stat64): Likewise.
* mem.c (sys_old_mmap): New function for X32.
* pathtrace.c (pathtrace_match): Also check sys_old_mmap for X32.
* syscall.c (update_personality): Add X32 support.
(get_scno): Support currpers == 1 for X32.
* linux/syscall.h (sys_lseek32): New function prototype for X32.
* linux/x32/errnoent1.h: New file.
* linux/x32/ioctlent1.h: Likewise.
* linux/x32/signalent1.h: Likewise.
* linux/x32/syscallent1.h: Likewise.
Diffstat (limited to 'syscall.c')
-rw-r--r-- | syscall.c | 30 |
1 files changed, 23 insertions, 7 deletions
@@ -273,6 +273,12 @@ update_personality(struct tcb *tcp, int personality) fprintf(stderr, "[ Process PID=%d runs in %s mode. ]\n", tcp->pid, names[personality]); } +# elif defined(X32) + if (!qflag) { + static const char *const names[] = {"x32", "32 bit"}; + fprintf(stderr, "[ Process PID=%d runs in %s mode. ]\n", + tcp->pid, names[personality]); + } # endif } #endif @@ -868,15 +874,25 @@ get_scno(struct tcb *tcp) } # endif # ifdef X32 - if (currpers == 0 || currpers == 1) { - fprintf(stderr, "syscall_%lu (...) in unsupported %s " - "mode of process PID=%d\n", scno, - currpers == 0 ? "64-bit" : "32-bit", tcp->pid); - return 0; + /* Value of currpers: + * 0: 64 bit + * 1: 32 bit + * 2: X32 + * Value of current_personality: + * 0: X32 + * 1: 32 bit + */ + switch (currpers) { + case 0: + fprintf(stderr, "syscall_%lu (...) in unsupported " + "64-bit mode of process PID=%d\n", + scno, tcp->pid); + return 0; + case 2: + currpers = 0; } -# else - update_personality(tcp, currpers); # endif + update_personality(tcp, currpers); #elif defined(IA64) # define IA64_PSR_IS ((long)1 << 34) if (upeek(tcp, PT_CR_IPSR, &psr) >= 0) |