|
From: <sv...@va...> - 2005-09-23 16:30:39
|
Author: sewardj
Date: 2005-09-23 17:30:32 +0100 (Fri, 23 Sep 2005)
New Revision: 4737
Log:
VG_(am_relocate_nooverlap_client): don't mess with offsets in
anonymous segments.
Modified:
branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
Modified: branches/ASPACEM/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/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-23 13:54:1=
0 UTC (rev 4736)
+++ branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-23 16:30:3=
2 UTC (rev 4737)
@@ -1280,6 +1280,7 @@
static void add_segment ( NSegment* seg )
{
Int i, iLo, iHi, delta;
+ Bool segment_is_sane;
=20
Addr sStart =3D seg->start;
Addr sEnd =3D seg->end;
@@ -1287,9 +1288,11 @@
aspacem_assert(sStart <=3D sEnd);
aspacem_assert(VG_IS_PAGE_ALIGNED(sStart));
aspacem_assert(VG_IS_PAGE_ALIGNED(sEnd+1));
- /* if (!sane_NSegment(seg)) show_nsegment_full(0,seg); */
- aspacem_assert(sane_NSegment(seg));
=20
+ segment_is_sane =3D sane_NSegment(seg);
+ if (!segment_is_sane) show_nsegment_full(0,seg);
+ aspacem_assert(segment_is_sane);
+
split_nsegments_lo_and_hi( sStart, sEnd, &iLo, &iHi );
=20
/* Now iLo .. iHi inclusive is the range of segment indices which
@@ -2515,7 +2518,12 @@
add_segment( &seg );
=20
/* Mark the new area based on the old seg. */
- oldseg.offset +=3D ((ULong)old_addr) - ((ULong)oldseg.start);
+ if (oldseg.kind =3D=3D SkFileC) {
+ oldseg.offset +=3D ((ULong)old_addr) - ((ULong)oldseg.start);
+ } else {
+ aspacem_assert(oldseg.kind =3D=3D SkAnonC);
+ aspacem_assert(oldseg.offset =3D=3D 0);
+ }
oldseg.start =3D new_addr;
oldseg.end =3D new_addr + new_len - 1;
add_segment( &oldseg );
|