]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Clean up the m_debuginfo interface a bit.
authorJulian Seward <jseward@acm.org>
Wed, 28 Sep 2005 01:23:25 +0000 (01:23 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 28 Sep 2005 01:23:25 +0000 (01:23 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4801

coregrind/m_debuginfo/symtab.c
coregrind/pub_core_debuginfo.h

index 8b404b08a56d6072d7c25104430f70ab7ca31088..281418af5cdea0f243ff962bef01cd93b17b28d8 100644 (file)
@@ -95,6 +95,14 @@ static SegInfo* segInfo_list = NULL;
 #endif
 
 
+/*------------------------------------------------------------*/
+/*--- Forwards decls                                       ---*/
+/*------------------------------------------------------------*/
+
+static Bool is_elf_object_file ( const void *buf );
+static void unload_symbols ( Addr start, SizeT length );
+
+
 /*------------------------------------------------------------*/
 /*--- TOP LEVEL                                            ---*/
 /*------------------------------------------------------------*/
@@ -127,11 +135,6 @@ static Bool is_self ( HChar* filename )
    return VG_(strstr)( filename, "/lib/valgrind/" ) != NULL;
 }
 
-////////////
-
-// 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 @@ void VG_(di_notify_mmap)( Addr a )
          && seg->hasR
          && seg->hasX
          && !seg->hasW
-         && VG_(is_object_file)( (const void*)seg->start );
+         && is_elf_object_file( (const void*)seg->start );
 
    if (!ok) {
       VG_(arena_free)(VG_AR_SYMTAB, filename);
@@ -1056,7 +1059,7 @@ void canonicaliseCfiSI ( SegInfo* si )
 /*--- Read info from a .so/exe file.                       ---*/
 /*------------------------------------------------------------*/
 
-Bool VG_(is_object_file)(const void *buf)
+static Bool is_elf_object_file(const void *buf)
 {
    {
       ElfXX_Ehdr *ehdr = (ElfXX_Ehdr *)buf;
@@ -1437,7 +1440,7 @@ Bool read_lib_symbols ( SegInfo* si )
    ehdr = (ElfXX_Ehdr*)oimage;
 
    if (ok)
-      ok &= VG_(is_object_file)(ehdr);
+      ok &= is_elf_object_file(ehdr);
 
    if (!ok) {
       ML_(symerr)("Invalid ELF header, or missing stringtab/sectiontab.");
@@ -1681,7 +1684,7 @@ Bool read_lib_symbols ( SegInfo* si )
          if ((dimage = find_debug_file(si->filename, debuglink, crc, &n_dimage)) != 0) {
             ehdr = (ElfXX_Ehdr*)dimage;
 
-            if (n_dimage >= sizeof(ElfXX_Ehdr) && VG_(is_object_file)(ehdr))
+            if (n_dimage >= sizeof(ElfXX_Ehdr) && is_elf_object_file(ehdr))
             {
                shdr = (ElfXX_Shdr*)(dimage + ehdr->e_shoff);
                sh_strtab = (UChar*)(dimage + shdr[ehdr->e_shstrndx].sh_offset);
@@ -1853,20 +1856,20 @@ static void unload_symbols ( Addr start, SizeT length )
    VGP_POPCC(VgpReadSyms);
 }
 
-void VG_(seginfo_decref)(SegInfo *si, Addr start)
-{
-   vg_assert(si);
-   vg_assert(si->ref >= 1);
-   if (--si->ref == 0)
-      unload_symbols(si->start, si->size);
-}
-
-void VG_(seginfo_incref)(SegInfo *si)
-{
-   vg_assert(si);
-   vg_assert(si->ref > 0);
-   si->ref++;
-}
+//static void seginfo_decref(SegInfo *si, Addr start)
+//{
+//   vg_assert(si);
+//   vg_assert(si->ref >= 1);
+//   if (--si->ref == 0)
+//      unload_symbols(si->start, si->size);
+//}
+//
+//static void seginfo_incref(SegInfo *si)
+//{
+//   vg_assert(si);
+//   vg_assert(si->ref > 0);
+//   si->ref++;
+//}
 
 /*------------------------------------------------------------*/
 /*--- Use of symbol table & location info to create        ---*/
index 7034566c0c70c458b1cfc15d2001ed7b11418b7a..94a76ea7af2e20d4c400804dd4abaf714a441839 100644 (file)
@@ -45,11 +45,8 @@ extern void VG_(di_notify_mmap)( Addr a );
 extern void VG_(di_notify_munmap)( Addr a, SizeT len );
 extern void VG_(di_notify_mprotect)( Addr a, SizeT len, UInt prot );
 
-extern Bool VG_(is_object_file)   ( const void *hdr );
 extern SegInfo *VG_(read_seg_symbols) ( Addr addr, SizeT len,
                                         OffT offset, const Char* filename);
-extern void VG_(seginfo_incref)   ( SegInfo * );
-extern void VG_(seginfo_decref)   ( SegInfo *, Addr a );
 
 extern Bool VG_(get_fnname_nodemangle)( Addr a, Char* fnname, Int n_fnname );