From: Dmitry V. Levin Date: Wed, 13 Dec 2006 17:45:02 +0000 (+0000) Subject: 2006-12-10 Dmitry V. Levin X-Git-Tag: v4.5.18~254 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d3cb392f8520cb1a6a3d6c93febe2a2424560574;p=strace 2006-12-10 Dmitry V. Levin Add biarch support for "struct sigevent". * time.c [LINUX && SUPPORTED_PERSONALITIES > 1] (printsigevent32): New function. [LINUX] (printsigevent): [SUPPORTED_PERSONALITIES > 1] Handle 32-bit personality. --- diff --git a/ChangeLog b/ChangeLog index 11a03af7..f5424f9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2006-12-10 Dmitry V. Levin + Add biarch support for "struct sigevent". + * time.c [LINUX && SUPPORTED_PERSONALITIES > 1] (printsigevent32): + New function. + [LINUX] (printsigevent): [SUPPORTED_PERSONALITIES > 1] + Handle 32-bit personality. + Add biarch support for "struct timex". * time.c [LINUX && SUPPORTED_PERSONALITIES > 1] (tprint_timex32): New function. diff --git a/time.c b/time.c index 375c20c9..b366104c 100644 --- a/time.c +++ b/time.c @@ -645,12 +645,62 @@ static const struct xlat sigev_value[] = { { 0, NULL } }; +#if SUPPORTED_PERSONALITIES > 1 +static void +printsigevent32(struct tcb *tcp, long arg) +{ + struct + { + int sigev_value; + int sigev_signo; + int sigev_notify; + + union + { + int tid; + struct + { + int function, attribute; + } thread; + } un; + } sev; + + if (umove(tcp, arg, &sev) < 0) + tprintf("{...}"); + else + { + tprintf("{%#x, ", sev.sigev_value); + if (sev.sigev_notify == SIGEV_SIGNAL) + tprintf("%s, ", signame(sev.sigev_signo)); + else + tprintf("%u, ", sev.sigev_signo); + printxval(sigev_value, sev.sigev_notify + 1, "SIGEV_???"); + tprintf(", "); + if (sev.sigev_notify == SIGEV_THREAD_ID) + tprintf("{%d}", sev.un.tid); + else if (sev.sigev_notify == SIGEV_THREAD) + tprintf("{%#x, %#x}", + sev.un.thread.function, + sev.un.thread.attribute); + else + tprintf("{...}"); + tprintf("}"); + } +} +#endif + void -printsigevent(tcp, arg) -struct tcb *tcp; -long arg; +printsigevent(struct tcb *tcp, long arg) { struct sigevent sev; + +#if SUPPORTED_PERSONALITIES > 1 + if (personality_wordsize[current_personality] == 4) + { + printsigevent32(tcp, arg); + return; + } +#endif if (umove (tcp, arg, &sev) < 0) tprintf("{...}"); else {