]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix test memcheck/tests/descr_belowsp a bit on Solaris.
authorIvo Raisr <ivosh@ivosh.net>
Fri, 29 Jul 2016 20:52:21 +0000 (20:52 +0000)
committerIvo Raisr <ivosh@ivosh.net>
Fri, 29 Jul 2016 20:52:21 +0000 (20:52 +0000)
On Solaris, '%p' outputs just a hexadecimal number
without '0x' prefix. This is perfectly valid but not
understood by VG_(strtok_get_address_and_size)().
Therefore use universal PRIxPTR.
n-i-bz

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15918

memcheck/tests/descr_belowsp.c
memcheck/tests/descr_belowsp.stderr.exp

index 704c222917cc812f779a8c0842ab6bfe4cec81c6..113d272dc988ecb34b421253fbf163dab69ee0c8 100644 (file)
@@ -1,6 +1,7 @@
 #include "../../config.h"
 
 #define _GNU_SOURCE
+#include <inttypes.h>
 #include <stdio.h>
 #include <pthread.h>
 #include <string.h>
@@ -43,8 +44,8 @@ static void grow_the_stack(void)
 static char s[1000];
 static void describe (char* what, void* a)
 {
-   fprintf(stderr, "describing %p %s\n", a, what);
-   sprintf(s, "v.info location %p", a);
+   fprintf(stderr, "describing %#" PRIxPTR " %s\n", (uintptr_t) a, what);
+   sprintf(s, "v.info location %#" PRIxPTR, (uintptr_t) a);
    VALGRIND_MONITOR_COMMAND(s);
 }
 
index c80e120373946210fea704c93d17f7927ae326fd..027832bed694e04d4061a2b6c2635a1544c52222 100644 (file)
@@ -6,8 +6,8 @@ describing 0x........ 1500 bytes below a local var
  .... bytes below stack pointer
 Thread 2:
 Invalid read of size 1
-   at 0x........: bad_things_till_guard_page (descr_belowsp.c:73)
-   by 0x........: child_fn_0 (descr_belowsp.c:112)
+   at 0x........: bad_things_till_guard_page (descr_belowsp.c:74)
+   by 0x........: child_fn_0 (descr_belowsp.c:113)
    ...
  Address 0x........ is on thread 2's stack
  .... bytes below stack pointer