summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2009-07-31 09:41:29 +0000
committersewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2009-07-31 09:41:29 +0000
commite3f1e5988a94af9230f67273ca9236c4d7e8b8da (patch)
tree5add2542114160488e02a01405dd91b0d0c73c04
parent49e05bc5332d1a4516c9c9df44cfb5091a330647 (diff)
(almost completely just function renaming):
* 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 a5019735-40e9-0310-863c-91ae7b9d1cf9
-rw-r--r--callgrind/bb.c10
-rw-r--r--callgrind/debug.c2
-rw-r--r--callgrind/fn.c17
-rw-r--r--coregrind/m_debuginfo/debuginfo.c49
-rw-r--r--coregrind/m_redir.c30
-rw-r--r--drd/drd_error.c4
-rw-r--r--drd/drd_load_store.c2
-rw-r--r--drd/drd_main.c14
-rw-r--r--helgrind/hg_errors.c2
-rw-r--r--helgrind/hg_main.c4
-rw-r--r--include/pub_tool_debuginfo.h63
-rw-r--r--memcheck/mc_errors.c4
12 files changed, 106 insertions, 95 deletions
diff --git a/callgrind/bb.c b/callgrind/bb.c
index 2dca73e0..7bea5b38 100644
--- a/callgrind/bb.c
+++ b/callgrind/bb.c
@@ -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;
diff --git a/callgrind/debug.c b/callgrind/debug.c
index 2ac38a29..ab4fdb55 100644
--- a/callgrind/debug.c
+++ b/callgrind/debug.c
@@ -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;
diff --git a/callgrind/fn.c b/callgrind/fn.c
index 0845a130..6ed6f600 100644
--- a/callgrind/fn.c
+++ b/callgrind/fn.c
@@ -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);
diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c
index dfc9f316..e280b933 100644
--- a/coregrind/m_debuginfo/debuginfo.c
+++ b/coregrind/m_debuginfo/debuginfo.c
@@ -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,
diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c
index 6b8d60ce..a63a556a 100644
--- a/coregrind/m_redir.c
+++ b/coregrind/m_redir.c
@@ -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);
}
diff --git a/drd/drd_error.c b/drd/drd_error.c
index b7a5dd76..2e025974 100644
--- a/drd/drd_error.c
+++ b/drd/drd_error.c
@@ -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,
diff --git a/drd/drd_load_store.c b/drd/drd_load_store.c
index 5a03084c..930827ee 100644
--- a/drd/drd_load_store.c
+++ b/drd/drd_load_store.c
@@ -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;
diff --git a/drd/drd_main.c b/drd/drd_main.c
index 64536fac..82deb9dc 100644
--- a/drd/drd_main.c
+++ b/drd/drd_main.c
@@ -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");
}
}
diff --git a/helgrind/hg_errors.c b/helgrind/hg_errors.c
index 92416915..6897e317 100644
--- a/helgrind/hg_errors.c
+++ b/helgrind/hg_errors.c
@@ -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 */
diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c
index d98b337a..f99d38ab 100644
--- a/helgrind/hg_main.c
+++ b/helgrind/hg_main.c
@@ -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);
diff --git a/include/pub_tool_debuginfo.h b/include/pub_tool_debuginfo.h
index a55bca06..a02b7901 100644
--- a/include/pub_tool_debuginfo.h
+++ b/include/pub_tool_debuginfo.h
@@ -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
diff --git a/memcheck/mc_errors.c b/memcheck/mc_errors.c
index 0d54a100..f646a966 100644
--- a/memcheck/mc_errors.c
+++ b/memcheck/mc_errors.c
@@ -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;