]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
In the signal handler, make debug printing a bit more verbose.
authorJulian Seward <jseward@acm.org>
Wed, 20 Oct 2004 18:36:23 +0000 (18:36 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 20 Oct 2004 18:36:23 +0000 (18:36 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@389

VEX/head20041019/coregrind/vg_signals.c

index 602393c97f2cbf648a38f57e7df4d66ccedad141..5c5d0266b5f244132e1b00f2fe62149747837400 100644 (file)
@@ -1700,6 +1700,7 @@ void vg_sync_signalhandler ( Int sigNo, vki_ksiginfo_t *info, struct vki_ucontex
    */
 
    if (VG_(clo_trace_signals)) {
+      VG_(message)(Vg_DebugMsg, "");
       VG_(message)(Vg_DebugMsg, "signal %d arrived ... si_code=%d", sigNo, info->si_code );
    }
    vg_assert(sigNo >= 1 && sigNo <= VKI_KNSIG);
@@ -1767,6 +1768,9 @@ void vg_sync_signalhandler ( Int sigNo, vki_ksiginfo_t *info, struct vki_ucontex
            then extend the stack segment. 
         */
         Addr base = PGROUNDDN(esp);
+         if (VG_(clo_trace_signals)) {
+            VG_(message)(Vg_DebugMsg, "attempt to extend stack downwards ...");
+         }
          if (seg->len + (seg->addr - base) <= VG_(threads)[tid].stack_size &&
              (void*)-1 != VG_(mmap)((Char *)base, seg->addr - base,
                               VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC,
@@ -1774,7 +1778,14 @@ void vg_sync_signalhandler ( Int sigNo, vki_ksiginfo_t *info, struct vki_ucontex
                               SF_STACK|SF_GROWDOWN,
                               -1, 0))
          {
-           return;             // extension succeeded, restart instruction
+            if (VG_(clo_trace_signals)) {
+               VG_(message)(Vg_DebugMsg, "... succeeded.");
+            }
+            return;             // extension succeeded, restart instruction
+        } else {
+            if (VG_(clo_trace_signals)) {
+               VG_(message)(Vg_DebugMsg, "... failed.");
+            }
         }
         /* Otherwise fall into normal signal handling */
       } else if (info->si_code == 2 && /* SEGV_ACCERR */