]> sourceware.org Git - systemtap.git/commitdiff
stapdyn: Workaround for an i686 Dyninst bug in argument passing
authorJosh Stone <jistone@redhat.com>
Wed, 7 Nov 2012 19:41:16 +0000 (11:41 -0800)
committerJosh Stone <jistone@redhat.com>
Wed, 7 Nov 2012 23:49:10 +0000 (15:49 -0800)
Dyninst appears to be filling only 32-bits for the index to
enter_dyninst_uprobe_regs, which makes the following arguments shift
badly too.  This is reported upstream, but we can detect and work around
it ourselves too.

runtime/dyninst/uprobes.c

index 70ace0ddb39d5e2228360c8b5e8d49b955b4a9aa..723600967a941037bb994ff5df19b2d366be8e2c 100644 (file)
@@ -74,6 +74,16 @@ int enter_dyninst_uprobe_regs(uint64_t index, unsigned long nregs, ...)
        va_list varegs;
        va_start(varegs, nregs);
 
+#ifdef __i386__
+       // XXX Dyninst currently has a bug where it's only passing a 32-bit
+       // index, which means nregs gets stuffed into the upper bits of index,
+       // and the varegs are all off by one.  Hacking it into shape for now...
+       if (index > UINT32_MAX) {
+               SET_REG_IP((&regs), nregs);
+                nregs = index >> 32;
+                index &= UINT32_MAX;
+        } else
+#endif
        if (nregs > 0)
                SET_REG_IP((&regs), va_arg(varegs, unsigned long));
 
This page took 0.028314 seconds and 5 git commands to generate.