--- valgrind-pagein-1.0-orig/pg_main.c 2007-04-22 05:50:25.000000000 +0200 +++ valgrind-pagein-1.0/pg_main.c 2008-06-15 20:48:46.000000000 +0200 @@ -40,6 +40,8 @@ #include #include #include +#include +#include static VgHashTable ht; @@ -76,10 +78,26 @@ newpage (bool codefault, Addr dataaddr, if (VG_(HT_get_node) (ht, pageaddr, &res) == NULL) { static unsigned long int total; + Addr ips[8]; Char buf[1024]; VG_(describe_IP) (lastaddr, buf, 1024); - size_t len = VG_(strlen) (buf) + 1; + size_t len = VG_(strlen) (buf); + UInt ips_count = VG_(get_StackTrace) ( VG_(get_running_tid) (), ips, sizeof (ips) / sizeof (*ips) ); + tl_assert (ips_count > 0); + UInt ipi; + for (ipi = 0; ipi < ips_count; ipi++) + { + const char str[] = "\n\t\t\t\t\t "; // \n and 41 spaces + if (len + sizeof str < sizeof (buf)) + { + strcpy (buf + len, str); + len += VG_(strlen) (buf + len); + } + VG_(describe_IP) (ips[ipi], buf + len, sizeof (buf) - len); + len += VG_(strlen) (buf + len); + } + len++; struct pageaddr_order *pa = VG_(malloc) (sizeof (*pa) + len); pa->top.key = pageaddr;