|
From: <sv...@va...> - 2005-08-24 22:57:59
|
Author: dirk
Date: 2005-08-24 23:57:57 +0100 (Wed, 24 Aug 2005)
New Revision: 4495
Log:
svn merge r4448:
Make show_segments() public, and use it when VG_(get_memory_from_mmap)()
fails. This might help debugging.
Modified:
branches/VALGRIND_3_0_BRANCH/coregrind/m_aspacemgr/aspacemgr.c
branches/VALGRIND_3_0_BRANCH/coregrind/m_libcmman.c
branches/VALGRIND_3_0_BRANCH/coregrind/pub_core_aspacemgr.h
Modified: branches/VALGRIND_3_0_BRANCH/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_0_BRANCH/coregrind/m_aspacemgr/aspacemgr.c 2005-0=
8-24 22:57:14 UTC (rev 4494)
+++ branches/VALGRIND_3_0_BRANCH/coregrind/m_aspacemgr/aspacemgr.c 2005-0=
8-24 22:57:57 UTC (rev 4495)
@@ -386,7 +386,7 @@
VG_(printf), and I'm not 100% clear that that wouldn't require
dynamic memory allocation and hence more segments to be allocated.
*/
-static void show_segments ( HChar* who )
+void VG_(show_segments) ( HChar* who )
{
Int i;
VG_(printf)("<<< SHOW_SEGMENTS: %s (%d segments, %d segnames)\n",=20
@@ -496,7 +496,7 @@
vg_assert(segments_used >=3D 0 && segments_used < VG_N_SEGMENTS);
vg_assert(segnames_used >=3D 0 && segnames_used < VG_N_SEGNAMES);
=20
- if (0) show_segments("before preen");
+ if (0) VG_(show_segments)("before preen");
=20
/* clear string table mark bits */
for (i =3D 0; i < segnames_used; i++)
@@ -556,7 +556,7 @@
}
}
=20
- if (0) show_segments("after preen");
+ if (0) VG_(show_segments)("after preen");
}
=20
=20
@@ -623,7 +623,7 @@
=20
if (debug)
VG_(printf)("unmap_range(%p, %llu)\n", addr, (ULong)len);
- if (0) show_segments("unmap_range(BEFORE)");
+ if (0) VG_(show_segments)("unmap_range(BEFORE)");
end =3D addr+len;
=20
/* Everything must be page-aligned */
@@ -713,7 +713,7 @@
i--;
}
preen_segments();
- if (0) show_segments("unmap_range(AFTER)");
+ if (0) VG_(show_segments)("unmap_range(AFTER)");
}
=20
=20
@@ -745,7 +745,7 @@
" filename=3D'%s')\n",
addr, (ULong)len, prot, flags, dev, ino, off, filename);
=20
- if (0) show_segments("before map_file_segment");
+ if (0) VG_(show_segments)("before map_file_segment");
=20
/* Everything must be page-aligned */
vg_assert(VG_IS_PAGE_ALIGNED(addr));
@@ -774,7 +774,7 @@
=20
/* Clean up right now */
preen_segments();
- if (0) show_segments("after map_file_segment");
+ if (0) VG_(show_segments)("after map_file_segment");
=20
/* If this mapping is at the beginning of a file, isn't part of
Valgrind, is at least readable and seems to contain an object
@@ -879,7 +879,7 @@
if (debug)
VG_(printf)("\nmprotect_range(%p, %lu, %x)\n", a, len, prot);
=20
- if (0) show_segments( "mprotect_range(before)" );
+ if (0) VG_(show_segments)( "mprotect_range(before)" );
=20
/* Everything must be page-aligned */
vg_assert(VG_IS_PAGE_ALIGNED(a));
@@ -894,7 +894,7 @@
=20
preen_segments();
=20
- if (0) show_segments( "mprotect_range(after)");
+ if (0) VG_(show_segments)( "mprotect_range(after)");
}
=20
=20
@@ -922,7 +922,7 @@
addr, (ULong)len, for_client);
}
=20
- if (0) show_segments("find_map_space: start");
+ if (0) VG_(show_segments)("find_map_space: start");
=20
if (addr =3D=3D 0) {
fixed =3D False;
@@ -1100,7 +1100,7 @@
Segment *VG_(find_segment)(Addr a)
{
Int r =3D find_segment(a);
- if (0) show_segments("find_segment");
+ if (0) VG_(show_segments)("find_segment");
if (r =3D=3D -1) return NULL;
return &segments[r];
}
@@ -1112,7 +1112,7 @@
Segment *VG_(find_segment_above_unmapped)(Addr a)
{
Int r =3D find_segment_above_unmapped(a);
- if (0) show_segments("find_segment_above_unmapped");
+ if (0) VG_(show_segments)("find_segment_above_unmapped");
if (r =3D=3D -1) return NULL;
return &segments[r];
}
@@ -1124,7 +1124,7 @@
Segment *VG_(find_segment_above_mapped)(Addr a)
{
Int r =3D find_segment_above_mapped(a);
- if (0) show_segments("find_segment_above_mapped");
+ if (0) VG_(show_segments)("find_segment_above_mapped");
if (r =3D=3D -1) return NULL;
return &segments[r];
}
@@ -1220,7 +1220,7 @@
Addr try_here;
SysRes r;
=20
- if (0) show_segments("shadow_alloc(before)");
+ if (0) VG_(show_segments)("shadow_alloc(before)");
=20
vg_assert(VG_(needs).shadow_memory);
=20
Modified: branches/VALGRIND_3_0_BRANCH/coregrind/m_libcmman.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_0_BRANCH/coregrind/m_libcmman.c 2005-08-24 22:57:=
14 UTC (rev 4494)
+++ branches/VALGRIND_3_0_BRANCH/coregrind/m_libcmman.c 2005-08-24 22:57:=
57 UTC (rev 4495)
@@ -124,6 +124,11 @@
VG_(printf)("Sorry. You could try using a tool that uses less memory=
;\n");
VG_(printf)("eg. addrcheck instead of memcheck.\n");
VG_(printf)("\n");
+ VG_(printf)("---- Debugging information follows --------\n");
+ VG_(printf)("Valgrind's range is: %p .. %p\n",
+ (void*)VG_(valgrind_base), (void*)VG_(valgrind_last));
+ VG_(show_segments)("VG_(get_memory_from_mmap) failure");
+
VG_(exit)(1);
}
=20
Modified: branches/VALGRIND_3_0_BRANCH/coregrind/pub_core_aspacemgr.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_0_BRANCH/coregrind/pub_core_aspacemgr.h 2005-08-2=
4 22:57:14 UTC (rev 4494)
+++ branches/VALGRIND_3_0_BRANCH/coregrind/pub_core_aspacemgr.h 2005-08-2=
4 22:57:57 UTC (rev 4495)
@@ -131,6 +131,8 @@
=20
extern Segment *VG_(split_segment)(Addr a);
=20
+extern void VG_(show_segments)(HChar* who);
+
extern void VG_(pad_address_space) (Addr start);
extern void VG_(unpad_address_space)(Addr start);
=20
|