]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Debug printing at startup.
authorJulian Seward <jseward@acm.org>
Sun, 13 Feb 2005 10:55:47 +0000 (10:55 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 13 Feb 2005 10:55:47 +0000 (10:55 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3237

coregrind/vg_main.c

index ff23e3da4c2f1fec9d7671b237b343e021d6f0d9..837d2280c0921ffa512bb4f2e88a9e5aa63cc844 100644 (file)
@@ -969,6 +969,7 @@ static Addr setup_client_stack(void* init_sp,
       ROUNDUP(stringsize, sizeof(int)) +/* strings (aligned) */
       VKI_PAGE_SIZE;                   /* page for trampoline code */
 
+VG_(printf)("stacksize = %d\n", stacksize);
    // decide where stack goes!
    VG_(clstk_end) = VG_(client_end);
 
@@ -983,7 +984,7 @@ static Addr setup_client_stack(void* init_sp,
 
    VG_(clstk_base) = PGROUNDDN(cl_esp);
 
-   if (0)
+   if (1)
       printf("stringsize=%d auxsize=%d stacksize=%d\n"
              "clstk_base %p\n"
              "clstk_end  %p\n",
@@ -994,9 +995,17 @@ static Addr setup_client_stack(void* init_sp,
    /* ==================== allocate space ==================== */
 
    /* allocate a stack - mmap enough space for the stack */
+#if 1
    res = mmap((void *)PGROUNDDN(cl_esp), VG_(clstk_end) - PGROUNDDN(cl_esp),
              PROT_READ | PROT_WRITE | PROT_EXEC, 
              MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
+#else
+   /* Debug hack -- do not use. */
+   res = mmap((void *)(PGROUNDDN(cl_esp) - 0x10000), 
+                      (0x10000 + VG_(clstk_end) - PGROUNDDN(cl_esp)),
+             PROT_READ | PROT_WRITE | PROT_EXEC, 
+             MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
+#endif
    vg_assert((void*)-1 != res); 
 
    /* ==================== copy client stack ==================== */
@@ -1131,6 +1140,7 @@ static Addr setup_client_stack(void* init_sp,
    VG_(client_argc) = *(Int*)cl_esp;
    VG_(client_argv) = (Char**)(cl_esp + sizeof(HWord));
 
+   VG_(printf)("startup SP = %p\n", cl_esp);
    return cl_esp;
 }