]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
(almost completely just function renaming):
authorJulian Seward <jseward@acm.org>
Fri, 31 Jul 2009 09:41:29 +0000 (09:41 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 31 Jul 2009 09:41:29 +0000 (09:41 +0000)
* VG_(find_seginfo): incrementally rearrange the DebugInfo list, like
  most of the other list-searching functions do.

* rename all VG_(*seginfo*) functions exported from m_debuginfo to
  VG_(*DebugInfo*).  "seginfo" was a historical name which was mostly
  but not completely, done away with some time back.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10678

12 files changed:
callgrind/bb.c
callgrind/debug.c
callgrind/fn.c
coregrind/m_debuginfo/debuginfo.c
coregrind/m_redir.c
drd/drd_error.c
drd/drd_load_store.c
drd/drd_main.c
helgrind/hg_errors.c
helgrind/hg_main.c
include/pub_tool_debuginfo.h
memcheck/mc_errors.c

index 2dca73e05d139eea2b16e7a44d35becdc275fc81..7bea5b38c52cb3a927f0968ddf5d820f9aa13f8a 100644 (file)
@@ -143,7 +143,7 @@ static BB* new_bb(obj_node* obj, PtrdiffT offset,
    bb->jmp         = (CJmpInfo*) &(bb->instr[instr_count]);
    bb->instr_len   = 0;
    bb->cost_count  = 0;
-   bb->sect_kind   = VG_(seginfo_sect_kind)(NULL, 0, offset + obj->offset);
+   bb->sect_kind   = VG_(DebugInfo_sect_kind)(NULL, 0, offset + obj->offset);
    bb->fn          = 0;
    bb->line        = 0;
    bb->is_entry    = 0;
@@ -201,21 +201,21 @@ obj_node* obj_of_address(Addr addr)
   DebugInfo* di;
   PtrdiffT offset;
 
-  di = VG_(find_seginfo)(addr);
+  di = VG_(find_DebugInfo)(addr);
   obj = CLG_(get_obj_node)( di );
 
   /* Update symbol offset in object if remapped */
   /* FIXME (or at least check this) 2008 Feb 19: 'offset' is
      only correct for text symbols, not for data symbols */
-  offset = di ? VG_(seginfo_get_text_bias)(di):0;
+  offset = di ? VG_(DebugInfo_get_text_bias)(di):0;
   if (obj->offset != offset) {
-      Addr start = di ? VG_(seginfo_get_text_avma)(di) : 0;
+      Addr start = di ? VG_(DebugInfo_get_text_avma)(di) : 0;
 
       CLG_DEBUG(0, "Mapping changed for '%s': %#lx -> %#lx\n",
                obj->name, obj->start, start);
 
       /* Size should be the same, and offset diff == start diff */
-      CLG_ASSERT( obj->size == (di ? VG_(seginfo_get_text_size)(di) : 0) );
+      CLG_ASSERT( obj->size == (di ? VG_(DebugInfo_get_text_size)(di) : 0) );
       CLG_ASSERT( obj->start - start == obj->offset - offset );
       obj->offset = offset;
       obj->start = start;
index 2ac38a29784071cc89a1a3a0f87f726d38829f1f..ab4fdb5574553f550c508b76b4ffc88710dcb331 100644 (file)
@@ -379,7 +379,7 @@ void CLG_(print_addr)(Addr addr)
        VG_(printf)("%#lx %s", addr, fn_buf);
 
     if (di) {
-      obj_name = VG_(seginfo_filename)(di);
+      obj_name = VG_(DebugInfo_get_filename)(di);
       if (obj_name) {
        while(obj_name[i]) {
          if (obj_name[i]=='/') opos = i+1;
index 0845a1307e4b24810462c5c2139d26e41b7637d7..6ed6f6005bdb6f10fab35deb2a080d54bd5b80bc 100644 (file)
@@ -232,8 +232,9 @@ obj_node* new_obj_node(DebugInfo* di, obj_node* next)
    obj_node* obj;
 
    obj = (obj_node*) CLG_MALLOC("cl.fn.non.1", sizeof(obj_node));
-   obj->name  = di ? VG_(strdup)( "cl.fn.non.2",VG_(seginfo_filename)(di) )
-                     : anonymous_obj;
+   obj->name  = di ? VG_(strdup)( "cl.fn.non.2",
+                                  VG_(DebugInfo_get_filename)(di) )
+                   : anonymous_obj;
    for (i = 0; i < N_FILE_ENTRIES; i++) {
       obj->files[i] = NULL;
    }
@@ -242,9 +243,9 @@ obj_node* new_obj_node(DebugInfo* di, obj_node* next)
    /* JRS 2008 Feb 19: maybe rename .start/.size/.offset to
       .text_avma/.text_size/.test_bias to make it clearer what these
       fields really mean */
-   obj->start   = di ? VG_(seginfo_get_text_avma)(di) : 0;
-   obj->size    = di ? VG_(seginfo_get_text_size)(di) : 0;
-   obj->offset  = di ? VG_(seginfo_get_text_bias)(di) : 0;
+   obj->start   = di ? VG_(DebugInfo_get_text_avma)(di) : 0;
+   obj->size    = di ? VG_(DebugInfo_get_text_size)(di) : 0;
+   obj->offset  = di ? VG_(DebugInfo_get_text_bias)(di) : 0;
    obj->next    = next;
 
    // not only used for debug output (see static.c)
@@ -266,7 +267,7 @@ obj_node* CLG_(get_obj_node)(DebugInfo* di)
     UInt         objname_hash;
     const UChar* obj_name;
     
-    obj_name = di ? (Char*) VG_(seginfo_filename)(di) : anonymous_obj;
+    obj_name = di ? (Char*) VG_(DebugInfo_get_filename)(di) : anonymous_obj;
 
     /* lookup in obj hash */
     objname_hash = str_hash(obj_name, N_OBJ_ENTRIES);
@@ -425,7 +426,7 @@ Bool CLG_(get_debug_info)(Addr instr_addr,
   CLG_DEBUG(6, "  + get_debug_info(%#lx)\n", instr_addr);
 
   if (pDebugInfo) {
-      *pDebugInfo = VG_(find_seginfo)(instr_addr);
+      *pDebugInfo = VG_(find_DebugInfo)(instr_addr);
 
       // for generated code in anonymous space, pSegInfo is 0
    }
@@ -471,7 +472,7 @@ Bool CLG_(get_debug_info)(Addr instr_addr,
    CLG_DEBUG(6, "  - get_debug_info(%#lx): seg '%s', fn %s\n",
            instr_addr,
            !pDebugInfo   ? (const UChar*)"-" :
-           (*pDebugInfo) ? VG_(seginfo_filename)(*pDebugInfo) :
+           (*pDebugInfo) ? VG_(DebugInfo_get_filename)(*pDebugInfo) :
            (const UChar*)"(None)",
            fn_name);
 
index dfc9f316f37d6564bd0f89b8c385c53c39e47dd2..e280b933681440ac71b8ab2d88efd36a1ba56bfa 100644 (file)
@@ -1498,14 +1498,18 @@ Bool VG_(get_objname) ( Addr a, Char* buf, Int nbuf )
 
 /* Map a code address to its DebugInfo.  Returns NULL if not found.  Doesn't
    require debug info. */
-DebugInfo* VG_(find_seginfo) ( Addr a )
+DebugInfo* VG_(find_DebugInfo) ( Addr a )
 {
+   static UWord n_search = 0;
    DebugInfo* di;
+   n_search++;
    for (di = debugInfo_list; di != NULL; di = di->next) {
       if (di->text_present
           && di->text_size > 0
           && di->text_avma <= a 
           && a < di->text_avma + di->text_size) {
+         if (0 == (n_search & 0xF))
+            move_DebugInfo_one_step_forward( di );
          return di;
       }
    }
@@ -3375,70 +3379,70 @@ void* /* really, XArray* of GlobalBlock */
 /*--- DebugInfo accessor functions                         ---*/
 /*------------------------------------------------------------*/
 
-const DebugInfo* VG_(next_seginfo)(const DebugInfo* di)
+const DebugInfo* VG_(next_DebugInfo)(const DebugInfo* di)
 {
    if (di == NULL)
       return debugInfo_list;
    return di->next;
 }
 
-Addr VG_(seginfo_get_text_avma)(const DebugInfo* di)
+Addr VG_(DebugInfo_get_text_avma)(const DebugInfo* di)
 {
    return di->text_present ? di->text_avma : 0; 
 }
 
-SizeT VG_(seginfo_get_text_size)(const DebugInfo* di)
+SizeT VG_(DebugInfo_get_text_size)(const DebugInfo* di)
 {
    return di->text_present ? di->text_size : 0; 
 }
 
-Addr VG_(seginfo_get_plt_avma)(const DebugInfo* di)
+Addr VG_(DebugInfo_get_plt_avma)(const DebugInfo* di)
 {
    return di->plt_present ? di->plt_avma : 0; 
 }
 
-SizeT VG_(seginfo_get_plt_size)(const DebugInfo* di)
+SizeT VG_(DebugInfo_get_plt_size)(const DebugInfo* di)
 {
    return di->plt_present ? di->plt_size : 0; 
 }
 
-Addr VG_(seginfo_get_gotplt_avma)(const DebugInfo* di)
+Addr VG_(DebugInfo_get_gotplt_avma)(const DebugInfo* di)
 {
    return di->gotplt_present ? di->gotplt_avma : 0; 
 }
 
-SizeT VG_(seginfo_get_gotplt_size)(const DebugInfo* di)
+SizeT VG_(DebugInfo_get_gotplt_size)(const DebugInfo* di)
 {
    return di->gotplt_present ? di->gotplt_size : 0; 
 }
 
-const UChar* VG_(seginfo_soname)(const DebugInfo* di)
+const UChar* VG_(DebugInfo_get_soname)(const DebugInfo* di)
 {
    return di->soname;
 }
 
-const UChar* VG_(seginfo_filename)(const DebugInfo* di)
+const UChar* VG_(DebugInfo_get_filename)(const DebugInfo* di)
 {
    return di->filename;
 }
 
-PtrdiffT VG_(seginfo_get_text_bias)(const DebugInfo* di)
+PtrdiffT VG_(DebugInfo_get_text_bias)(const DebugInfo* di)
 {
    return di->text_present ? di->text_bias : 0;
 }
 
-Int VG_(seginfo_syms_howmany) ( const DebugInfo *si )
+Int VG_(DebugInfo_syms_howmany) ( const DebugInfo *si )
 {
    return si->symtab_used;
 }
 
-void VG_(seginfo_syms_getidx) ( const DebugInfo *si, 
-                                      Int idx,
-                               /*OUT*/Addr*   avma,
-                               /*OUT*/Addr*   tocptr,
-                               /*OUT*/UInt*   size,
-                               /*OUT*/HChar** name,
-                               /*OUT*/Bool*   isText )
+void VG_(DebugInfo_syms_getidx) ( const DebugInfo *si, 
+                                        Int idx,
+                                  /*OUT*/Addr*   avma,
+                                  /*OUT*/Addr*   tocptr,
+                                  /*OUT*/UInt*   size,
+                                  /*OUT*/HChar** name,
+                                  /*OUT*/Bool*   isText )
 {
    vg_assert(idx >= 0 && idx < si->symtab_used);
    if (avma)   *avma   = si->symtab[idx].addr;
@@ -3475,8 +3479,8 @@ const HChar* VG_(pp_SectKind)( VgSectKind kind )
    characters of the object's name is put in name[0 .. n_name-2], and
    name[n_name-1] is set to zero (guaranteed zero terminated). */
 
-VgSectKind VG_(seginfo_sect_kind)( /*OUT*/UChar* name, SizeT n_name, 
-                                   Addr a)
+VgSectKind VG_(DebugInfo_sect_kind)( /*OUT*/UChar* name, SizeT n_name, 
+                                     Addr a)
 {
    DebugInfo* di;
    VgSectKind res = Vg_SectUnknown;
@@ -3485,7 +3489,8 @@ VgSectKind VG_(seginfo_sect_kind)( /*OUT*/UChar* name, SizeT n_name,
 
       if (0)
          VG_(printf)(
-            "addr=%#lx di=%p %s got=%#lx,%ld plt=%#lx,%ld data=%#lx,%ld bss=%#lx,%ld\n",
+            "addr=%#lx di=%p %s got=%#lx,%ld plt=%#lx,%ld "
+            "data=%#lx,%ld bss=%#lx,%ld\n",
             a, di, di->filename,
             di->got_avma,  di->got_size,
             di->plt_avma,  di->plt_size,
index 6b8d60ce9d4dc14c10b28894c98ba595ddae7156..a63a556a6bd4361fb48d276577c683801b6386a3 100644 (file)
@@ -336,7 +336,7 @@ void VG_(redir_notify_new_DebugInfo)( DebugInfo* newsi )
 #  endif
 
    vg_assert(newsi);
-   newsi_soname = VG_(seginfo_soname)(newsi);
+   newsi_soname = VG_(DebugInfo_get_soname)(newsi);
    vg_assert(newsi_soname != NULL);
 
    /* stay sane: we don't already have this. */
@@ -348,10 +348,10 @@ void VG_(redir_notify_new_DebugInfo)( DebugInfo* newsi )
 
    specList = NULL; /* the spec list we're building up */
 
-   nsyms = VG_(seginfo_syms_howmany)( newsi );
+   nsyms = VG_(DebugInfo_syms_howmany)( newsi );
    for (i = 0; i < nsyms; i++) {
-      VG_(seginfo_syms_getidx)( newsi, i, &sym_addr, &sym_toc, 
-                                          NULL, &sym_name, &isText );
+      VG_(DebugInfo_syms_getidx)( newsi, i, &sym_addr, &sym_toc, 
+                                            NULL, &sym_name, &isText );
       ok = VG_(maybe_Z_demangle)( sym_name, demangled_sopatt, N_DEMANGLED,
                                   demangled_fnpatt, N_DEMANGLED, &isWrap );
       /* ignore data symbols */
@@ -388,8 +388,8 @@ void VG_(redir_notify_new_DebugInfo)( DebugInfo* newsi )
 
    if (check_ppcTOCs) {
       for (i = 0; i < nsyms; i++) {
-         VG_(seginfo_syms_getidx)( newsi, i, &sym_addr, &sym_toc, 
-                                             NULL, &sym_name, &isText );
+         VG_(DebugInfo_syms_getidx)( newsi, i, &sym_addr, &sym_toc, 
+                                               NULL, &sym_name, &isText );
          ok = isText
               && VG_(maybe_Z_demangle)( 
                     sym_name, demangled_sopatt, N_DEMANGLED,
@@ -500,7 +500,7 @@ void generate_and_add_actives (
    for (sp = specs; sp; sp = sp->next) {
       sp->done = False;
       sp->mark = VG_(string_match)( sp->from_sopatt, 
-                                    VG_(seginfo_soname)(di) );
+                                    VG_(DebugInfo_get_soname)(di) );
       anyMark = anyMark || sp->mark;
    }
 
@@ -510,10 +510,10 @@ void generate_and_add_actives (
 
    /* Iterate outermost over the symbols in the seginfo, in the hope
       of trashing the caches less. */
-   nsyms = VG_(seginfo_syms_howmany)( di );
+   nsyms = VG_(DebugInfo_syms_howmany)( di );
    for (i = 0; i < nsyms; i++) {
-      VG_(seginfo_syms_getidx)( di, i,
-                                &sym_addr, NULL, NULL, &sym_name, &isText );
+      VG_(DebugInfo_syms_getidx)( di, i, &sym_addr, NULL, NULL,
+                                         &sym_name, &isText );
 
       /* ignore data symbols */
       if (!isText)
@@ -577,7 +577,8 @@ void generate_and_add_actives (
       VG_(printf)(
       "%swas not found whilst processing\n", v);
       VG_(printf)(
-      "%ssymbols from the object with soname: %s\n", v, VG_(seginfo_soname)(di));
+      "%ssymbols from the object with soname: %s\n",
+      v, VG_(DebugInfo_get_soname)(di));
       VG_(printf)(
       "%s\n", v);
       VG_(printf)(
@@ -846,7 +847,7 @@ static void add_hardwired_spec ( HChar* sopatt, HChar* fnpatt,
 void VG_(redir_initialise) ( void )
 {
    // Assert that there are no DebugInfos so far
-   vg_assert( VG_(next_seginfo)(NULL) == NULL );
+   vg_assert( VG_(next_DebugInfo)(NULL) == NULL );
 
    // Initialise active mapping.
    activeSet = VG_(OSetGen_Create)(offsetof(Active, from_addr),
@@ -1117,8 +1118,9 @@ static void show_redir_state ( HChar* who )
    for (ts = topSpecs; ts; ts = ts->next) {
       VG_(message)(Vg_DebugMsg, 
                    "   TOPSPECS of soname %s\n",
-                   ts->seginfo ? (HChar*)VG_(seginfo_soname)(ts->seginfo)
-                               : "(hardwired)" );
+                   ts->seginfo
+                      ? (HChar*)VG_(DebugInfo_get_soname)(ts->seginfo)
+                      : "(hardwired)" );
       for (sp = ts->specs; sp; sp = sp->next)
          show_spec("     ", sp);
    }
index b7a5dd76827b10ff2c6b211fbf16ebc927311c46..2e0259747627ae64cd2811c7eeff01c0ea92ddda 100644 (file)
@@ -160,8 +160,8 @@ void drd_report_data_race(Error* const err, const DataRaceErrInfo* const dri)
       char sect_name[64];
       VgSectKind sect_kind;
 
-      sect_kind = VG_(seginfo_sect_kind)(sect_name, sizeof(sect_name),
-                                         dri->addr);
+      sect_kind = VG_(DebugInfo_sect_kind)(sect_name, sizeof(sect_name),
+                                           dri->addr);
       if (sect_kind != Vg_SectUnknown)
       {
          VG_(message)(Vg_UserMsg,
index 5a03084ceb09dc7a85d8f7e57ff71fc04b15dde7..930827ee2f7ecb23217b30410849608f43a2b27f 100644 (file)
@@ -472,7 +472,7 @@ IRSB* DRD_(instrument)(VgCallbackClosure* const closure,
          /* relocated in another way than by later binutils versions. The  */
          /* linker e.g. does not generate .got.plt sections on CentOS 3.0. */
       case Ist_IMark:
-         instrument = VG_(seginfo_sect_kind)(NULL, 0, st->Ist.IMark.addr)
+         instrument = VG_(DebugInfo_sect_kind)(NULL, 0, st->Ist.IMark.addr)
             != Vg_SectPLT;
          addStmtToIRSB(bb, st);
          break;
index 64536facce9522483967aaa2cdec3f8fdc680894..82deb9dc8b1035cb918cc020918311b20d0a26a7 100644 (file)
@@ -367,32 +367,32 @@ static void DRD_(suppress_relocation_conflicts)(const Addr a, const SizeT len)
    VG_(printf)("Evaluating range @ 0x%lx size %ld\n", a, len);
 #endif
 
-   for (di = VG_(next_seginfo)(0); di; di = VG_(next_seginfo)(di))
+   for (di = VG_(next_DebugInfo)(0); di; di = VG_(next_DebugInfo)(di))
    {
       Addr  avma;
       SizeT size;
 
-      avma = VG_(seginfo_get_plt_avma)(di);
-      size = VG_(seginfo_get_plt_size)(di);
+      avma = VG_(DebugInfo_get_plt_avma)(di);
+      size = VG_(DebugInfo_get_plt_size)(di);
       tl_assert((avma && size) || (avma == 0 && size == 0));
       if (size > 0)
       {
 #if 0
          VG_(printf)("Suppressing .plt @ 0x%lx size %ld\n", avma, size);
 #endif
-         tl_assert(VG_(seginfo_sect_kind)(NULL, 0, avma) == Vg_SectPLT);
+         tl_assert(VG_(DebugInfo_sect_kind)(NULL, 0, avma) == Vg_SectPLT);
          DRD_(start_suppression)(avma, avma + size, ".plt");
       }
 
-      avma = VG_(seginfo_get_gotplt_avma)(di);
-      size = VG_(seginfo_get_gotplt_size)(di);
+      avma = VG_(DebugInfo_get_gotplt_avma)(di);
+      size = VG_(DebugInfo_get_gotplt_size)(di);
       tl_assert((avma && size) || (avma == 0 && size == 0));
       if (size > 0)
       {
 #if 0
          VG_(printf)("Suppressing .got.plt @ 0x%lx size %ld\n", avma, size);
 #endif
-         tl_assert(VG_(seginfo_sect_kind)(NULL, 0, avma) == Vg_SectGOTPLT);
+         tl_assert(VG_(DebugInfo_sect_kind)(NULL, 0, avma) == Vg_SectGOTPLT);
          DRD_(start_suppression)(avma, avma + size, ".gotplt");
       }
    }
index 92416915ddbb8a11f799b6cd39051f8294e5fbfc..6897e317e5bf807e112d0df2aee675acf19a847c 100644 (file)
@@ -344,7 +344,7 @@ void HG_(record_error_Race) ( Thread* thr,
       linked routine, into the table (or whatever) when it is called
       for the first time. */
    {
-     VgSectKind sect = VG_(seginfo_sect_kind)( NULL, 0, data_addr );
+     VgSectKind sect = VG_(DebugInfo_sect_kind)( NULL, 0, data_addr );
      if (0) VG_(printf)("XXXXXXXXX RACE on %#lx %s\n",
                         data_addr, VG_(pp_SectKind)(sect));
      /* SectPLT is required on ???-linux */
index d98b337a36f9bd0da2fa84475f4d6aec5732a31c..f99d38abad4b878082bf539bd9e9b11368221d3c 100644 (file)
@@ -3703,10 +3703,10 @@ static Bool is_in_dynamic_linker_shared_object( Addr64 ga )
    const UChar* soname;
    if (0) return False;
 
-   dinfo  = VG_(find_seginfo)( (Addr)ga );
+   dinfo = VG_(find_DebugInfo)( (Addr)ga );
    if (!dinfo) return False;
 
-   soname = VG_(seginfo_soname)(dinfo);
+   soname = VG_(DebugInfo_get_soname)(dinfo);
    tl_assert(soname);
    if (0) VG_(printf)("%s\n", soname);
 
index a55bca0618b456b3ed158bd8aa15ec75a510ec60..a02b79015dcd434561a64f83ddc1ac2de7388663 100644 (file)
@@ -170,44 +170,49 @@ VG_(di_get_global_blocks_from_dihandle) ( ULong di_handle,
 
 
 /*====================================================================*/
-/*=== Obtaining segment information                                ===*/
+/*=== Obtaining debug information                                  ===*/
 /*====================================================================*/
 
-/* A way to get information about what segments are mapped */
-typedef struct _DebugInfo DebugInfo;
+/* A way to make limited debuginfo queries on a per-mapped-object
+   basis. */
+typedef  struct _DebugInfo  DebugInfo;
 
 /* Returns NULL if the DebugInfo isn't found.  It doesn't matter if
    debug info is present or not. */
-extern       DebugInfo* VG_(find_seginfo)      ( Addr a );
+DebugInfo* VG_(find_DebugInfo) ( Addr a );
 
 /* Fish bits out of DebugInfos. */
-extern       Addr     VG_(seginfo_get_text_avma)( const DebugInfo *di );
-extern       SizeT    VG_(seginfo_get_text_size)( const DebugInfo *di );
-extern       Addr     VG_(seginfo_get_plt_avma) ( const DebugInfo *di );
-extern       SizeT    VG_(seginfo_get_plt_size) ( const DebugInfo *di );
-extern       Addr     VG_(seginfo_get_gotplt_avma)( const DebugInfo *di );
-extern       SizeT    VG_(seginfo_get_gotplt_size)( const DebugInfo *di );
-extern const UChar*   VG_(seginfo_soname)       ( const DebugInfo *di );
-extern const UChar*   VG_(seginfo_filename)     ( const DebugInfo *di );
-extern       PtrdiffT VG_(seginfo_get_text_bias)( const DebugInfo *di );
-
-/* Function for traversing the seginfo list.  When called with NULL it
-   returns the first element; otherwise it returns the given element's
-   successor. */
-extern const DebugInfo* VG_(next_seginfo)    ( const DebugInfo *di );
+Addr          VG_(DebugInfo_get_text_avma)   ( const DebugInfo *di );
+SizeT         VG_(DebugInfo_get_text_size)   ( const DebugInfo *di );
+Addr          VG_(DebugInfo_get_plt_avma)    ( const DebugInfo *di );
+SizeT         VG_(DebugInfo_get_plt_size)    ( const DebugInfo *di );
+Addr          VG_(DebugInfo_get_gotplt_avma) ( const DebugInfo *di );
+SizeT         VG_(DebugInfo_get_gotplt_size) ( const DebugInfo *di );
+const UChar*  VG_(DebugInfo_get_soname)      ( const DebugInfo *di );
+const UChar*  VG_(DebugInfo_get_filename)    ( const DebugInfo *di );
+PtrdiffT      VG_(DebugInfo_get_text_bias)   ( const DebugInfo *di );
+
+/* Function for traversing the DebugInfo list.  When called with NULL
+   it returns the first element; otherwise it returns the given
+   element's successor.  Note that the order of elements in the list
+   changes in response to most of the queries listed in this header,
+   that explicitly or implicitly have to search the list for a
+   particular code address.  So it isn't safe to assume that the order
+   of the list stays constant. */
+const DebugInfo* VG_(next_DebugInfo)    ( const DebugInfo *di );
 
 /* Functions for traversing all the symbols in a DebugInfo.  _howmany
    tells how many there are.  _getidx retrieves the n'th, for n in 0
    .. _howmany-1.  You may not modify the function name thereby
    acquired; if you want to do so, first strdup it. */
-extern Int  VG_(seginfo_syms_howmany) ( const DebugInfo *di );
-extern void VG_(seginfo_syms_getidx)  ( const DebugInfo *di, 
-                                        Int idx,
-                                        /*OUT*/Addr*   avma,
-                                        /*OUT*/Addr*   tocptr,
-                                        /*OUT*/UInt*   size,
-                                        /*OUT*/HChar** name,
-                                        /*OUT*/Bool*   isText );
+Int  VG_(DebugInfo_syms_howmany) ( const DebugInfo *di );
+void VG_(DebugInfo_syms_getidx)  ( const DebugInfo *di, 
+                                   Int idx,
+                                   /*OUT*/Addr*   avma,
+                                   /*OUT*/Addr*   tocptr,
+                                   /*OUT*/UInt*   size,
+                                   /*OUT*/HChar** name,
+                                   /*OUT*/Bool*   isText );
 
 /* A simple enumeration to describe the 'kind' of various kinds of
    segments that arise from the mapping of object files. */
@@ -226,16 +231,14 @@ typedef
 
 /* Convert a VgSectKind to a string, which must be copied if you want
    to change it. */
-extern
 const HChar* VG_(pp_SectKind)( VgSectKind kind );
 
 /* Given an address 'a', make a guess of which section of which object
    it comes from.  If name is non-NULL, then the last n_name-1
    characters of the object's name is put in name[0 .. n_name-2], and
    name[n_name-1] is set to zero (guaranteed zero terminated). */
-extern 
-VgSectKind VG_(seginfo_sect_kind)( /*OUT*/UChar* name, SizeT n_name, 
-                                   Addr a);
+VgSectKind VG_(DebugInfo_sect_kind)( /*OUT*/UChar* name, SizeT n_name, 
+                                     Addr a);
 
 
 #endif   // __PUB_TOOL_DEBUGINFO_H
index 0d54a1008be3d8c4395cc8b5575dbbf860914fed..f646a9663005979f801906952241fba31a8556c8 100644 (file)
@@ -1161,8 +1161,8 @@ static void describe_addr ( Addr a, /*OUT*/AddrInfo* ai )
    VG_(memset)( &ai->Addr.SectKind.objname, 
                 0, sizeof(ai->Addr.SectKind.objname));
    VG_(strcpy)( ai->Addr.SectKind.objname, "???" );
-   sect = VG_(seginfo_sect_kind)( &ai->Addr.SectKind.objname[0],
-                                  sizeof(ai->Addr.SectKind.objname)-1, a);
+   sect = VG_(DebugInfo_sect_kind)( &ai->Addr.SectKind.objname[0],
+                                    sizeof(ai->Addr.SectKind.objname)-1, a);
    if (sect != Vg_SectUnknown) {
       ai->tag = Addr_SectKind;
       ai->Addr.SectKind.kind = sect;