PATCH: Add ia32 support to x32 strace
Dmitry V. Levin
ldv at altlinux.org
Tue Apr 17 23:58:34 UTC 2012
On Tue, Apr 17, 2012 at 11:05:04AM -0700, H.J. Lu wrote:
> Hi,
>
> This patch adds ia32 support to x32 strace. Tested on Linux/x32.
[...]
> @@ -868,15 +874,14 @@ 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);
> + if (currpers == 0) {
> + fprintf(stderr, "syscall_%lu (...) in unsupported 64-bit "
> + "mode of process PID=%d\n", scno, tcp->pid);
> return 0;
> }
> -# else
> - update_personality(tcp, currpers);
> + else if (currpers == 1)
> # endif
> + update_personality(tcp, currpers);
> #elif defined(IA64)
> # define IA64_PSR_IS ((long)1 << 34)
> if (upeek(tcp, PT_CR_IPSR, &psr) >= 0)
This part of the change seems to be wrong: if strace supports two personalities
on X32, it should be able to switch to any of them, not just to
currpers == 1. Looks like additional currpers translation is needed for
the X32 case.
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20120418/54a64088/attachment.bin>
More information about the Strace-devel
mailing list