|
From: <sv...@va...> - 2012-11-15 04:28:07
|
florian 2012-11-15 04:27:04 +0000 (Thu, 15 Nov 2012)
New Revision: 13122
Log:
Char/HChar fixups for m_debuginfo and m_gdbserver.
Modified files:
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/coregrind/m_debuginfo/misc.c
trunk/coregrind/m_debuginfo/priv_misc.h
trunk/coregrind/m_debuginfo/priv_readdwarf.h
trunk/coregrind/m_debuginfo/priv_readdwarf3.h
trunk/coregrind/m_debuginfo/priv_readpdb.h
trunk/coregrind/m_debuginfo/priv_readstabs.h
trunk/coregrind/m_debuginfo/priv_storage.h
trunk/coregrind/m_debuginfo/priv_tytypes.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/readstabs.c
trunk/coregrind/m_debuginfo/storage.c
trunk/coregrind/m_debuginfo/tytypes.c
trunk/coregrind/m_gdbserver/m_gdbserver.c
trunk/coregrind/m_gdbserver/server.c
trunk/coregrind/m_gdbserver/valgrind-low-arm.c
trunk/coregrind/m_syswrap/syswrap-generic.c
trunk/coregrind/m_syswrap/syswrap-linux.c
trunk/coregrind/m_transtab.c
trunk/coregrind/pub_core_debuginfo.h
trunk/coregrind/pub_core_transtab.h
trunk/include/pub_tool_debuginfo.h
trunk/include/pub_tool_gdbserver.h
Modified: trunk/coregrind/m_debuginfo/storage.c (+22 -22)
===================================================================
--- trunk/coregrind/m_debuginfo/storage.c 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/coregrind/m_debuginfo/storage.c 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -75,7 +75,7 @@
VG_(message)(Vg_DebugMsg,
"When reading debug info from %s:\n",
(di && di->fsm.filename) ? di->fsm.filename
- : (UChar*)"???");
+ : "???");
}
VG_(message)(Vg_DebugMsg, "%s\n", msg);
@@ -91,7 +91,7 @@
/* Print a symbol. */
void ML_(ppSym) ( Int idx, DiSym* sym )
{
- UChar** sec_names = sym->sec_names;
+ HChar** sec_names = sym->sec_names;
vg_assert(sym->pri_name);
if (sec_names)
vg_assert(sec_names);
@@ -215,11 +215,11 @@
a chunking memory allocator rather than reallocating, so the
pointers are stable.
*/
-UChar* ML_(addStr) ( struct _DebugInfo* di, UChar* str, Int len )
+HChar* ML_(addStr) ( struct _DebugInfo* di, HChar* str, Int len )
{
struct strchunk *chunk;
Int space_needed;
- UChar* p;
+ HChar* p;
if (len == -1) {
len = VG_(strlen)(str);
@@ -337,8 +337,8 @@
/* Top-level place to call to add a source-location mapping entry.
*/
void ML_(addLineInfo) ( struct _DebugInfo* di,
- UChar* filename,
- UChar* dirname, /* NULL == directory is unknown */
+ const HChar* filename,
+ const HChar* dirname, /* NULL == directory is unknown */
Addr this,
Addr next,
Int lineno,
@@ -354,7 +354,7 @@
if (debug)
VG_(printf)( " src %s %s line %d %#lx-%#lx\n",
- dirname ? dirname : (UChar*)"(unknown)",
+ dirname ? dirname : "(unknown)",
filename, lineno, this, next );
/* Maximum sanity checking. Some versions of GNU as do a shabby
@@ -896,11 +896,11 @@
Int level,
Addr aMin,
Addr aMax,
- UChar* name, /* in di's .strchunks */
+ HChar* name, /* in di's .strchunks */
UWord typeR, /* a cuOff */
GExpr* gexpr,
GExpr* fbGX,
- UChar* fileName, /* where decl'd - may be NULL.
+ HChar* fileName, /* where decl'd - may be NULL.
in di's .strchunks */
Int lineNo, /* where decl'd - may be zero */
Bool show )
@@ -1174,12 +1174,12 @@
*/
static
Bool preferName ( struct _DebugInfo* di,
- UChar* a_name, UChar* b_name,
+ HChar* a_name, HChar* b_name,
Addr sym_avma/*exposition only*/ )
{
Word cmp;
Word vlena, vlenb; /* length without version */
- const UChar *vpa, *vpb;
+ const HChar *vpa, *vpb;
Bool preferA = False;
Bool preferB = False;
@@ -1233,7 +1233,7 @@
{
Bool blankA = True;
Bool blankB = True;
- Char *s;
+ HChar *s;
s = a_name;
while (*s) {
if (!VG_(isspace)(*s++)) {
@@ -1317,8 +1317,8 @@
vg_assert(from->pri_name);
/* Figure out how many names there will be in the new combined
secondary vector. */
- UChar** to_sec = to->sec_names;
- UChar** from_sec = from->sec_names;
+ HChar** to_sec = to->sec_names;
+ HChar** from_sec = from->sec_names;
Word n_new_sec = 1;
if (from_sec) {
while (*from_sec) {
@@ -1336,8 +1336,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. */
- UChar** new_sec = ML_(dinfo_zalloc)( "di.storage.aDntf.1",
- (n_new_sec+1) * sizeof(UChar*) );
+ 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;
@@ -1368,7 +1368,7 @@
{
Word i, j, n_truncated;
Addr sta1, sta2, end1, end2, toc1, toc2;
- UChar *pri1, *pri2, **sec1, **sec2;
+ HChar *pri1, *pri2, **sec1, **sec2;
Bool ist1, ist2, isf1, isf2;
# define SWAP(ty,aa,bb) \
@@ -1492,7 +1492,7 @@
if (end1 > end2) {
sta1 = end2 + 1;
SWAP(Addr,sta1,sta2); SWAP(Addr,end1,end2); SWAP(Addr,toc1,toc2);
- SWAP(UChar*,pri1,pri2); SWAP(UChar**,sec1,sec2);
+ SWAP(HChar*,pri1,pri2); SWAP(HChar**,sec1,sec2);
SWAP(Bool,ist1,ist2); SWAP(Bool,isf1,isf2);
} else
if (end1 < end2) {
@@ -1561,7 +1561,7 @@
show the user. */
for (i = 0; i < ((Word)di->symtab_used)-1; i++) {
DiSym* sym = &di->symtab[i];
- UChar** sec = sym->sec_names;
+ HChar** sec = sym->sec_names;
if (!sec)
continue;
/* Slow but simple. Copy all the cands into a temp array,
@@ -1569,8 +1569,8 @@
Word n_tmp = 1;
while (*sec) { n_tmp++; sec++; }
j = 0;
- UChar** tmp = ML_(dinfo_zalloc)( "di.storage.cS.1",
- (n_tmp+1) * sizeof(UChar*) );
+ 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++; }
@@ -1588,7 +1588,7 @@
vg_assert(best >= 0 && best < n_tmp);
/* Copy back */
sym->pri_name = tmp[best];
- UChar** cursor = sym->sec_names;
+ HChar** cursor = sym->sec_names;
for (j = 0; j < n_tmp; j++) {
if (j == best)
continue;
Modified: trunk/coregrind/m_debuginfo/readdwarf.c (+37 -37)
===================================================================
--- trunk/coregrind/m_debuginfo/readdwarf.c 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/coregrind/m_debuginfo/readdwarf.c 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -152,8 +152,8 @@
typedef struct
{
/* Feel free to add more members here if you need ! */
- Char* compdir; /* Compilation directory - points to .debug_info */
- Char* name; /* Main file name - points to .debug_info */
+ HChar* compdir; /* Compilation directory - points to .debug_info */
+ HChar* name; /* Main file name - points to .debug_info */
ULong stmt_list; /* Offset in .debug_line */
Bool dw64; /* 64-bit Dwarf? */
}
@@ -308,9 +308,9 @@
/* Look up a directory name, or return NULL if unknown. */
static
-Char* lookupDir ( Int filename_index,
- WordArray* fnidx2dir,
- WordArray* dirnames )
+HChar* lookupDir ( Int filename_index,
+ WordArray* fnidx2dir,
+ WordArray* dirnames )
{
Bool inRange;
Word diridx, dirname;
@@ -321,7 +321,7 @@
dirname = index_WordArray( &inRange, dirnames, (Int)diridx );
if (!inRange) goto bad;
- return (Char*)dirname;
+ return (HChar*)dirname;
bad:
return NULL;
}
@@ -341,7 +341,7 @@
UChar op_code;
Int bytes_read;
UInt len;
- UChar* name;
+ HChar* name;
Addr adr;
len = read_leb128 (data, & bytes_read, 0);
@@ -370,9 +370,9 @@
if (state_machine_regs.is_stmt) {
if (state_machine_regs.last_address) {
Bool inRange = False;
- Char* filename
- = (Char*)index_WordArray( &inRange, filenames,
- state_machine_regs.last_file);
+ HChar* filename
+ = (HChar*)index_WordArray( &inRange, filenames,
+ state_machine_regs.last_file);
if (!inRange || !filename)
filename = "???";
ML_(addLineInfo) (
@@ -401,7 +401,7 @@
break;
case DW_LNE_define_file:
- name = data;
+ name = (HChar *)data;
addto_WordArray( filenames, (Word)ML_(addStr)(di,name,-1) );
data += VG_(strlen) ((char *) data) + 1;
read_leb128 (data, & bytes_read, 0);
@@ -636,7 +636,7 @@
while (* data != 0) {
# define NBUF 4096
- static Char buf[NBUF];
+ static HChar buf[NBUF];
if (di->ddump_line)
VG_(printf)(" %s\n", data);
@@ -649,23 +649,23 @@
/* not an absolute path */
&& ui->compdir != NULL
/* actually got something sensible for compdir */
- && VG_(strlen)(ui->compdir) + VG_(strlen)(data) + 5/*paranoia*/ < NBUF
+ && VG_(strlen)(ui->compdir) + VG_(strlen)((HChar *)data) + 5/*paranoia*/ < NBUF
/* it's short enough to concatenate */)
{
buf[0] = 0;
VG_(strcat)(buf, ui->compdir);
VG_(strcat)(buf, "/");
- VG_(strcat)(buf, data);
+ VG_(strcat)(buf, (HChar *)data);
vg_assert(VG_(strlen)(buf) < NBUF);
addto_WordArray( &dirnames, (Word)ML_(addStr)(di,buf,-1) );
if (0) VG_(printf)("rel path %s\n", buf);
} else {
/* just use 'data'. */
- addto_WordArray( &dirnames, (Word)ML_(addStr)(di,data,-1) );
+ addto_WordArray( &dirnames, (Word)ML_(addStr)(di,(HChar *)data,-1) );
if (0) VG_(printf)("abs path %s\n", data);
}
- data += VG_(strlen)(data) + 1;
+ data += VG_(strlen)((HChar *)data) + 1;
# undef NBUF
}
@@ -690,11 +690,11 @@
i = 1;
while (* data != 0) {
- UChar* name;
+ HChar* name;
Int bytes_read, diridx;
Int uu_time, uu_size; /* unused, and a guess */
- name = data;
- data += VG_(strlen) ((Char *) data) + 1;
+ name = (HChar *)data;
+ data += VG_(strlen) (name) + 1;
diridx = read_leb128 (data, & bytes_read, 0);
data += bytes_read;
@@ -762,9 +762,9 @@
/* only add a statement if there was a previous boundary */
if (state_machine_regs.last_address) {
Bool inRange = False;
- Char* filename
- = (Char*)index_WordArray( &inRange, &filenames,
- state_machine_regs.last_file);
+ const HChar* filename
+ = (HChar*)index_WordArray( &inRange, &filenames,
+ state_machine_regs.last_file);
if (!inRange || !filename)
filename = "???";
ML_(addLineInfo)(
@@ -801,9 +801,9 @@
/* only add a statement if there was a previous boundary */
if (state_machine_regs.last_address) {
Bool inRange = False;
- Char* filename
- = (Char*)index_WordArray( &inRange, &filenames,
- state_machine_regs.last_file );
+ const HChar* filename
+ = (HChar*)index_WordArray( &inRange, &filenames,
+ state_machine_regs.last_file );
if (!inRange || !filename)
filename = "???";
ML_(addLineInfo)(
@@ -985,8 +985,8 @@
void read_unitinfo_dwarf2( /*OUT*/UnitInfo* ui,
UChar* unitblock_img,
UChar* debugabbrev_img,
- UChar* debugstr_img,
- UChar* debugstr_alt_img )
+ HChar* debugstr_img,
+ HChar* debugstr_alt_img )
{
UInt acode, abcode;
ULong atoffs, blklen;
@@ -1060,7 +1060,7 @@
/* Read entry definition */
UInt name, form;
ULong cval = -1LL; /* Constant value read */
- Char *sval = NULL; /* String value read */
+ HChar *sval = NULL; /* String value read */
name = read_leb128U( &abbrev_img );
form = read_leb128U( &abbrev_img );
if ( name == 0 )
@@ -1097,8 +1097,8 @@
sval = debugstr_img + ML_(read_ULong)(p);
p += ui->dw64 ? 8 : 4;
break;
- case 0x08: /* FORM_string */ sval = (Char*)p;
- p += VG_(strlen)((Char*)p) + 1; break;
+ case 0x08: /* FORM_string */ sval = (HChar*)p;
+ p += VG_(strlen)(sval) + 1; break;
case 0x0b: /* FORM_data1 */ cval = *p; p++; break;
case 0x17: /* FORM_sec_offset */if (ui->dw64) {
cval = ML_(read_ULong)(p); p += 8;
@@ -1179,8 +1179,8 @@
UChar* debug_types_img, Word debug_types_sz, /* .debug_types */
UChar* debug_abbv_img, Word debug_abbv_sz, /* .debug_abbrev */
UChar* debug_line_img, Word debug_line_sz, /* .debug_line */
- UChar* debug_str_img, Word debug_str_sz, /* .debug_str */
- UChar* debug_str_alt_img, Word debug_str_alt_sz ) /* .debug_str */
+ HChar* debug_str_img, Word debug_str_sz, /* .debug_str */
+ HChar* debug_str_alt_img, Word debug_str_alt_sz ) /* .debug_str */
{
UnitInfo ui;
UShort ver;
@@ -1415,7 +1415,7 @@
Int die_offset, die_szb, at_offset;
UShort die_kind, at_kind;
UChar* at_base;
- UChar* src_filename;
+ HChar* src_filename;
if (0)
VG_(printf)("read_debuginfo_dwarf1 ( %p, %d, %p, %d )\n",
@@ -1478,7 +1478,7 @@
case AT_comp_dir:
/* Zero terminated string, step over it. */
if (at_kind == AT_name)
- src_filename = at_base + at_offset;
+ src_filename = (HChar *)(at_base + at_offset);
while (at_offset < die_szb-6 && at_base[at_offset] != 0)
at_offset++;
at_offset++;
@@ -1507,7 +1507,7 @@
*/
Addr base;
Int len;
- Char* curr_filenm;
+ HChar* curr_filenm;
UChar* ptr;
UInt prev_line, prev_delta;
@@ -3862,7 +3862,7 @@
Int this_CIE;
UChar cie_version;
- UChar* cie_augmentation;
+ HChar* cie_augmentation;
/* --------- CIE --------- */
if (di->trace_cfi)
@@ -3900,7 +3900,7 @@
goto bad;
}
- cie_augmentation = data;
+ cie_augmentation = (HChar *)data;
data += 1 + VG_(strlen)(cie_augmentation);
if (di->trace_cfi)
VG_(printf)("cie.augment = \"%s\"\n", cie_augmentation);
Modified: trunk/coregrind/m_debuginfo/priv_storage.h (+14 -14)
===================================================================
--- trunk/coregrind/m_debuginfo/priv_storage.h 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/coregrind/m_debuginfo/priv_storage.h 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -66,8 +66,8 @@
struct {
Addr addr; /* lowest address of entity */
Addr tocptr; /* ppc64-linux only: value that R2 should have */
- UChar* pri_name; /* primary name, never NULL */
- UChar** sec_names; /* NULL, or a NULL term'd array of other names */
+ HChar* pri_name; /* primary name, never NULL */
+ 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
@@ -107,9 +107,9 @@
UShort size:LOC_SIZE_BITS; /* # bytes; we catch overflows of this */
UInt lineno:LINENO_BITS; /* source line number, or zero */
/* Word 3 */
- UChar* filename; /* source filename */
+ const HChar* filename; /* source filename */
/* Word 4 */
- UChar* dirname; /* source directory name */
+ const HChar* dirname; /* source directory name */
}
DiLoc;
@@ -405,11 +405,11 @@
typedef
struct {
- UChar* name; /* in DebugInfo.strchunks */
+ HChar* name; /* in DebugInfo.strchunks */
UWord typeR; /* a cuOff */
GExpr* gexpr; /* on DebugInfo.gexprs list */
GExpr* fbGX; /* SHARED. */
- UChar* fileName; /* where declared; may be NULL. in
+ HChar* fileName; /* where declared; may be NULL. in
DebugInfo.strchunks */
Int lineNo; /* where declared; may be zero. */
}
@@ -465,7 +465,7 @@
struct _DebugInfoFSM
{
- UChar* filename; /* in mallocville (VG_AR_DINFO) */
+ HChar* filename; /* in mallocville (VG_AR_DINFO) */
XArray* maps; /* XArray of _DebugInfoMapping structs */
Bool have_rx_map; /* did we see a r?x mapping yet for the file? */
Bool have_rw_map; /* did we see a rw? mapping yet for the file? */
@@ -536,7 +536,7 @@
is, at the point where .have_dinfo is set to True). */
/* The file's soname. */
- UChar* soname;
+ HChar* soname;
/* Description of some important mapped segments. The presence or
absence of the mapping is denoted by the _present field, since
@@ -775,7 +775,7 @@
struct strchunk {
UInt strtab_used;
struct strchunk* next;
- UChar strtab[SEGINFO_STRCHUNKSIZE];
+ HChar strtab[SEGINFO_STRCHUNKSIZE];
} *strchunks;
/* Variable scope information, as harvested from Dwarf3 files.
@@ -834,8 +834,8 @@
/* Add a line-number record to a DebugInfo. */
extern
void ML_(addLineInfo) ( struct _DebugInfo* di,
- UChar* filename,
- UChar* dirname, /* NULL is allowable */
+ const HChar* filename,
+ const HChar* dirname, /* NULL is allowable */
Addr this, Addr next, Int lineno, Int entry);
/* Add a CFI summary record. The supplied DiCfSI is copied. */
@@ -843,17 +843,17 @@
/* Add a string to the string table of a DebugInfo. If len==-1,
ML_(addStr) will itself measure the length of the string. */
-extern UChar* ML_(addStr) ( struct _DebugInfo* di, UChar* str, Int len );
+extern HChar* ML_(addStr) ( struct _DebugInfo* di, HChar* str, Int len );
extern void ML_(addVar)( struct _DebugInfo* di,
Int level,
Addr aMin,
Addr aMax,
- UChar* name,
+ HChar* name,
UWord typeR, /* a cuOff */
GExpr* gexpr,
GExpr* fbGX, /* SHARED. */
- UChar* fileName, /* where decl'd - may be NULL */
+ HChar* fileName, /* where decl'd - may be NULL */
Int lineNo, /* where decl'd - may be zero */
Bool show );
Modified: trunk/coregrind/m_gdbserver/m_gdbserver.c (+18 -18)
===================================================================
--- trunk/coregrind/m_gdbserver/m_gdbserver.c 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/coregrind/m_gdbserver/m_gdbserver.c 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -60,7 +60,7 @@
void VG_(helperc_CallDebugger) ( HWord iaddr );
VG_REGPARM(1)
void VG_(helperc_invalidate_if_not_gdbserved) ( Addr addr );
-static void invalidate_current_ip (ThreadId tid, char *who);
+static void invalidate_current_ip (ThreadId tid, const HChar *who);
/* reasons of call to call_gdbserver. */
typedef
@@ -74,7 +74,7 @@
exit_reason} // process terminated
CallReason;
-static char* ppCallReason(CallReason reason)
+static const HChar* ppCallReason(CallReason reason)
{
switch (reason) {
case init_reason: return "init_reason";
@@ -138,9 +138,9 @@
/* Describes the address addr (for debugging/printing purposes).
Last two results are kept. A third call will replace the
oldest result. */
-static char* sym (Addr addr, Bool is_code)
+static HChar* sym (Addr addr, Bool is_code)
{
- static char buf[2][200];
+ static HChar buf[2][200];
static int w = 0;
PtrdiffT offset;
if (w == 2) w = 0;
@@ -209,7 +209,7 @@
#endif
}
-static void add_gs_address (Addr addr, GS_Kind kind, char* from)
+static void add_gs_address (Addr addr, GS_Kind kind, const HChar* from)
{
GS_Address *p;
@@ -223,7 +223,7 @@
VG_(discard_translations) (addr, 2, from);
}
-static void remove_gs_address (GS_Address* g, char* from)
+static void remove_gs_address (GS_Address* g, const HChar* from)
{
VG_(HT_remove) (gs_addresses, g->addr);
// See add_gs_address for the explanation for the range 2 below.
@@ -231,7 +231,7 @@
VG_(arena_free) (VG_AR_CORE, g);
}
-char* VG_(ppPointKind) (PointKind kind)
+const HChar* VG_(ppPointKind) (PointKind kind)
{
switch(kind) {
case software_breakpoint: return "software_breakpoint";
@@ -563,14 +563,14 @@
gs_watches = NULL;
}
-static void invalidate_if_jump_not_yet_gdbserved (Addr addr, char* from)
+static void invalidate_if_jump_not_yet_gdbserved (Addr addr, const HChar* from)
{
if (VG_(HT_lookup) (gs_addresses, (UWord)HT_addr(addr)))
return;
add_gs_address (addr, GS_jump, from);
}
-static void invalidate_current_ip (ThreadId tid, char *who)
+static void invalidate_current_ip (ThreadId tid, const HChar *who)
{
invalidate_if_jump_not_yet_gdbserved (VG_(get_IP) (tid), who);
}
@@ -1045,7 +1045,7 @@
{
void* fn;
- HChar* nm;
+ const HChar* nm;
IRExpr** args;
Int nargs;
IRDirty* di;
@@ -1084,7 +1084,7 @@
IRSB* irsb) /* irsb block to which call is added */
{
void* fn;
- HChar* nm;
+ const HChar* nm;
IRExpr** args;
Int nargs;
IRDirty* di;
@@ -1233,7 +1233,7 @@
}
struct mon_out_buf {
- char buf[DATASIZ+1];
+ HChar buf[DATASIZ+1];
int next;
UInt ret;
};
@@ -1269,14 +1269,14 @@
return b.ret;
}
-Int VG_(keyword_id) (Char* keywords, Char* input_word, kwd_report_error report)
+Int VG_(keyword_id) (HChar* keywords, HChar* input_word, kwd_report_error report)
{
const Int il = (input_word == NULL ? 0 : VG_(strlen) (input_word));
HChar iw[il+1];
HChar kwds[VG_(strlen)(keywords)+1];
HChar *kwdssaveptr;
- Char* kw; /* current keyword, its length, its position */
+ HChar* kw; /* current keyword, its length, its position */
Int kwl;
Int kpos = -1;
@@ -1299,7 +1299,7 @@
VG_(strcpy) (kwds, keywords);
if (pass == 1)
VG_(gdb_printf) ("%s can match",
- (il == 0 ? "<empty string>" : (char *) iw));
+ (il == 0 ? "<empty string>" : iw));
for (kw = VG_(strtok_r) (kwds, " ", &kwdssaveptr);
kw != NULL;
kw = VG_(strtok_r) (NULL, " ", &kwdssaveptr)) {
@@ -1358,7 +1358,7 @@
}
/* True if string can be a 0x number */
-static Bool is_zero_x (Char *s)
+static Bool is_zero_x (const HChar *s)
{
if (strlen (s) >= 3 && s[0] == '0' && s[1] == 'x')
return True;
@@ -1367,7 +1367,7 @@
}
/* True if string can be a 0b number */
-static Bool is_zero_b (Char *s)
+static Bool is_zero_b (const HChar *s)
{
if (strlen (s) >= 3 && s[0] == '0' && s[1] == 'b')
return True;
@@ -1399,7 +1399,7 @@
*szB = VG_(strtoull16) (ws, &endptr);
} else if (is_zero_b (ws)) {
Int j;
- Char *parsews = ws;
+ HChar *parsews = ws;
Int n_bits = VG_(strlen) (ws) - 2;
*szB = 0;
ws = NULL; // assume the below loop gives a correct nr.
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c (+3 -3)
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -650,7 +650,7 @@
struct vki_sockaddr_in in;
struct vki_sockaddr_un un;
} laddr;
- UInt llen;
+ Int llen;
llen = sizeof(laddr);
VG_(memset)(&laddr, 0, llen);
@@ -661,7 +661,7 @@
static char lname[32];
static char pname[32];
struct vki_sockaddr_in paddr;
- UInt plen = sizeof(struct vki_sockaddr_in);
+ Int plen = sizeof(struct vki_sockaddr_in);
if (VG_(getpeername)(fd, (struct vki_sockaddr *)&paddr, &plen) != -1) {
VG_(message)(Vg_UserMsg, "Open AF_INET socket %d: %s <-> %s\n", fd,
@@ -703,7 +703,7 @@
i->pathname);
} else {
Int val;
- UInt len = sizeof(val);
+ Int len = sizeof(val);
if (VG_(getsockopt)(i->fd, VKI_SOL_SOCKET, VKI_SO_TYPE, &val, &len)
== -1) {
Modified: trunk/coregrind/m_gdbserver/valgrind-low-arm.c (+1 -1)
===================================================================
--- trunk/coregrind/m_gdbserver/valgrind-low-arm.c 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/coregrind/m_gdbserver/valgrind-low-arm.c 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -144,7 +144,7 @@
// pc aligned on 4 bytes. We need to use debug info.
{
- Char fnname[200]; // ??? max size
+ HChar fnname[200]; // ??? max size
Addr entrypoint;
Addr ptoc; // unused but needed.
// If this is a thumb instruction, we need to ask
Modified: trunk/coregrind/m_debuginfo/priv_tytypes.h (+6 -6)
===================================================================
--- trunk/coregrind/m_debuginfo/priv_tytypes.h 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/coregrind/m_debuginfo/priv_tytypes.h 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -74,12 +74,12 @@
struct {
} UNKNOWN;
struct {
- UChar* name; /* in mallocville */
+ HChar* name; /* in mallocville */
Bool valueKnown; /* atoms w/ unknown value are possible */
Long value;
} Atom;
struct {
- UChar* name; /* in mallocville */
+ HChar* name; /* in mallocville */
UWord typeR; /* should be Te_TyXXXX */
union {
UChar* loc; /* location expr, in mallocville */
@@ -97,7 +97,7 @@
Long boundU;
} Bound;
struct {
- UChar* name; /* in mallocville */
+ HChar* name; /* in mallocville */
Int szB;
UChar enc; /* S:signed U:unsigned F:floating C:complex float */
} TyBase;
@@ -106,18 +106,18 @@
UWord typeR;
} TyPorR;
struct {
- UChar* name; /* in mallocville */
+ HChar* name; /* in mallocville */
UWord typeR; /* MAY BE D3_INVALID_CUOFF, denoting unknown */
} TyTyDef;
struct {
- UChar* name; /* in mallocville */
+ HChar* name; /* in mallocville */
UWord szB;
XArray* /* of UWord */ fieldRs;
Bool complete;
Bool isStruct;
} TyStOrUn;
struct {
- UChar* name; /* in mallocville */
+ HChar* name; /* in mallocville */
Int szB;
XArray* /* of UWord */ atomRs;
} TyEnum;
Modified: trunk/coregrind/pub_core_transtab.h (+1 -1)
===================================================================
--- trunk/coregrind/pub_core_transtab.h 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/coregrind/pub_core_transtab.h 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -78,7 +78,7 @@
Bool upd_cache );
extern void VG_(discard_translations) ( Addr64 start, ULong range,
- HChar* who );
+ const HChar* who );
extern void VG_(print_tt_tc_stats) ( void );
Modified: trunk/coregrind/m_debuginfo/tytypes.c (+12 -12)
===================================================================
--- trunk/coregrind/m_debuginfo/tytypes.c 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/coregrind/m_debuginfo/tytypes.c 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -102,12 +102,12 @@
if (te->Te.Field.nLoc == -1)
VG_(printf)("Te_Field(ty=0x%05lx,pos.offset=%ld,\"%s\")",
te->Te.Field.typeR, te->Te.Field.pos.offset,
- te->Te.Field.name ? te->Te.Field.name : (UChar*)"");
+ te->Te.Field.name ? te->Te.Field.name : "");
else
VG_(printf)("Te_Field(ty=0x%05lx,nLoc=%lu,pos.loc=%p,\"%s\")",
te->Te.Field.typeR, te->Te.Field.nLoc,
te->Te.Field.pos.loc,
- te->Te.Field.name ? te->Te.Field.name : (UChar*)"");
+ te->Te.Field.name ? te->Te.Field.name : "");
break;
case Te_Bound:
VG_(printf)("Te_Bound[");
@@ -126,7 +126,7 @@
VG_(printf)("Te_TyBase(%d,%c,\"%s\")",
te->Te.TyBase.szB, te->Te.TyBase.enc,
te->Te.TyBase.name ? te->Te.TyBase.name
- : (UChar*)"(null)" );
+ : "(null)" );
break;
case Te_TyPtr:
VG_(printf)("Te_TyPtr(%d,0x%05lx)", te->Te.TyPorR.szB,
@@ -148,7 +148,7 @@
VG_(printf)("Te_TyTyDef(0x%05lx,\"%s\")",
te->Te.TyTyDef.typeR,
te->Te.TyTyDef.name ? te->Te.TyTyDef.name
- : (UChar*)"" );
+ : "" );
break;
case Te_TyStOrUn:
if (te->Te.TyStOrUn.complete) {
@@ -157,7 +157,7 @@
te->Te.TyStOrUn.isStruct ? 'S' : 'U',
te->Te.TyStOrUn.fieldRs,
te->Te.TyStOrUn.name ? te->Te.TyStOrUn.name
- : (UChar*)"" );
+ : "" );
if (te->Te.TyStOrUn.fieldRs)
pp_XArray_of_cuOffs( te->Te.TyStOrUn.fieldRs );
} else {
@@ -169,7 +169,7 @@
VG_(printf)("Te_TyEnum(%d,%p,\"%s\")",
te->Te.TyEnum.szB, te->Te.TyEnum.atomRs,
te->Te.TyEnum.name ? te->Te.TyEnum.name
- : (UChar*)"" );
+ : "" );
if (te->Te.TyEnum.atomRs)
pp_XArray_of_cuOffs( te->Te.TyEnum.atomRs );
break;
@@ -272,7 +272,7 @@
VG_(printf)("%s %s",
ent->Te.TyStOrUn.isStruct ? "struct" : "union",
ent->Te.TyStOrUn.name ? ent->Te.TyStOrUn.name
- : (UChar*)"<anonymous>" );
+ : "<anonymous>" );
break;
case Te_TyArray:
ML_(pp_TyEnt_C_ishly)(tyents, ent->Te.TyArray.typeR);
@@ -469,7 +469,7 @@
}
return 0;
}
-static Word Asciiz__cmp ( UChar* a, UChar* b ) {
+static Word Asciiz__cmp ( const HChar* a, const HChar* b ) {
/* A wrapper around strcmp that handles NULL strings safely. */
if (a == NULL && b == NULL) return 0;
if (a == NULL && b != NULL) return -1;
@@ -736,15 +736,15 @@
/* Describe where in the type 'offset' falls. Caller must
deallocate the resulting XArray. */
-static void copy_UWord_into_XA ( XArray* /* of UChar */ xa,
+static void copy_UWord_into_XA ( XArray* /* of HChar */ xa,
UWord uw ) {
- UChar buf[32];
+ HChar buf[32];
VG_(memset)(buf, 0, sizeof(buf));
VG_(sprintf)(buf, "%lu", uw);
VG_(addBytesToXA)( xa, buf, VG_(strlen)(buf));
}
-XArray* /*UChar*/ ML_(describe_type)( /*OUT*/PtrdiffT* residual_offset,
+XArray* /*HChar*/ ML_(describe_type)( /*OUT*/PtrdiffT* residual_offset,
XArray* /* of TyEnt */ tyents,
UWord ty_cuOff,
PtrdiffT offset )
@@ -752,7 +752,7 @@
TyEnt* ty;
XArray* xa = VG_(newXA)( ML_(dinfo_zalloc), "di.tytypes.dt.1",
ML_(dinfo_free),
- sizeof(UChar) );
+ sizeof(HChar) );
vg_assert(xa);
ty = ML_(TyEnts__index_by_cuOff)(tyents, NULL, ty_cuOff);
Modified: trunk/coregrind/m_debuginfo/readstabs.c (+7 -7)
===================================================================
--- trunk/coregrind/m_debuginfo/readstabs.c 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/coregrind/m_debuginfo/readstabs.c 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -98,14 +98,14 @@
*/
void ML_(read_debuginfo_stabs) ( DebugInfo* di,
UChar* stabC, Int stab_sz,
- UChar* stabstr, Int stabstr_sz )
+ HChar* stabstr, Int stabstr_sz )
{
const Bool debug = False;
const Bool contdebug = False;
Int i;
Int n_stab_entries;
struct nlist* stab = (struct nlist*)stabC;
- UChar *next_stabstr = NULL;
+ HChar *next_stabstr = NULL;
/* state for various things */
struct {
Addr start; /* start address */
@@ -113,7 +113,7 @@
Int line; /* first line */
} func = { 0, 0, -1 };
struct {
- Char *name;
+ HChar *name;
Bool same;
} file = { NULL, True };
struct {
@@ -143,7 +143,7 @@
for (i = 0; i < n_stab_entries; i++) {
const struct nlist *st = &stab[i];
- Char *string;
+ HChar *string;
if (di->trace_symtab) {
VG_(printf) ( "%2d type=%d othr=%d desc=%d "
@@ -158,7 +158,7 @@
{
Int qbuflen = 0;
Int qidx = 0;
- Char* qbuf = NULL;
+ HChar* qbuf = NULL;
Int qlen;
Bool qcontinuing = False;
UInt qstringidx;
@@ -189,7 +189,7 @@
/* XXX this is silly. The si->strtab should have a way of
appending to the last added string... */
if ((qidx + qlen) >= qbuflen) {
- Char *n;
+ HChar *n;
if (qbuflen == 0)
qbuflen = 16;
@@ -266,7 +266,7 @@
/* FALLTHROUGH */
case N_SO: { /* new source file */
- UChar *nm = string;
+ HChar *nm = string;
UInt len = VG_(strlen)(nm);
Addr addr = func.start + st->n_value;
Modified: trunk/coregrind/m_debuginfo/readdwarf3.c (+29 -29)
===================================================================
--- trunk/coregrind/m_debuginfo/readdwarf3.c 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/coregrind/m_debuginfo/readdwarf3.c 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -217,7 +217,7 @@
return c->region_szB - c->region_next;
}
-static UChar* get_address_of_Cursor ( Cursor* c ) {
+static void* get_address_of_Cursor ( Cursor* c ) {
vg_assert(is_sane_Cursor(c));
return &c->region_start_img[ c->region_next ];
}
@@ -309,9 +309,9 @@
the string with ML_(addStr), since (w.r.t. image overruns) the
process of advancing past the terminating zero will already have
"vetted" the string. */
-static UChar* get_AsciiZ ( Cursor* c ) {
+static HChar* get_AsciiZ ( Cursor* c ) {
UChar uc;
- UChar* res = get_address_of_Cursor(c);
+ HChar* res = get_address_of_Cursor(c);
do { uc = get_UChar(c); } while (uc != 0);
return res;
}
@@ -402,7 +402,7 @@
/* Upper bound on size thereof (an overestimate, in general) */
UWord debug_abbv_maxszB;
/* Where is .debug_str ? */
- UChar* debug_str_img;
+ HChar* debug_str_img;
UWord debug_str_sz;
/* Where is .debug_ranges ? */
UChar* debug_ranges_img;
@@ -423,7 +423,7 @@
UChar* debug_info_alt_img;
UWord debug_info_alt_sz;
/* Where is alternate .debug_str ? */
- UChar* debug_str_alt_img;
+ HChar* debug_str_alt_img;
UWord debug_str_alt_sz;
/* How much to add to .debug_types resp. alternate .debug_info offsets
in cook_die*. */
@@ -1176,21 +1176,21 @@
case DW_FORM_strp: {
/* this is an offset into .debug_str */
- UChar* str;
+ HChar* str;
UWord uw = (UWord)get_Dwarfish_UWord( c, cc->is_dw64 );
if (cc->debug_str_img == NULL || uw >= cc->debug_str_sz)
cc->barf("get_Form_contents: DW_FORM_strp "
"points outside .debug_str");
/* FIXME: check the entire string lies inside debug_str,
not just the first byte of it. */
- str = (UChar*)cc->debug_str_img + uw;
+ str = cc->debug_str_img + uw;
TRACE_D3("(indirect string, offset: 0x%lx): %s", uw, str);
*cts = (ULong)(UWord)str;
*ctsMemSzB = 1 + (ULong)VG_(strlen)(str);
break;
}
case DW_FORM_string: {
- UChar* str = get_AsciiZ(c);
+ HChar* str = get_AsciiZ(c);
TRACE_D3("%s", str);
*cts = (ULong)(UWord)str;
/* strlen is safe because get_AsciiZ already 'vetted' the
@@ -1343,14 +1343,14 @@
case DW_FORM_GNU_strp_alt: {
/* this is an offset into alternate .debug_str */
- UChar* str;
+ HChar* str;
UWord uw = (UWord)get_Dwarfish_UWord( c, cc->is_dw64 );
if (cc->debug_str_alt_img == NULL || uw >= cc->debug_str_alt_sz)
cc->barf("get_Form_contents: DW_FORM_GNU_strp_alt "
"points outside alternate .debug_str");
/* FIXME: check the entire string lies inside debug_str,
not just the first byte of it. */
- str = (UChar*)cc->debug_str_alt_img + uw;
+ str = cc->debug_str_alt_img + uw;
TRACE_D3("(indirect alt string, offset: 0x%lx): %s", uw, str);
*cts = (ULong)(UWord)str;
*ctsMemSzB = 1 + (ULong)VG_(strlen)(str);
@@ -1374,7 +1374,7 @@
typedef
struct _TempVar {
- UChar* name; /* in DebugInfo's .strchunks */
+ HChar* name; /* in DebugInfo's .strchunks */
/* Represent ranges economically. nRanges is the number of
ranges. Cases:
0: .rngOneMin .rngOneMax .manyRanges are all zero
@@ -1397,7 +1397,7 @@
GExpr* gexpr; /* for this variable */
GExpr* fbGX; /* to find the frame base of the enclosing fn, if
any */
- UChar* fName; /* declaring file name, or NULL */
+ HChar* fName; /* declaring file name, or NULL */
Int fLine; /* declaring file line number, or zero */
/* offset in .debug_info, so that abstract instances can be
found to satisfy references from concrete instances. */
@@ -1568,7 +1568,7 @@
Word i;
UShort version;
UChar opcode_base;
- UChar* str;
+ HChar* str;
vg_assert(parser && cc && cc->barf);
if ((!cc->debug_line_img)
@@ -1851,14 +1851,14 @@
}
if (dtag == DW_TAG_variable || dtag == DW_TAG_formal_parameter) {
- UChar* name = NULL;
+ HChar* name = NULL;
UWord typeR = D3_INVALID_CUOFF;
Bool external = False;
GExpr* gexpr = NULL;
Int n_attrs = 0;
UWord abs_ori = (UWord)D3_INVALID_CUOFF;
Int lineNo = 0;
- UChar* fileName = NULL;
+ HChar* fileName = NULL;
while (True) {
DW_AT attr = (DW_AT) get_ULEB128( c_abbv );
DW_FORM form = (DW_FORM)get_ULEB128( c_abbv );
@@ -1867,7 +1867,7 @@
cc, c_die, False/*td3*/, form );
n_attrs++;
if (attr == DW_AT_name && ctsMemSzB > 0) {
- name = ML_(addStr)( cc->di, (UChar*)(UWord)cts, -1 );
+ name = ML_(addStr)( cc->di, (HChar*)(UWord)cts, -1 );
}
if (attr == DW_AT_location
&& ((ctsMemSzB > 0 && ctsSzB == 0)
@@ -1895,7 +1895,7 @@
Int ftabIx = (Int)cts;
if (ftabIx >= 1
&& ftabIx < VG_(sizeXA)( parser->filenameTable )) {
- fileName = *(UChar**)
+ fileName = *(HChar**)
VG_(indexXA)( parser->filenameTable, ftabIx );
vg_assert(fileName);
}
@@ -2367,7 +2367,7 @@
if (attr == DW_AT_name && ctsMemSzB > 0) {
typeE.Te.TyBase.name
= ML_(dinfo_strdup)( "di.readdwarf3.ptD.base_type.1",
- (UChar*)(UWord)cts );
+ (HChar*)(UWord)cts );
}
if (attr == DW_AT_byte_size && ctsSzB > 0) {
typeE.Te.TyBase.szB = cts;
@@ -2506,7 +2506,7 @@
if (attr == DW_AT_name && ctsMemSzB > 0) {
typeE.Te.TyEnum.name
= ML_(dinfo_strdup)( "di.readdwarf3.pTD.enum_type.2",
- (UChar*)(UWord)cts );
+ (HChar*)(UWord)cts );
}
if (attr == DW_AT_byte_size && ctsSzB > 0) {
typeE.Te.TyEnum.szB = cts;
@@ -2588,7 +2588,7 @@
if (attr == DW_AT_name && ctsMemSzB > 0) {
atomE.Te.Atom.name
= ML_(dinfo_strdup)( "di.readdwarf3.pTD.enumerator.1",
- (UChar*)(UWord)cts );
+ (HChar*)(UWord)cts );
}
if (attr == DW_AT_const_value && ctsSzB > 0) {
atomE.Te.Atom.value = cts;
@@ -2641,7 +2641,7 @@
if (attr == DW_AT_name && ctsMemSzB > 0) {
typeE.Te.TyStOrUn.name
= ML_(dinfo_strdup)( "di.readdwarf3.ptD.struct_type.2",
- (UChar*)(UWord)cts );
+ (HChar*)(UWord)cts );
}
if (attr == DW_AT_byte_size && ctsSzB >= 0) {
typeE.Te.TyStOrUn.szB = cts;
@@ -2711,7 +2711,7 @@
if (attr == DW_AT_name && ctsMemSzB > 0) {
fieldE.Te.Field.name
= ML_(dinfo_strdup)( "di.readdwarf3.ptD.member.1",
- (UChar*)(UWord)cts );
+ (HChar*)(UWord)cts );
}
if (attr == DW_AT_type && ctsSzB > 0) {
fieldE.Te.Field.typeR = cook_die_using_form( cc, (UWord)cts, form );
@@ -2915,7 +2915,7 @@
if (attr == DW_AT_name && ctsMemSzB > 0) {
typeE.Te.TyTyDef.name
= ML_(dinfo_strdup)( "di.readdwarf3.ptD.typedef.1",
- (UChar*)(UWord)cts );
+ (HChar*)(UWord)cts );
}
if (attr == DW_AT_type && ctsSzB > 0) {
typeE.Te.TyTyDef.typeR = cook_die_using_form( cc, (UWord)cts,
@@ -3523,13 +3523,13 @@
UChar* debug_types_img, SizeT debug_types_sz,
UChar* debug_abbv_img, SizeT debug_abbv_sz,
UChar* debug_line_img, SizeT debug_line_sz,
- UChar* debug_str_img, SizeT debug_str_sz,
+ HChar* debug_str_img, SizeT debug_str_sz,
UChar* debug_ranges_img, SizeT debug_ranges_sz,
UChar* debug_loc_img, SizeT debug_loc_sz,
UChar* debug_info_alt_img, SizeT debug_info_alt_sz,
UChar* debug_abbv_alt_img, SizeT debug_abbv_alt_sz,
UChar* debug_line_alt_img, SizeT debug_line_alt_sz,
- UChar* debug_str_alt_img, SizeT debug_str_alt_sz
+ HChar* debug_str_alt_img, SizeT debug_str_alt_sz
)
{
XArray* /* of TyEnt */ tyents;
@@ -4128,7 +4128,7 @@
VG_(printf)("<%lx> addVar: level %d: %s :: ",
varp->dioff,
varp->level,
- varp->name ? varp->name : (UChar*)"<anon_var>" );
+ varp->name ? varp->name : "<anon_var>" );
if (varp->typeR) {
ML_(pp_TyEnt_C_ishly)( tyents_to_keep, varp->typeR );
} else {
@@ -4149,7 +4149,7 @@
VG_(printf)(" FrB=none\n");
}
VG_(printf)(" declared at: %s:%d\n",
- varp->fName ? varp->fName : (UChar*)"NULL",
+ varp->fName ? varp->fName : "NULL",
varp->fLine );
if (varp->absOri != (UWord)D3_INVALID_CUOFF)
VG_(printf)(" abstract origin: <%lx>\n", varp->absOri);
@@ -4356,13 +4356,13 @@
UChar* debug_types_img, SizeT debug_types_sz,
UChar* debug_abbv_img, SizeT debug_abbv_sz,
UChar* debug_line_img, SizeT debug_line_sz,
- UChar* debug_str_img, SizeT debug_str_sz,
+ HChar* debug_str_img, SizeT debug_str_sz,
UChar* debug_ranges_img, SizeT debug_ranges_sz,
UChar* debug_loc_img, SizeT debug_loc_sz,
UChar* debug_info_alt_img, SizeT debug_info_alt_sz,
UChar* debug_abbv_alt_img, SizeT debug_abbv_alt_sz,
UChar* debug_line_alt_img, SizeT debug_line_alt_sz,
- UChar* debug_str_alt_img, SizeT debug_str_alt_sz
+ HChar* debug_str_alt_img, SizeT debug_str_alt_sz
)
{
volatile Int jumped;
Modified: trunk/coregrind/m_debuginfo/priv_readdwarf3.h (+2 -2)
===================================================================
--- trunk/coregrind/m_debuginfo/priv_readdwarf3.h 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/coregrind/m_debuginfo/priv_readdwarf3.h 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -46,13 +46,13 @@
UChar* debug_types_img, SizeT debug_types_sz,
UChar* debug_abbv_img, SizeT debug_abbv_sz,
UChar* debug_line_img, SizeT debug_line_sz,
- UChar* debug_str_img, SizeT debug_str_sz,
+ HChar* debug_str_img, SizeT debug_str_sz,
UChar* debug_ranges_img, SizeT debug_ranges_sz,
UChar* debug_loc_img, SizeT debug_loc_sz,
UChar* debug_info_alt_img, SizeT debug_info_alt_sz,
UChar* debug_abbv_alt_img, SizeT debug_abbv_alt_sz,
UChar* debug_line_alt_img, SizeT debug_line_alt_sz,
- UChar* debug_str_alt_img, SizeT debug_str_alt_sz
+ HChar* debug_str_alt_img, SizeT debug_str_alt_sz
);
#endif /* ndef __PRIV_READDWARF3_H */
Modified: trunk/coregrind/m_debuginfo/priv_misc.h (+2 -2)
===================================================================
--- trunk/coregrind/m_debuginfo/priv_misc.h 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/coregrind/m_debuginfo/priv_misc.h 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -40,8 +40,8 @@
/* Allocate(zeroed), free, strdup, memdup, all in VG_AR_DINFO. */
void* ML_(dinfo_zalloc)( const HChar* cc, SizeT szB );
void ML_(dinfo_free)( void* v );
-UChar* ML_(dinfo_strdup)( const HChar* cc, const UChar* str );
-UChar* ML_(dinfo_memdup)( const HChar* cc, UChar* str, SizeT nStr );
+HChar* ML_(dinfo_strdup)( const HChar* cc, const HChar* str );
+void* ML_(dinfo_memdup)( const HChar* cc, void* str, SizeT nStr );
/* Extract (possibly unaligned) data of various sizes from a buffer. */
Short ML_(read_Short)( UChar* data );
Modified: trunk/coregrind/m_debuginfo/misc.c (+3 -3)
===================================================================
--- trunk/coregrind/m_debuginfo/misc.c 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/coregrind/m_debuginfo/misc.c 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -55,12 +55,12 @@
VG_(arena_free)( VG_AR_DINFO, v );
}
-UChar* ML_(dinfo_strdup) ( const HChar* cc, const UChar* str ) {
+HChar* ML_(dinfo_strdup) ( const HChar* cc, const HChar* str ) {
return VG_(arena_strdup)( VG_AR_DINFO, cc, str );
}
-UChar* ML_(dinfo_memdup) ( const HChar* cc, UChar* str, SizeT nStr ) {
- UChar* dst = VG_(arena_malloc)( VG_AR_DINFO, cc, nStr );
+void* ML_(dinfo_memdup) ( const HChar* cc, void* str, SizeT nStr ) {
+ void* dst = VG_(arena_malloc)( VG_AR_DINFO, cc, nStr );
tl_assert(dst);
VG_(memcpy)(dst, str, nStr);
return dst;
Modified: trunk/include/pub_tool_debuginfo.h (+13 -13)
===================================================================
--- trunk/include/pub_tool_debuginfo.h 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/include/pub_tool_debuginfo.h 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -41,11 +41,11 @@
returns False and nothing is copied. VG_(get_fnname) always
demangles C++ function names. VG_(get_fnname_w_offset) is the
same, except it appends "+N" to symbol names to indicate offsets. */
-extern Bool VG_(get_filename) ( Addr a, Char* filename, Int n_filename );
-extern Bool VG_(get_fnname) ( Addr a, Char* fnname, Int n_fnname );
+extern Bool VG_(get_filename) ( Addr a, HChar* filename, Int n_filename );
+extern Bool VG_(get_fnname) ( Addr a, HChar* fnname, Int n_fnname );
extern Bool VG_(get_linenum) ( Addr a, UInt* linenum );
extern Bool VG_(get_fnname_w_offset)
- ( Addr a, Char* fnname, Int n_fnname );
+ ( Addr a, HChar* fnname, Int n_fnname );
/* This one is the most general. It gives filename, line number and
optionally directory name. filename and linenum may not be NULL.
@@ -60,8 +60,8 @@
found. */
extern Bool VG_(get_filename_linenum)
( Addr a,
- /*OUT*/Char* filename, Int n_filename,
- /*OUT*/Char* dirname, Int n_dirname,
+ /*OUT*/HChar* filename, Int n_filename,
+ /*OUT*/HChar* dirname, Int n_dirname,
/*OUT*/Bool* dirname_available,
/*OUT*/UInt* linenum );
@@ -72,7 +72,7 @@
a particular function. Nb: if an executable/shared object is stripped
of its symbols, this function will not be able to recognise function
entry points within it. */
-extern Bool VG_(get_fnname_if_entry) ( Addr a, Char* fnname, Int n_fnname );
+extern Bool VG_(get_fnname_if_entry) ( Addr a, HChar* fnname, Int n_fnname );
typedef
enum {
@@ -82,7 +82,7 @@
} Vg_FnNameKind; // Such names are often filtered.
/* Indicates what kind of fnname it is. */
-extern Vg_FnNameKind VG_(get_fnname_kind) ( Char* name );
+extern Vg_FnNameKind VG_(get_fnname_kind) ( HChar* name );
/* Like VG_(get_fnname_kind), but takes a code address. */
extern Vg_FnNameKind VG_(get_fnname_kind_from_IP) ( Addr ip );
@@ -92,7 +92,7 @@
which is guaranteed to be zero terminated. Also data_addr's offset
from the symbol start is put into *offset. */
extern Bool VG_(get_datasym_and_offset)( Addr data_addr,
- /*OUT*/Char* dname, Int n_dname,
+ /*OUT*/HChar* dname, Int n_dname,
/*OUT*/PtrdiffT* offset );
/* Try to form some description of DATA_ADDR by looking at the DWARF3
@@ -116,7 +116,7 @@
/* Succeeds if the address is within a shared object or the main executable.
It doesn't matter if debug info is present or not. */
-extern Bool VG_(get_objname) ( Addr a, Char* objname, Int n_objname );
+extern Bool VG_(get_objname) ( Addr a, HChar* objname, Int n_objname );
/* Puts into 'buf' info about the code address %eip: the address, function
name (if known) and filename/line number (if known), like this:
@@ -125,7 +125,7 @@
'n_buf' gives length of 'buf'. Returns 'buf'.
*/
-extern Char* VG_(describe_IP)(Addr eip, Char* buf, Int n_buf);
+extern HChar* VG_(describe_IP)(Addr eip, HChar* buf, Int n_buf);
/* Get an XArray of StackBlock which describe the stack (auto) blocks
@@ -190,8 +190,8 @@
SizeT VG_(DebugInfo_get_gotplt_size) ( const DebugInfo *di );
Addr VG_(DebugInfo_get_got_avma) ( const DebugInfo *di );
SizeT VG_(DebugInfo_get_got_size) ( const DebugInfo *di );
-const UChar* VG_(DebugInfo_get_soname) ( const DebugInfo *di );
-const UChar* VG_(DebugInfo_get_filename) ( const DebugInfo *di );
+const HChar* VG_(DebugInfo_get_soname) ( const DebugInfo *di );
+const HChar* 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
@@ -244,7 +244,7 @@
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). */
-VgSectKind VG_(DebugInfo_sect_kind)( /*OUT*/UChar* name, SizeT n_name,
+VgSectKind VG_(DebugInfo_sect_kind)( /*OUT*/HChar* name, SizeT n_name,
Addr a);
Modified: trunk/coregrind/m_debuginfo/priv_readpdb.h (+1 -1)
===================================================================
--- trunk/coregrind/m_debuginfo/priv_readpdb.h 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/coregrind/m_debuginfo/priv_readpdb.h 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -44,7 +44,7 @@
PtrdiffT obj_bias,
void* pdbimage,
SizeT n_pdbimage,
- Char* pdbname,
+ HChar* pdbname,
ULong pdbmtime
);
Modified: trunk/include/pub_tool_gdbserver.h (+2 -2)
===================================================================
--- trunk/include/pub_tool_gdbserver.h 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/include/pub_tool_gdbserver.h 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -94,7 +94,7 @@
write_watchpoint,
read_watchpoint,
access_watchpoint } PointKind;
-extern char* VG_(ppPointKind) (PointKind kind);
+extern const HChar* VG_(ppPointKind) (PointKind kind);
/* watchpoint support --------------------------------------*/
@@ -160,7 +160,7 @@
kwd_report_none,
kwd_report_all,
kwd_report_duplicated_matches } kwd_report_error;
-extern Int VG_(keyword_id) (Char* keywords, Char* input_word,
+extern Int VG_(keyword_id) (HChar* keywords, HChar* input_word,
kwd_report_error report);
/* Extract an address and (optionally) a size from the string
Modified: trunk/coregrind/m_gdbserver/server.c (+1 -1)
===================================================================
--- trunk/coregrind/m_gdbserver/server.c 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/coregrind/m_gdbserver/server.c 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -599,7 +599,7 @@
}
VG_(lseek) (fd, ofs, VKI_SEEK_SET);
len_read = VG_(read) (fd, toread, len);
- *new_packet_len_p = write_qxfer_response (arg_own_buf, toread,
+ *new_packet_len_p = write_qxfer_response (arg_own_buf, (unsigned char *)toread,
len_read, ofs + len_read < doc_len);
VG_(close) (fd);
return;
Modified: trunk/coregrind/m_debuginfo/readelf.c (+52 -52)
===================================================================
--- trunk/coregrind/m_debuginfo/readelf.c 2012-11-11 13:59:54 +00:00 (rev 13121)
+++ trunk/coregrind/m_debuginfo/readelf.c 2012-11-15 04:27:04 +00:00 (rev 13122)
@@ -146,7 +146,7 @@
static
void show_raw_elf_symbol ( Int i,
- ElfXX_Sym* sym, Char* sym_name, Addr sym_svma,
+ ElfXX_Sym* sym, const HChar* sym_name, Addr sym_svma,
Bool ppc64_linux_format )
{
HChar* space = ppc64_linux_format ? " " : "";
@@ -171,7 +171,7 @@
}
VG_(printf)(": svma %#010lx, %ssz %4ld %s\n",
sym_svma, space, sym->st_size + 0UL,
- ( sym->st_name ? sym_name : (Char*)"NONAME" ) );
+ ( sym->st_name ? sym_name : "NONAME" ) );
}
@@ -207,13 +207,13 @@
/* INPUTS */
struct _DebugInfo* di, /* containing DebugInfo */
ElfXX_Sym* sym, /* ELF symbol */
- Char* sym_name, /* name */
+ HChar* sym_name, /* name */
Addr sym_svma, /* address as stated in the object file */
Bool symtab_in_debug, /* symbol table is in the debug file */
UChar* opd_img, /* oimage of .opd sec (ppc64-linux only) */
PtrdiffT opd_bias, /* for biasing AVMAs found in .opd */
/* OUTPUTS */
- Char** sym_name_out, /* name we should record */
+ HChar** sym_name_out, /* name we should record */
Addr* sym_avma_out, /* addr we should record */
Int* sym_size_out, /* symbol size */
Addr* sym_tocptr_out, /* ppc64-linux only: R2 value to be
@@ -613,16 +613,16 @@
static
__attribute__((unused)) /* not referred to on all targets */
void read_elf_symtab__normal(
- struct _DebugInfo* di, UChar* tab_name,
+ struct _DebugInfo* di, const HChar* tab_name,
ElfXX_Sym* symtab_img, SizeT symtab_szB,
- UChar* strtab_img, SizeT strtab_szB,
+ HChar* strtab_img, SizeT strtab_szB,
Bool symtab_in_debug,
UChar* opd_img /* ppc64-linux only */
)
{
Word i;
Addr sym_svma, sym_avma_really;
- Char *sym_name, *sym_name_really;
+ HChar *sym_name, *sym_name_really;
Int sym_size;
Addr sym_tocptr;
Bool from_opd, is_text, is_ifunc;
@@ -630,7 +630,7 @@
ElfXX_Sym *sym;
if (strtab_img == NULL || symtab_img == NULL) {
- Char buf[80];
+ HChar buf[80];
vg_assert(VG_(strlen)(tab_name) < 40);
VG_(sprintf)(buf, " object doesn't have a %s", tab_name);
ML_(symerr)(di, False, buf);
@@ -644,7 +644,7 @@
0 always denotes 'unknown symbol'. */
for (i = 1; i < (Word)(symtab_szB/sizeof(ElfXX_Sym)); i++) {
sym = & symtab_img[i];
- sym_name = (UChar*)(strtab_img + sym->st_name);
+ sym_name = strtab_img + sym->st_name;
sym_svma = sym->st_value;
if (di->trace_symtab)
@@ -692,7 +692,7 @@
typedef
struct {
Addr addr;
- UChar* name;
+ HChar* name;
}
TempSymKey;
@@ -716,9 +716,9 @@
static
__attribute__((unused)) /* not referred to on all targets */
void read_elf_symtab__ppc64_linux(
- struct _DebugInfo* di, UChar* tab_name,
+ struct _DebugInfo* di, const HChar* tab_name,
ElfXX_Sym* symtab_img, SizeT symtab_szB,
- UChar* strtab_img, SizeT strtab_szB,
+ HChar* strtab_img, SizeT strtab_szB,
Bool symtab_in_debug,
UChar* opd_img /* ppc64-linux only */
)
@@ -726,7 +726,7 @@
Word i;
Int old_size;
Addr sym_svma, sym_avma_really;
- Char *sym_name, *sym_name_really;
+ HChar *sym_name, *sym_name_really;
Int sym_size;
Addr sym_tocptr;
Bool from_opd, modify_size, modify_tocptr, is_text, is_ifunc;
@@ -738,7 +738,7 @@
TempSym *prev;
if (strtab_img == NULL || symtab_img == NULL) {
- Char buf[80];
+ HChar b...
[truncated message content] |