|
From: <sv...@va...> - 2005-09-28 01:23:30
|
Author: sewardj
Date: 2005-09-28 02:23:25 +0100 (Wed, 28 Sep 2005)
New Revision: 4801
Log:
Clean up the m_debuginfo interface a bit.
Modified:
trunk/coregrind/m_debuginfo/symtab.c
trunk/coregrind/pub_core_debuginfo.h
Modified: trunk/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
--- trunk/coregrind/m_debuginfo/symtab.c 2005-09-28 01:14:32 UTC (rev 480=
0)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-09-28 01:23:25 UTC (rev 480=
1)
@@ -96,6 +96,14 @@
=20
=20
/*------------------------------------------------------------*/
+/*--- Forwards decls ---*/
+/*------------------------------------------------------------*/
+
+static Bool is_elf_object_file ( const void *buf );
+static void unload_symbols ( Addr start, SizeT length );
+
+
+/*------------------------------------------------------------*/
/*--- TOP LEVEL ---*/
/*------------------------------------------------------------*/
=20
@@ -127,11 +135,6 @@
return VG_(strstr)( filename, "/lib/valgrind/" ) !=3D NULL;
}
=20
-////////////
-
-// fwds
-static void unload_symbols ( Addr start, SizeT length );
-
static void nuke_syms_in_range ( Addr start, SizeT length )
{
/* Repeatedly scan the segInfo list, looking for segInfos in this
@@ -183,7 +186,7 @@
&& seg->hasR
&& seg->hasX
&& !seg->hasW
- && VG_(is_object_file)( (const void*)seg->start );
+ && is_elf_object_file( (const void*)seg->start );
=20
if (!ok) {
VG_(arena_free)(VG_AR_SYMTAB, filename);
@@ -1056,7 +1059,7 @@
/*--- Read info from a .so/exe file. ---*/
/*------------------------------------------------------------*/
=20
-Bool VG_(is_object_file)(const void *buf)
+static Bool is_elf_object_file(const void *buf)
{
{
ElfXX_Ehdr *ehdr =3D (ElfXX_Ehdr *)buf;
@@ -1437,7 +1440,7 @@
ehdr =3D (ElfXX_Ehdr*)oimage;
=20
if (ok)
- ok &=3D VG_(is_object_file)(ehdr);
+ ok &=3D is_elf_object_file(ehdr);
=20
if (!ok) {
ML_(symerr)("Invalid ELF header, or missing stringtab/sectiontab."=
);
@@ -1681,7 +1684,7 @@
if ((dimage =3D find_debug_file(si->filename, debuglink, crc, &=
n_dimage)) !=3D 0) {
ehdr =3D (ElfXX_Ehdr*)dimage;
=20
- if (n_dimage >=3D sizeof(ElfXX_Ehdr) && VG_(is_object_file)(=
ehdr))
+ if (n_dimage >=3D sizeof(ElfXX_Ehdr) && is_elf_object_file(e=
hdr))
{
shdr =3D (ElfXX_Shdr*)(dimage + ehdr->e_shoff);
sh_strtab =3D (UChar*)(dimage + shdr[ehdr->e_shstrndx].sh=
_offset);
@@ -1853,21 +1856,21 @@
VGP_POPCC(VgpReadSyms);
}
=20
-void VG_(seginfo_decref)(SegInfo *si, Addr start)
-{
- vg_assert(si);
- vg_assert(si->ref >=3D 1);
- if (--si->ref =3D=3D 0)
- unload_symbols(si->start, si->size);
-}
+//static void seginfo_decref(SegInfo *si, Addr start)
+//{
+// vg_assert(si);
+// vg_assert(si->ref >=3D 1);
+// if (--si->ref =3D=3D 0)
+// unload_symbols(si->start, si->size);
+//}
+//
+//static void seginfo_incref(SegInfo *si)
+//{
+// vg_assert(si);
+// vg_assert(si->ref > 0);
+// si->ref++;
+//}
=20
-void VG_(seginfo_incref)(SegInfo *si)
-{
- vg_assert(si);
- vg_assert(si->ref > 0);
- si->ref++;
-}
-
/*------------------------------------------------------------*/
/*--- Use of symbol table & location info to create ---*/
/*--- plausible-looking stack dumps. ---*/
Modified: trunk/coregrind/pub_core_debuginfo.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
--- trunk/coregrind/pub_core_debuginfo.h 2005-09-28 01:14:32 UTC (rev 480=
0)
+++ trunk/coregrind/pub_core_debuginfo.h 2005-09-28 01:23:25 UTC (rev 480=
1)
@@ -45,11 +45,8 @@
extern void VG_(di_notify_munmap)( Addr a, SizeT len );
extern void VG_(di_notify_mprotect)( Addr a, SizeT len, UInt prot );
=20
-extern Bool VG_(is_object_file) ( const void *hdr );
extern SegInfo *VG_(read_seg_symbols) ( Addr addr, SizeT len,
OffT offset, const Char* filenam=
e);
-extern void VG_(seginfo_incref) ( SegInfo * );
-extern void VG_(seginfo_decref) ( SegInfo *, Addr a );
=20
extern Bool VG_(get_fnname_nodemangle)( Addr a, Char* fnname, Int n_fnna=
me );
=20
|