|
From: <sv...@va...> - 2008-01-04 13:10:00
|
Author: sewardj
Date: 2008-01-04 13:09:44 +0000 (Fri, 04 Jan 2008)
New Revision: 7313
Log:
Rename the VG_AR_SYMTAB arena to VG_AR_DINFO to reflect more
accurately its purpose.
Modified:
branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c
branches/DATASYMS/coregrind/m_debuginfo/readdwarf.c
branches/DATASYMS/coregrind/m_debuginfo/readelf.c
branches/DATASYMS/coregrind/m_debuginfo/readstabs.c
branches/DATASYMS/coregrind/m_debuginfo/readxcoff.c
branches/DATASYMS/coregrind/m_debuginfo/storage.c
branches/DATASYMS/coregrind/m_mallocfree.c
branches/DATASYMS/coregrind/m_redir.c
branches/DATASYMS/coregrind/pub_core_mallocfree.h
Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-04 11:36:41 UTC (rev 7312)
+++ branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-04 13:09:44 UTC (rev 7313)
@@ -119,13 +119,13 @@
vg_assert(filename);
- si = VG_(arena_calloc)(VG_AR_SYMTAB, 1, sizeof(SegInfo));
+ si = VG_(arena_calloc)(VG_AR_DINFO, 1, sizeof(SegInfo));
si->text_start_avma = start;
si->text_size = size;
si->foffset = foffset;
- si->filename = VG_(arena_strdup)(VG_AR_SYMTAB, filename);
+ si->filename = VG_(arena_strdup)(VG_AR_DINFO, filename);
si->memname = memname
- ? VG_(arena_strdup)(VG_AR_SYMTAB, memname)
+ ? VG_(arena_strdup)(VG_AR_DINFO, memname)
: NULL;
/* Everything else -- pointers, sizes, arrays -- is zeroed by calloc.
@@ -151,17 +151,17 @@
{
struct strchunk *chunk, *next;
vg_assert(si != NULL);
- if (si->filename) VG_(arena_free)(VG_AR_SYMTAB, si->filename);
- if (si->symtab) VG_(arena_free)(VG_AR_SYMTAB, si->symtab);
- if (si->loctab) VG_(arena_free)(VG_AR_SYMTAB, si->loctab);
- if (si->cfsi) VG_(arena_free)(VG_AR_SYMTAB, si->cfsi);
+ if (si->filename) VG_(arena_free)(VG_AR_DINFO, si->filename);
+ if (si->symtab) VG_(arena_free)(VG_AR_DINFO, si->symtab);
+ if (si->loctab) VG_(arena_free)(VG_AR_DINFO, si->loctab);
+ if (si->cfsi) VG_(arena_free)(VG_AR_DINFO, si->cfsi);
if (si->cfsi_exprs) VG_(deleteXA)(si->cfsi_exprs);
for (chunk = si->strchunks; chunk != NULL; chunk = next) {
next = chunk->next;
- VG_(arena_free)(VG_AR_SYMTAB, chunk);
+ VG_(arena_free)(VG_AR_DINFO, chunk);
}
- VG_(arena_free)(VG_AR_SYMTAB, si);
+ VG_(arena_free)(VG_AR_DINFO, si);
}
@@ -354,7 +354,7 @@
if (!filename)
return;
- filename = VG_(arena_strdup)( VG_AR_SYMTAB, filename );
+ filename = VG_(arena_strdup)( VG_AR_DINFO, filename );
ok = (seg->kind == SkFileC || (seg->kind == SkFileV && allow_SkFileV))
&& seg->offset == 0
@@ -365,7 +365,7 @@
&& ML_(is_elf_object_file)( (const void*)seg->start );
if (!ok) {
- VG_(arena_free)(VG_AR_SYMTAB, filename);
+ VG_(arena_free)(VG_AR_DINFO, filename);
return;
}
@@ -379,7 +379,7 @@
/* acquire_syms_for_range makes its own copy of filename, so is
safe to free it. */
- VG_(arena_free)(VG_AR_SYMTAB, filename);
+ VG_(arena_free)(VG_AR_DINFO, filename);
}
Modified: branches/DATASYMS/coregrind/m_debuginfo/readdwarf.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/readdwarf.c 2008-01-04 11:36:41 UTC (rev 7312)
+++ branches/DATASYMS/coregrind/m_debuginfo/readdwarf.c 2008-01-04 13:09:44 UTC (rev 7313)
@@ -75,7 +75,7 @@
{
if (wa->tab) {
vg_assert(wa->tab_size > 0);
- VG_(arena_free)(VG_AR_SYMTAB, wa->tab);
+ VG_(arena_free)(VG_AR_DINFO, wa->tab);
}
init_WordArray(wa);
}
@@ -97,14 +97,14 @@
vg_assert( (wa->tab_size == 0 && wa->tab == NULL)
|| (wa->tab_size != 0 && wa->tab != NULL) );
new_size = wa->tab_size == 0 ? 8 : 2 * wa->tab_size;
- new_tab = VG_(arena_malloc)(VG_AR_SYMTAB,
+ new_tab = VG_(arena_malloc)(VG_AR_DINFO,
new_size * sizeof(Word));
vg_assert(new_tab != NULL);
for (i = 0; i < wa->tab_used; i++)
new_tab[i] = wa->tab[i];
wa->tab_size = new_size;
if (wa->tab)
- VG_(arena_free)(VG_AR_SYMTAB, wa->tab);
+ VG_(arena_free)(VG_AR_DINFO, wa->tab);
wa->tab = new_tab;
}
@@ -1948,10 +1948,10 @@
}
static void* symtab_alloc ( SizeT szB ) {
- return VG_(arena_malloc)( VG_AR_SYMTAB, szB );
+ return VG_(arena_malloc)( VG_AR_DINFO, szB );
}
static void symtab_free ( void* v ) {
- VG_(arena_free)( VG_AR_SYMTAB, v );
+ VG_(arena_free)( VG_AR_DINFO, v );
}
static void initUnwindContext ( /*OUT*/UnwindContext* ctx )
Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-04 11:36:41 UTC (rev 7312)
+++ branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-04 13:09:44 UTC (rev 7313)
@@ -477,10 +477,10 @@
return (Word)VG_(strcmp)(key1->name, elem2->key.name);
}
static void* oset_malloc ( SizeT szB ) {
- return VG_(arena_malloc)(VG_AR_SYMTAB, szB);
+ return VG_(arena_malloc)(VG_AR_DINFO, szB);
}
static void oset_free ( void* p ) {
- VG_(arena_free)(VG_AR_SYMTAB, p);
+ VG_(arena_free)(VG_AR_DINFO, p);
}
static
@@ -776,7 +776,7 @@
static
Addr find_debug_file( Char* objpath, Char* debugname, UInt crc, UInt* size )
{
- Char *objdir = VG_(arena_strdup)(VG_AR_SYMTAB, objpath);
+ Char *objdir = VG_(arena_strdup)(VG_AR_DINFO, objpath);
Char *objdirptr;
Char *debugpath;
Addr addr = 0;
@@ -784,7 +784,7 @@
if ((objdirptr = VG_(strrchr)(objdir, '/')) != NULL)
*objdirptr = '\0';
- debugpath = VG_(arena_malloc)(VG_AR_SYMTAB, VG_(strlen)(objdir) + VG_(strlen)(debugname) + 16);
+ debugpath = VG_(arena_malloc)(VG_AR_DINFO, VG_(strlen)(objdir) + VG_(strlen)(debugname) + 16);
VG_(sprintf)(debugpath, "%s/%s", objdir, debugname);
@@ -796,8 +796,8 @@
}
}
- VG_(arena_free)(VG_AR_SYMTAB, debugpath);
- VG_(arena_free)(VG_AR_SYMTAB, objdir);
+ VG_(arena_free)(VG_AR_DINFO, debugpath);
+ VG_(arena_free)(VG_AR_DINFO, objdir);
return addr;
}
@@ -925,7 +925,7 @@
if (stroff != -1 && strtab != 0) {
TRACE_SYMTAB("soname=%s\n", strtab+stroff);
- si->soname = VG_(arena_strdup)(VG_AR_SYMTAB, strtab+stroff);
+ si->soname = VG_(arena_strdup)(VG_AR_DINFO, strtab+stroff);
}
}
Modified: branches/DATASYMS/coregrind/m_debuginfo/readstabs.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/readstabs.c 2008-01-04 11:36:41 UTC (rev 7312)
+++ branches/DATASYMS/coregrind/m_debuginfo/readstabs.c 2008-01-04 13:09:44 UTC (rev 7313)
@@ -176,11 +176,11 @@
qbuflen = 16;
while ((qidx + qlen) >= qbuflen)
qbuflen *= 2;
- n = VG_(arena_malloc)(VG_AR_SYMTAB, qbuflen);
+ n = VG_(arena_malloc)(VG_AR_DINFO, qbuflen);
VG_(memcpy)(n, qbuf, qidx);
if (qbuf != NULL)
- VG_(arena_free)(VG_AR_SYMTAB, qbuf);
+ VG_(arena_free)(VG_AR_DINFO, qbuf);
qbuf = n;
}
@@ -207,7 +207,7 @@
if (qbuf != NULL) {
i--; /* overstepped */
string = ML_(addStr)(si, qbuf, qidx);
- VG_(arena_free)(VG_AR_SYMTAB, qbuf);
+ VG_(arena_free)(VG_AR_DINFO, qbuf);
if (contdebug)
VG_(printf)("made composite: \"%s\"\n", string);
}
Modified: branches/DATASYMS/coregrind/m_debuginfo/readxcoff.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/readxcoff.c 2008-01-04 11:36:41 UTC (rev 7312)
+++ branches/DATASYMS/coregrind/m_debuginfo/readxcoff.c 2008-01-04 13:09:44 UTC (rev 7313)
@@ -494,10 +494,10 @@
}
static void* malloc_AR_SYMTAB ( SizeT nbytes ) {
- return VG_(arena_malloc)(VG_AR_SYMTAB, nbytes);
+ return VG_(arena_malloc)(VG_AR_DINFO, nbytes);
}
static void free_AR_SYMTAB ( void* ptr ) {
- return VG_(arena_free)(VG_AR_SYMTAB, ptr);
+ return VG_(arena_free)(VG_AR_DINFO, ptr);
}
/* Read symbol and line number info for the given text section. (This
@@ -2455,7 +2455,7 @@
si->soname = so;
} else {
/* no member name, hence soname = "archive.a" */
- si->soname = VG_(arena_strdup)(VG_AR_SYMTAB, p);
+ si->soname = VG_(arena_strdup)(VG_AR_DINFO, p);
}
}
if (SHOW)
Modified: branches/DATASYMS/coregrind/m_debuginfo/storage.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/storage.c 2008-01-04 11:36:41 UTC (rev 7312)
+++ branches/DATASYMS/coregrind/m_debuginfo/storage.c 2008-01-04 13:09:44 UTC (rev 7313)
@@ -152,7 +152,7 @@
if (si->strchunks == NULL ||
(si->strchunks->strtab_used
+ space_needed) > SEGINFO_STRCHUNKSIZE) {
- chunk = VG_(arena_malloc)(VG_AR_SYMTAB, sizeof(*chunk));
+ chunk = VG_(arena_malloc)(VG_AR_DINFO, sizeof(*chunk));
chunk->strtab_used = 0;
chunk->next = si->strchunks;
si->strchunks = chunk;
@@ -181,11 +181,11 @@
if (si->symtab_used == si->symtab_size) {
new_sz = 2 * si->symtab_size;
if (new_sz == 0) new_sz = 500;
- new_tab = VG_(arena_malloc)(VG_AR_SYMTAB, new_sz * sizeof(DiSym) );
+ new_tab = VG_(arena_malloc)(VG_AR_DINFO, new_sz * sizeof(DiSym) );
if (si->symtab != NULL) {
for (i = 0; i < si->symtab_used; i++)
new_tab[i] = si->symtab[i];
- VG_(arena_free)(VG_AR_SYMTAB, si->symtab);
+ VG_(arena_free)(VG_AR_DINFO, si->symtab);
}
si->symtab = new_tab;
si->symtab_size = new_sz;
@@ -210,11 +210,11 @@
if (si->loctab_used == si->loctab_size) {
new_sz = 2 * si->loctab_size;
if (new_sz == 0) new_sz = 500;
- new_tab = VG_(arena_malloc)(VG_AR_SYMTAB, new_sz * sizeof(DiLoc) );
+ new_tab = VG_(arena_malloc)(VG_AR_DINFO, new_sz * sizeof(DiLoc) );
if (si->loctab != NULL) {
for (i = 0; i < si->loctab_used; i++)
new_tab[i] = si->loctab[i];
- VG_(arena_free)(VG_AR_SYMTAB, si->loctab);
+ VG_(arena_free)(VG_AR_DINFO, si->loctab);
}
si->loctab = new_tab;
si->loctab_size = new_sz;
@@ -366,11 +366,11 @@
if (si->cfsi_used == si->cfsi_size) {
new_sz = 2 * si->cfsi_size;
if (new_sz == 0) new_sz = 20;
- new_tab = VG_(arena_malloc)(VG_AR_SYMTAB, new_sz * sizeof(DiCfSI) );
+ new_tab = VG_(arena_malloc)(VG_AR_DINFO, new_sz * sizeof(DiCfSI) );
if (si->cfsi != NULL) {
for (i = 0; i < si->cfsi_used; i++)
new_tab[i] = si->cfsi[i];
- VG_(arena_free)(VG_AR_SYMTAB, si->cfsi);
+ VG_(arena_free)(VG_AR_DINFO, si->cfsi);
}
si->cfsi = new_tab;
si->cfsi_size = new_sz;
Modified: branches/DATASYMS/coregrind/m_mallocfree.c
===================================================================
--- branches/DATASYMS/coregrind/m_mallocfree.c 2008-01-04 11:36:41 UTC (rev 7312)
+++ branches/DATASYMS/coregrind/m_mallocfree.c 2008-01-04 13:09:44 UTC (rev 7313)
@@ -518,7 +518,7 @@
// Initialise the non-client arenas
arena_init ( VG_AR_CORE, "core", 4, 1048576 );
arena_init ( VG_AR_TOOL, "tool", 4, 4194304 );
- arena_init ( VG_AR_SYMTAB, "symtab", 4, 1048576 );
+ arena_init ( VG_AR_DINFO, "dinfo", 4, 1048576 );
arena_init ( VG_AR_DEMANGLE, "demangle", 4, 65536 );
arena_init ( VG_AR_EXECTXT, "exectxt", 4, 1048576 );
arena_init ( VG_AR_ERRORS, "errors", 4, 65536 );
Modified: branches/DATASYMS/coregrind/m_redir.c
===================================================================
--- branches/DATASYMS/coregrind/m_redir.c 2008-01-04 11:36:41 UTC (rev 7312)
+++ branches/DATASYMS/coregrind/m_redir.c 2008-01-04 13:09:44 UTC (rev 7313)
@@ -280,9 +280,9 @@
static void maybe_add_active ( Active /*by value; callee copies*/ );
-static void* symtab_zalloc(SizeT);
-static void symtab_free(void*);
-static HChar* symtab_strdup(HChar*);
+static void* dinfo_zalloc(SizeT);
+static void dinfo_free(void*);
+static HChar* dinfo_strdup(HChar*);
static Bool is_plausible_guest_addr(Addr);
static Bool is_aix5_glink_idiom(Addr);
@@ -365,10 +365,10 @@
the following loop, and complain at that point. */
continue;
}
- spec = symtab_zalloc(sizeof(Spec));
+ spec = dinfo_zalloc(sizeof(Spec));
vg_assert(spec);
- spec->from_sopatt = symtab_strdup(demangled_sopatt);
- spec->from_fnpatt = symtab_strdup(demangled_fnpatt);
+ spec->from_sopatt = dinfo_strdup(demangled_sopatt);
+ spec->from_fnpatt = dinfo_strdup(demangled_fnpatt);
vg_assert(spec->from_sopatt);
vg_assert(spec->from_fnpatt);
spec->to_addr = sym_addr;
@@ -412,7 +412,7 @@
/* Ok. Now specList holds the list of specs from the SegInfo.
Build a new TopSpec, but don't add it to topSpecs yet. */
- newts = symtab_zalloc(sizeof(TopSpec));
+ newts = dinfo_zalloc(sizeof(TopSpec));
vg_assert(newts);
newts->next = NULL; /* not significant */
newts->seginfo = newsi;
@@ -680,7 +680,7 @@
/* Traverse the actives, copying the addresses of those we intend
to delete into tmpSet. */
- tmpSet = VG_(OSetWord_Create)(symtab_zalloc, symtab_free);
+ tmpSet = VG_(OSetWord_Create)(dinfo_zalloc, dinfo_free);
ts->mark = True;
@@ -729,10 +729,10 @@
/* The Actives set is now cleaned up. Free up this TopSpec and
everything hanging off it. */
for (sp = ts->specs; sp; sp = sp_next) {
- if (sp->from_sopatt) symtab_free(sp->from_sopatt);
- if (sp->from_fnpatt) symtab_free(sp->from_fnpatt);
+ if (sp->from_sopatt) dinfo_free(sp->from_sopatt);
+ if (sp->from_fnpatt) dinfo_free(sp->from_fnpatt);
sp_next = sp->next;
- symtab_free(sp);
+ dinfo_free(sp);
}
if (tsPrev == NULL) {
@@ -741,7 +741,7 @@
} else {
tsPrev->next = ts->next;
}
- symtab_free(ts);
+ dinfo_free(ts);
if (VG_(clo_trace_redir))
show_redir_state("after VG_(redir_notify_delete_SegInfo)");
@@ -798,11 +798,11 @@
Addr to_addr,
HChar* mandatory )
{
- Spec* spec = symtab_zalloc(sizeof(Spec));
+ Spec* spec = dinfo_zalloc(sizeof(Spec));
vg_assert(spec);
if (topSpecs == NULL) {
- topSpecs = symtab_zalloc(sizeof(TopSpec));
+ topSpecs = dinfo_zalloc(sizeof(TopSpec));
vg_assert(topSpecs);
/* symtab_zalloc sets all fields to zero */
}
@@ -839,8 +839,8 @@
// Initialise active mapping.
activeSet = VG_(OSetGen_Create)(offsetof(Active, from_addr),
NULL, // Use fast comparison
- symtab_zalloc,
- symtab_free);
+ dinfo_zalloc,
+ dinfo_free);
// The rest of this function just adds initial Specs.
@@ -937,23 +937,23 @@
/*--- MISC HELPERS ---*/
/*------------------------------------------------------------*/
-static void* symtab_zalloc(SizeT n) {
+static void* dinfo_zalloc(SizeT n) {
void* p;
vg_assert(n > 0);
- p = VG_(arena_malloc)(VG_AR_SYMTAB, n);
+ p = VG_(arena_malloc)(VG_AR_DINFO, n);
tl_assert(p);
VG_(memset)(p, 0, n);
return p;
}
-static void symtab_free(void* p) {
+static void dinfo_free(void* p) {
tl_assert(p);
- return VG_(arena_free)(VG_AR_SYMTAB, p);
+ return VG_(arena_free)(VG_AR_DINFO, p);
}
-static HChar* symtab_strdup(HChar* str)
+static HChar* dinfo_strdup(HChar* str)
{
- return VG_(arena_strdup)(VG_AR_SYMTAB, str);
+ return VG_(arena_strdup)(VG_AR_DINFO, str);
}
/* Really this should be merged with translations_allowable_from_seg
Modified: branches/DATASYMS/coregrind/pub_core_mallocfree.h
===================================================================
--- branches/DATASYMS/coregrind/pub_core_mallocfree.h 2008-01-04 11:36:41 UTC (rev 7312)
+++ branches/DATASYMS/coregrind/pub_core_mallocfree.h 2008-01-04 13:09:44 UTC (rev 7313)
@@ -42,7 +42,7 @@
CORE for the core's general use.
TOOL for the tool to use (and the only one it uses).
- SYMTAB for Valgrind's symbol table storage.
+ DINFO for debug info (symbols, line #s, CFI, etc) storage.
CLIENT for the client's mallocs/frees, if the tool replaces glibc's
malloc() et al -- redzone size is chosen by the tool.
DEMANGLE for the C++ demangler.
@@ -59,7 +59,7 @@
#define VG_AR_CORE 0
#define VG_AR_TOOL 1
-#define VG_AR_SYMTAB 2
+#define VG_AR_DINFO 2
#define VG_AR_CLIENT 3
#define VG_AR_DEMANGLE 4
#define VG_AR_EXECTXT 5
|