]> granicus.if.org Git - strace/commitdiff
2006-12-10 Dmitry V. Levin <ldv@altlinux.org>
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 13 Dec 2006 17:45:02 +0000 (17:45 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 13 Dec 2006 17:45:02 +0000 (17:45 +0000)
Add biarch support for "struct sigevent".
* time.c [LINUX && SUPPORTED_PERSONALITIES > 1] (printsigevent32):
New function.
[LINUX] (printsigevent): [SUPPORTED_PERSONALITIES > 1]
Handle 32-bit personality.

ChangeLog
time.c

index 11a03af757425c3d254fe8194b676f29cbea4da2..f5424f9fe1964043be03d8faa371990df487b1f2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2006-12-10  Dmitry V. Levin <ldv@altlinux.org>
 
+       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 375c20c9a5e3b2ff2033ddf7115481648144472d..b366104c607f2a5ebfa73a884e68ea56c47e21de 100644 (file)
--- 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 {