|
From: <sv...@va...> - 2014-10-22 17:42:46
|
Author: florian
Date: Wed Oct 22 18:42:37 2014
New Revision: 14654
Log:
Change VG_(allocEltDedupPA) to return a pointer to const. The reason is
that once an element has been allocated and added to the pool it must
not be modified afterwards. See the documentation in pub_tool_deduppoolalloc.h
The rest of the patch is ripple.
Modified:
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/coregrind/m_debuginfo/priv_storage.h
trunk/coregrind/m_debuginfo/readdwarf.c
trunk/coregrind/m_debuginfo/readdwarf3.c
trunk/coregrind/m_debuginfo/readelf.c
trunk/coregrind/m_debuginfo/readpdb.c
trunk/coregrind/m_debuginfo/storage.c
trunk/coregrind/m_deduppoolalloc.c
trunk/coregrind/m_demangle/demangle.c
trunk/coregrind/m_redir.c
trunk/coregrind/pub_core_debuginfo.h
trunk/coregrind/pub_core_demangle.h
trunk/include/pub_tool_deduppoolalloc.h
Modified: trunk/coregrind/m_debuginfo/debuginfo.c
==============================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c (original)
+++ trunk/coregrind/m_debuginfo/debuginfo.c Wed Oct 22 18:42:37 2014
@@ -2119,14 +2119,14 @@
continue;
}
for (i = 0; i < si->symtab_used; i++) {
- HChar* pri_name = si->symtab[i].pri_name;
+ const HChar* pri_name = si->symtab[i].pri_name;
vg_assert(pri_name);
if (0==VG_(strcmp)(name, pri_name)
&& (require_pToc ? GET_TOCPTR_AVMA(si->symtab[i].avmas) : True)) {
*avmas = si->symtab[i].avmas;
return True;
}
- HChar** sec_names = si->symtab[i].sec_names;
+ const HChar** sec_names = si->symtab[i].sec_names;
if (sec_names) {
vg_assert(sec_names[0]);
while (*sec_names) {
@@ -4249,8 +4249,8 @@
Int idx,
/*OUT*/SymAVMAs* avmas,
/*OUT*/UInt* size,
- /*OUT*/HChar** pri_name,
- /*OUT*/HChar*** sec_names,
+ /*OUT*/const HChar** pri_name,
+ /*OUT*/const HChar*** sec_names,
/*OUT*/Bool* isText,
/*OUT*/Bool* isIFunc )
{
@@ -4258,7 +4258,7 @@
if (avmas) *avmas = si->symtab[idx].avmas;
if (size) *size = si->symtab[idx].size;
if (pri_name) *pri_name = si->symtab[idx].pri_name;
- if (sec_names) *sec_names = (HChar **)si->symtab[idx].sec_names; // FIXME
+ if (sec_names) *sec_names = si->symtab[idx].sec_names;
if (isText) *isText = si->symtab[idx].isText;
if (isIFunc) *isIFunc = si->symtab[idx].isIFunc;
}
Modified: trunk/coregrind/m_debuginfo/priv_storage.h
==============================================================================
--- trunk/coregrind/m_debuginfo/priv_storage.h (original)
+++ trunk/coregrind/m_debuginfo/priv_storage.h Wed Oct 22 18:42:37 2014
@@ -73,8 +73,8 @@
SymAVMAs avmas; /* Symbol Actual VMAs: lowest address of entity,
+ platform specific fields, to access with
the macros defined in pub_core_debuginfo.h */
- HChar* pri_name; /* primary name, never NULL */
- HChar** sec_names; /* NULL, or a NULL term'd array of other names */
+ const HChar* pri_name; /* primary name, never NULL */
+ const HChar** sec_names; /* NULL, or a NULL term'd array of other names */
// XXX: this could be shrunk (on 32-bit platforms) by using 30
// bits for the size and 1 bit each for isText and isIFunc. If you
// do this, make sure that all assignments to the latter two use
@@ -476,7 +476,7 @@
typedef
struct {
- HChar* name; /* in DebugInfo.strpool */
+ const HChar* name; /* in DebugInfo.strpool */
UWord typeR; /* a cuOff */
GExpr* gexpr; /* on DebugInfo.gexprs list */
GExpr* fbGX; /* SHARED. */
@@ -1045,18 +1045,18 @@
/* Add a string to the string table of a DebugInfo. If len==-1,
ML_(addStr) will itself measure the length of the string. */
-extern HChar* ML_(addStr) ( struct _DebugInfo* di, const HChar* str, Int len );
+extern const HChar* ML_(addStr) ( DebugInfo* di, const HChar* str, Int len );
/* Add a string to the string table of a DebugInfo, by copying the
string from the given DiCursor. Measures the length of the string
itself. */
-extern HChar* ML_(addStrFromCursor)( struct _DebugInfo* di, DiCursor c );
+extern const HChar* ML_(addStrFromCursor)( DebugInfo* di, DiCursor c );
extern void ML_(addVar)( struct _DebugInfo* di,
Int level,
Addr aMin,
Addr aMax,
- HChar* name,
+ const HChar* name,
UWord typeR, /* a cuOff */
GExpr* gexpr,
GExpr* fbGX, /* SHARED. */
Modified: trunk/coregrind/m_debuginfo/readdwarf.c
==============================================================================
--- trunk/coregrind/m_debuginfo/readdwarf.c (original)
+++ trunk/coregrind/m_debuginfo/readdwarf.c Wed Oct 22 18:42:37 2014
@@ -71,7 +71,7 @@
/* if xa_ix is a valid index in dirname_xa,
return the element (i.e. the HChar*).
If xa_ix is invalid, return NULL. */
-static HChar* safe_dirname_ix (XArray* dirname_xa, Int xa_ix)
+static const HChar* safe_dirname_ix (XArray* dirname_xa, Int xa_ix)
{
if (xa_ix < 0) return NULL;
if (xa_ix >= VG_(sizeXA) (dirname_xa)) return NULL;
@@ -348,8 +348,8 @@
Bool is64;
XArray* fndn_ix_xa; /* xarray of UInt fndn_ix */
UInt fndn_ix;
- XArray* dirname_xa; /* xarray of HChar* dirname */
- HChar* dirname;
+ XArray* dirname_xa; /* xarray of const HChar* dirname */
+ const HChar* dirname;
DiCursor external = theBlock;
DiCursor data = theBlock;
Modified: trunk/coregrind/m_debuginfo/readdwarf3.c
==============================================================================
--- trunk/coregrind/m_debuginfo/readdwarf3.c (original)
+++ trunk/coregrind/m_debuginfo/readdwarf3.c Wed Oct 22 18:42:37 2014
@@ -1571,7 +1571,7 @@
typedef
struct _TempVar {
- HChar* name; /* in DebugInfo's .strpool */
+ const HChar* name; /* in DebugInfo's .strpool */
/* Represent ranges economically. nRanges is the number of
ranges. Cases:
0: .rngOneMin .rngOneMax .manyRanges are all zero
@@ -1838,7 +1838,7 @@
static
void read_filename_table( /*MOD*/XArray* /* of UInt* */ fndn_ix_Table,
- HChar* compdir,
+ const HChar* compdir,
CUConst* cc, ULong debug_line_offset,
Bool td3 )
{
@@ -1847,7 +1847,7 @@
Word i;
UShort version;
UChar opcode_base;
- HChar* str;
+ const HChar* str;
XArray* dirname_xa; /* xarray of HChar* dirname */
ULong dir_xa_ix; /* Index in dirname_xa, as read from dwarf info. */
HChar* dirname;
@@ -2067,7 +2067,7 @@
Addr ip_lo = 0;
Addr ip_hi1 = 0;
Addr rangeoff = 0;
- HChar *compdir = NULL;
+ const HChar *compdir = NULL;
nf_i = 0;
while (True) {
DW_AT attr = (DW_AT) abbv->nf[nf_i].at_name;
@@ -2248,7 +2248,7 @@
}
if (dtag == DW_TAG_variable || dtag == DW_TAG_formal_parameter) {
- HChar* name = NULL;
+ const HChar* name = NULL;
UWord typeR = D3_INVALID_CUOFF;
Bool global = False;
GExpr* gexpr = NULL;
@@ -2549,7 +2549,7 @@
table is kept, while we must handle all abbreviations in all CUs
referenced by an absori (being a reference to an alt CU, or a previous
or following CU). */
-static HChar* get_inlFnName (Int absori, CUConst* cc, Bool td3)
+static const HChar* get_inlFnName (Int absori, CUConst* cc, Bool td3)
{
Cursor c;
g_abbv *abbv;
@@ -2557,7 +2557,7 @@
UInt has_children;
UWord posn;
Bool type_flag, alt_flag;
- HChar *ret = NULL;
+ const HChar *ret = NULL;
FormContents cts;
UInt nf_i;
@@ -2675,7 +2675,7 @@
if (dtag == DW_TAG_compile_unit || dtag == DW_TAG_partial_unit) {
Bool have_lo = False;
Addr ip_lo = 0;
- HChar *compdir = NULL;
+ const HChar *compdir = NULL;
nf_i = 0;
while (True) {
@@ -2789,7 +2789,8 @@
/* This inlined call is several address ranges. */
XArray *ranges;
Word j;
- HChar *inlfnname = get_inlFnName (inlinedfn_abstract_origin, cc, td3);
+ const HChar *inlfnname =
+ get_inlFnName (inlinedfn_abstract_origin, cc, td3);
/* Ranges are biased for the inline info using the same logic
as what is used for biasing ranges for the var info, for which
Modified: trunk/coregrind/m_debuginfo/readelf.c
==============================================================================
--- trunk/coregrind/m_debuginfo/readelf.c (original)
+++ trunk/coregrind/m_debuginfo/readelf.c Wed Oct 22 18:42:37 2014
@@ -807,7 +807,7 @@
i,
disym.avmas.main,
(Int)disym.size,
- (HChar*)disym.pri_name
+ disym.pri_name
);
if (GET_LOCAL_EP_AVMA(disym.avmas) != 0) {
TRACE_SYMTAB(" local entry point %#010lx\n",
@@ -1042,7 +1042,7 @@
disym.avmas.main,
GET_TOCPTR_AVMA(disym.avmas),
(Int) disym.size,
- (HChar*)disym.pri_name
+ disym.pri_name
);
}
i++;
Modified: trunk/coregrind/m_debuginfo/readpdb.c
==============================================================================
--- trunk/coregrind/m_debuginfo/readpdb.c (original)
+++ trunk/coregrind/m_debuginfo/readpdb.c Wed Oct 22 18:42:37 2014
@@ -1211,7 +1211,7 @@
{
Int i, length;
DiSym vsym;
- HChar* nmstr;
+ const HChar* nmstr;
HChar symname[4096 /*WIN32_PATH_MAX*/];
Bool debug = di->trace_symtab;
@@ -1566,8 +1566,8 @@
this_seg = 0;
for (i = 0; i < nfile; i++) {
- HChar *fnmstr;
- HChar *dirstr;
+ const HChar *fnmstr;
+ const HChar *dirstr;
UInt fnmdirstr_ix;
/*
@@ -1715,7 +1715,7 @@
while ((HChar*)lbh < linetab + size) {
- HChar *filename, *dirname;
+ const HChar *filename, *dirname;
UInt filedirname_ix;
Addr svma_s, svma_e;
if (lbh->header != 0x000000f2) {
Modified: trunk/coregrind/m_debuginfo/storage.c
==============================================================================
--- trunk/coregrind/m_debuginfo/storage.c (original)
+++ trunk/coregrind/m_debuginfo/storage.c Wed Oct 22 18:42:37 2014
@@ -94,7 +94,7 @@
/* Print a symbol. */
void ML_(ppSym) ( Int idx, DiSym* sym )
{
- HChar** sec_names = sym->sec_names;
+ const HChar** sec_names = sym->sec_names;
vg_assert(sym->pri_name);
if (sec_names)
vg_assert(sec_names);
@@ -233,10 +233,8 @@
a chunking memory allocator rather than reallocating, so the
pointers are stable.
*/
-HChar* ML_(addStr) ( struct _DebugInfo* di, const HChar* str, Int len )
+const HChar* ML_(addStr) ( DebugInfo* di, const HChar* str, Int len )
{
- HChar* p;
-
if (len == -1) {
len = VG_(strlen)(str);
} else {
@@ -248,8 +246,7 @@
ML_(dinfo_zalloc),
"di.storage.addStr.1",
ML_(dinfo_free));
- p = VG_(allocEltDedupPA) (di->strpool, len+1, str);
- return p;
+ return VG_(allocEltDedupPA) (di->strpool, len+1, str);
}
UInt ML_(addFnDn) (struct _DebugInfo* di,
@@ -301,13 +298,13 @@
/* Add a string to the string table of a DebugInfo, by copying the
string from the given DiCursor. Measures the length of the string
itself. */
-HChar* ML_(addStrFromCursor)( struct _DebugInfo* di, DiCursor c )
+const HChar* ML_(addStrFromCursor)( DebugInfo* di, DiCursor c )
{
/* This is a less-than-stellar implementation, but it should
work. */
vg_assert(ML_(cur_is_valid)(c));
HChar* str = ML_(cur_read_strdup)(c, "di.addStrFromCursor.1");
- HChar* res = ML_(addStr)(di, str, -1);
+ const HChar* res = ML_(addStr)(di, str, -1);
ML_(dinfo_free)(str);
return res;
}
@@ -1145,7 +1142,7 @@
Int level,
Addr aMin,
Addr aMax,
- HChar* name, /* in di's .strpool */
+ const HChar* name, /* in di's .strpool */
UWord typeR, /* a cuOff */
GExpr* gexpr,
GExpr* fbGX,
@@ -1419,8 +1416,8 @@
preferred.
*/
static
-Bool preferName ( struct _DebugInfo* di,
- HChar* a_name, HChar* b_name,
+Bool preferName ( DebugInfo* di,
+ const HChar* a_name, const HChar* b_name,
Addr sym_avma/*exposition only*/ )
{
Word cmp;
@@ -1481,7 +1478,7 @@
{
Bool blankA = True;
Bool blankB = True;
- HChar *s;
+ const HChar *s;
s = a_name;
while (*s) {
if (!VG_(isspace)(*s++)) {
@@ -1565,8 +1562,8 @@
vg_assert(from->pri_name);
/* Figure out how many names there will be in the new combined
secondary vector. */
- HChar** to_sec = to->sec_names;
- HChar** from_sec = from->sec_names;
+ const HChar** to_sec = to->sec_names;
+ const HChar** from_sec = from->sec_names;
Word n_new_sec = 1;
if (from_sec) {
while (*from_sec) {
@@ -1584,8 +1581,8 @@
TRACE_SYMTAB("merge: -> %ld\n", n_new_sec);
/* Create the new sec and copy stuff into it, putting the new
entries at the end. */
- HChar** new_sec = ML_(dinfo_zalloc)( "di.storage.aDntf.1",
- (n_new_sec+1) * sizeof(HChar*) );
+ const HChar** new_sec = ML_(dinfo_zalloc)( "di.storage.aDntf.1",
+ (n_new_sec+1) * sizeof(HChar*) );
from_sec = from->sec_names;
to_sec = to->sec_names;
Word i = 0;
@@ -1616,7 +1613,7 @@
{
Word i, j, n_truncated;
Addr sta1, sta2, end1, end2, toc1, toc2;
- HChar *pri1, *pri2, **sec1, **sec2;
+ const HChar *pri1, *pri2, **sec1, **sec2;
Bool ist1, ist2, isf1, isf2;
# define SWAP(ty,aa,bb) \
@@ -1742,7 +1739,7 @@
if (end1 > end2) {
sta1 = end2 + 1;
SWAP(Addr,sta1,sta2); SWAP(Addr,end1,end2); SWAP(Addr,toc1,toc2);
- SWAP(HChar*,pri1,pri2); SWAP(HChar**,sec1,sec2);
+ SWAP(const HChar*,pri1,pri2); SWAP(const HChar**,sec1,sec2);
SWAP(Bool,ist1,ist2); SWAP(Bool,isf1,isf2);
} else
if (end1 < end2) {
@@ -1813,7 +1810,7 @@
show the user. */
for (i = 0; i < ((Word)di->symtab_used)-1; i++) {
DiSym* sym = &di->symtab[i];
- HChar** sec = sym->sec_names;
+ const HChar** sec = sym->sec_names;
if (!sec)
continue;
/* Slow but simple. Copy all the cands into a temp array,
@@ -1821,8 +1818,8 @@
Word n_tmp = 1;
while (*sec) { n_tmp++; sec++; }
j = 0;
- HChar** tmp = ML_(dinfo_zalloc)( "di.storage.cS.1",
- (n_tmp+1) * sizeof(HChar*) );
+ const HChar** tmp = ML_(dinfo_zalloc)( "di.storage.cS.1",
+ (n_tmp+1) * sizeof(HChar*) );
tmp[j++] = sym->pri_name;
sec = sym->sec_names;
while (*sec) { tmp[j++] = *sec; sec++; }
@@ -1840,7 +1837,7 @@
vg_assert(best >= 0 && best < n_tmp);
/* Copy back */
sym->pri_name = tmp[best];
- HChar** cursor = sym->sec_names;
+ const HChar** cursor = sym->sec_names;
for (j = 0; j < n_tmp; j++) {
if (j == best)
continue;
Modified: trunk/coregrind/m_deduppoolalloc.c
==============================================================================
--- trunk/coregrind/m_deduppoolalloc.c (original)
+++ trunk/coregrind/m_deduppoolalloc.c Wed Oct 22 18:42:37 2014
@@ -76,7 +76,7 @@
struct _ht_node *next; // Read/Write by hashtable (pub_tool_hashtable.h)
UWord key; // Read by hashtable (pub_tool_hashtable.h)
SizeT eltSzB;
- void *elt;
+ const void *elt;
}
ht_node;
@@ -231,7 +231,8 @@
ddpa->ht_node_pa = NULL;
}
-void* VG_(allocEltDedupPA) (DedupPoolAlloc *ddpa, SizeT eltSzB, const void *elt)
+const void* VG_(allocEltDedupPA) (DedupPoolAlloc *ddpa, SizeT eltSzB,
+ const void *elt)
{
ht_node ht_elt;
void* elt_ins;
@@ -252,7 +253,7 @@
ht_elt.key = VG_(adler32) (ht_elt.key, elt, eltSzB);
ht_elt.eltSzB = eltSzB;
- ht_elt.elt = CONST_CAST(void *,elt);
+ ht_elt.elt = elt;
ht_ins = VG_(HT_gen_lookup) (ddpa->ht_elements, &ht_elt, cmp_pool_elt);
if (ht_ins)
@@ -298,7 +299,7 @@
ddpa->fixedSzb = eltSzB;
}
vg_assert (ddpa->fixedSzb == eltSzB);
- void *dedup_elt = VG_(allocEltDedupPA) (ddpa, eltSzB, elt);
+ const void *dedup_elt = VG_(allocEltDedupPA) (ddpa, eltSzB, elt);
return elt2nr (ddpa, dedup_elt);
}
Modified: trunk/coregrind/m_demangle/demangle.c
==============================================================================
--- trunk/coregrind/m_demangle/demangle.c (original)
+++ trunk/coregrind/m_demangle/demangle.c Wed Oct 22 18:42:37 2014
@@ -84,7 +84,7 @@
/* This is the main, standard demangler entry point. */
void VG_(demangle) ( Bool do_cxx_demangling, Bool do_z_demangling,
- HChar* orig, HChar* result, Int result_size )
+ const HChar* orig, HChar* result, Int result_size )
{
# define N_ZBUF 4096
HChar* demangled = NULL;
Modified: trunk/coregrind/m_redir.c
==============================================================================
--- trunk/coregrind/m_redir.c (original)
+++ trunk/coregrind/m_redir.c Wed Oct 22 18:42:37 2014
@@ -311,7 +311,7 @@
static void show_active ( const HChar* left, Active* act );
static void handle_maybe_load_notifier( const HChar* soname,
- HChar* symbol, Addr addr );
+ const HChar* symbol, Addr addr );
static void handle_require_text_symbols ( DebugInfo* );
@@ -334,8 +334,9 @@
NULL terminated array, for easy iteration. Caller must pass also
the address of a 2-entry array which can be used in the common case
to avoid dynamic allocation. */
-static HChar** alloc_symname_array ( HChar* pri_name, HChar** sec_names,
- HChar** twoslots )
+static const HChar** alloc_symname_array ( const HChar* pri_name,
+ const HChar** sec_names,
+ const HChar** twoslots )
{
/* Special-case the common case: only one name. We expect the
caller to supply a stack-allocated 2-entry array for this. */
@@ -346,10 +347,10 @@
}
/* Else must use dynamic allocation. Figure out size .. */
Word n_req = 1;
- HChar** pp = sec_names;
+ const HChar** pp = sec_names;
while (*pp) { n_req++; pp++; }
/* .. allocate and copy in. */
- HChar** arr = dinfo_zalloc( "redir.asa.1", (n_req+1) * sizeof(HChar*) );
+ const HChar** arr = dinfo_zalloc("redir.asa.1", (n_req+1) * sizeof(HChar*));
Word i = 0;
arr[i++] = pri_name;
pp = sec_names;
@@ -361,7 +362,7 @@
/* Free the array allocated by alloc_symname_array, if any. */
-static void free_symname_array ( HChar** names, HChar** twoslots )
+static void free_symname_array ( const HChar** names, const HChar** twoslots )
{
if (names != twoslots)
dinfo_free(names);
@@ -395,8 +396,8 @@
Spec* spec;
TopSpec* ts;
TopSpec* newts;
- HChar* sym_name_pri;
- HChar** sym_names_sec;
+ const HChar* sym_name_pri;
+ const HChar** sym_names_sec;
SymAVMAs sym_avmas;
HChar demangled_sopatt[N_DEMANGLED];
HChar demangled_fnpatt[N_DEMANGLED];
@@ -511,10 +512,10 @@
NULL, &sym_name_pri, &sym_names_sec,
&isText, NULL );
/* Set up to conveniently iterate over all names for this symbol. */
- HChar* twoslots[2];
- HChar** names_init = alloc_symname_array(sym_name_pri, sym_names_sec,
- &twoslots[0]);
- HChar** names;
+ const HChar* twoslots[2];
+ const HChar** names_init =
+ alloc_symname_array(sym_name_pri, sym_names_sec, &twoslots[0]);
+ const HChar** names;
for (names = names_init; *names; names++) {
ok = VG_(maybe_Z_demangle)( *names,
demangled_sopatt, N_DEMANGLED,
@@ -621,10 +622,10 @@
VG_(DebugInfo_syms_getidx)( newdi, i, &sym_avmas,
NULL, &sym_name_pri, &sym_names_sec,
&isText, NULL );
- HChar* twoslots[2];
- HChar** names_init = alloc_symname_array(sym_name_pri, sym_names_sec,
- &twoslots[0]);
- HChar** names;
+ const HChar* twoslots[2];
+ const HChar** names_init =
+ alloc_symname_array(sym_name_pri, sym_names_sec, &twoslots[0]);
+ const HChar** names;
for (names = names_init; *names; names++) {
ok = isText
&& VG_(maybe_Z_demangle)(
@@ -758,8 +759,8 @@
Active act;
Int nsyms, i;
SymAVMAs sym_avmas;
- HChar* sym_name_pri;
- HChar** sym_names_sec;
+ const HChar* sym_name_pri;
+ const HChar** sym_names_sec;
/* First figure out which of the specs match the seginfo's soname.
Also clear the 'done' bits, so that after the main loop below
@@ -783,10 +784,10 @@
VG_(DebugInfo_syms_getidx)( di, i, &sym_avmas,
NULL, &sym_name_pri, &sym_names_sec,
&isText, &isIFunc );
- HChar* twoslots[2];
- HChar** names_init = alloc_symname_array(sym_name_pri, sym_names_sec,
- &twoslots[0]);
- HChar** names;
+ const HChar* twoslots[2];
+ const HChar** names_init =
+ alloc_symname_array(sym_name_pri, sym_names_sec, &twoslots[0]);
+ const HChar** names;
for (names = names_init; *names; names++) {
/* ignore data symbols */
@@ -1533,7 +1534,7 @@
static
void handle_maybe_load_notifier( const HChar* soname,
- HChar* symbol, Addr addr )
+ const HChar* symbol, Addr addr )
{
# if defined(VGP_x86_linux)
/* x86-linux only: if we see _dl_sysinfo_int80, note its address.
@@ -1634,15 +1635,15 @@
Int nsyms = VG_(DebugInfo_syms_howmany)(di);
for (j = 0; j < nsyms; j++) {
Bool isText = False;
- HChar* sym_name_pri = NULL;
- HChar** sym_names_sec = NULL;
+ const HChar* sym_name_pri = NULL;
+ const HChar** sym_names_sec = NULL;
VG_(DebugInfo_syms_getidx)( di, j, NULL,
NULL, &sym_name_pri, &sym_names_sec,
&isText, NULL );
- HChar* twoslots[2];
- HChar** names_init = alloc_symname_array(sym_name_pri, sym_names_sec,
- &twoslots[0]);
- HChar** names;
+ const HChar* twoslots[2];
+ const HChar** names_init =
+ alloc_symname_array(sym_name_pri, sym_names_sec, &twoslots[0]);
+ const HChar** names;
for (names = names_init; *names; names++) {
/* ignore data symbols */
if (0) VG_(printf)("QQQ %s\n", *names);
Modified: trunk/coregrind/pub_core_debuginfo.h
==============================================================================
--- trunk/coregrind/pub_core_debuginfo.h (original)
+++ trunk/coregrind/pub_core_debuginfo.h Wed Oct 22 18:42:37 2014
@@ -197,8 +197,8 @@
Int idx,
/*OUT*/SymAVMAs* ad,
/*OUT*/UInt* size,
- /*OUT*/HChar** pri_name,
- /*OUT*/HChar*** sec_names,
+ /*OUT*/const HChar** pri_name,
+ /*OUT*/const HChar*** sec_names,
/*OUT*/Bool* isText,
/*OUT*/Bool* isIFunc );
/* ppc64-linux only: find the TOC pointer (R2 value) that should be in
Modified: trunk/coregrind/pub_core_demangle.h
==============================================================================
--- trunk/coregrind/pub_core_demangle.h (original)
+++ trunk/coregrind/pub_core_demangle.h Wed Oct 22 18:42:37 2014
@@ -43,7 +43,7 @@
* (2) undoes C++ demangling, if 'do_cxx_demangle' is True. */
extern
void VG_(demangle) ( Bool do_cxx_demangling, Bool do_z_demangling,
- HChar* orig, HChar* result, Int result_size );
+ const HChar* orig, HChar* result, Int result_size );
/* Demangle a Z-encoded name as described in pub_tool_redir.h.
Z-encoded names are used by Valgrind for doing function
Modified: trunk/include/pub_tool_deduppoolalloc.h
==============================================================================
--- trunk/include/pub_tool_deduppoolalloc.h (original)
+++ trunk/include/pub_tool_deduppoolalloc.h Wed Oct 22 18:42:37 2014
@@ -95,8 +95,8 @@
/* Allocates a new element from ddpa with eltSzB bytes to store elt.
This function never returns NULL. */
-extern void* VG_(allocEltDedupPA) (DedupPoolAlloc *ddpa,
- SizeT eltSzB, const void *elt);
+extern const void* VG_(allocEltDedupPA) (DedupPoolAlloc *ddpa,
+ SizeT eltSzB, const void *elt);
/* Allocates a new (fixed size) element from ddpa. Returns the
unique number identifying this element. This function never returns NULL. */
|