|
From: <sv...@va...> - 2005-09-19 08:08:50
|
Author: tom
Date: 2005-09-19 09:08:46 +0100 (Mon, 19 Sep 2005)
New Revision: 4680
Log:
Use the new address space manager calls to map separated debug informatio=
n.
Modified:
branches/ASPACEM/coregrind/m_debuginfo/symtab.c
Modified: branches/ASPACEM/coregrind/m_debuginfo/symtab.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_debuginfo/symtab.c 2005-09-19 07:57:20 U=
TC (rev 4679)
+++ branches/ASPACEM/coregrind/m_debuginfo/symtab.c 2005-09-19 08:08:46 U=
TC (rev 4680)
@@ -1299,9 +1299,8 @@
static
Addr open_debug_file( Char* name, UInt crc, UInt* size )
{
- SysRes fd;
+ SysRes fd, sres;
struct vki_stat stat_buf;
- Addr addr;
UInt calccrc;
=20
fd =3D VG_(open)(name, VKI_O_RDONLY, 0);
@@ -1318,26 +1317,24 @@
=20
*size =3D stat_buf.st_size;
=20
- if ((addr =3D (Addr)VG_(mmap)(NULL, *size, VKI_PROT_READ,
- VKI_MAP_PRIVATE|VKI_MAP_NOSYMS,=20
- 0, fd.val, 0)) =3D=3D (Addr)-1)=20
- {
- VG_(close)(fd.val);
- return 0;
- }
+ sres =3D VG_(am_mmap_file_float_valgrind)
+ ( *size, VKI_PROT_READ, fd.val, 0 );
=20
VG_(close)(fd.val);
=20
- calccrc =3D calc_gnu_debuglink_crc32(0, (UChar*)addr, *size);
+ if (sres.isError)
+ return 0;
+
+ calccrc =3D calc_gnu_debuglink_crc32(0, (UChar*)sres.val, *size);
if (calccrc !=3D crc) {
- int res =3D VG_(munmap)((void*)addr, *size);
- vg_assert(0 =3D=3D res);
+ SysRes res =3D VG_(am_munmap_valgrind)(sres.val, *size);
+ vg_assert(!res.isError);
if (VG_(clo_verbosity) > 1)
VG_(message)(Vg_DebugMsg, "... CRC mismatch (computed %08x wanted %08x=
)", calccrc, crc);
return 0;
}
=20
- return addr;
+ return sres.val;
}
=20
/*
|