/*--- ---*/
/*------------------------------------------------------------*/
-static Bool debug = False; // JRS: fixme
-
static ULong DEBUG_SnarfCodeView(
DebugInfo* di,
IMAGE_SECTION_HEADER* sectp,
UChar* nmstr;
Char symname[4096 /*WIN32_PATH_MAX*/];
+ Bool debug = di->trace_symtab;
Addr bias = BIAS_FOR_SYMBOLS;
ULong n_syms_read = 0;
if (debug)
VG_(message)(Vg_UserMsg,
- "SnarfCodeView addr=%p offset=%d length=%d\n",
+ "BEGIN SnarfCodeView addr=%p offset=%d length=%d\n",
root, offset, size );
VG_(memset)(&vsym, 0, sizeof(vsym)); /* avoid holes */
symname[sym->data_v1.p_name.namelen] = '\0';
if (debug)
- VG_(message)(Vg_UserMsg, "Data %s\n", symname );
+ VG_(message)(Vg_UserMsg, " Data %s\n", symname );
if (0 /*VG_(needs).data_syms*/) {
nmstr = ML_(addStr)(di, symname, sym->data_v1.p_name.namelen);
if (debug)
VG_(message)(Vg_UserMsg,
- "S_GDATA_V2/S_LDATA_V2/S_PUB_V2 %s\n", symname );
+ " S_GDATA_V2/S_LDATA_V2/S_PUB_V2 %s\n", symname );
if (sym->generic.id==S_PUB_V2 /*VG_(needs).data_syms*/) {
nmstr = ML_(addStr)(di, symname, k);
if (debug)
VG_(message)(Vg_UserMsg,
- "S_PUB_FUNC1_V3/S_PUB_FUNC2_V3/S_PUB_V3 %s\n",
+ " S_PUB_FUNC1_V3/S_PUB_FUNC2_V3/S_PUB_V3 %s\n",
symname );
if (1 /*sym->generic.id==S_PUB_FUNC1_V3
vsym.isIFunc = False;
if (debug)
VG_(message)(Vg_UserMsg,
- "Adding function %s addr=%#lx length=%d\n",
+ " Adding function %s addr=%#lx length=%d\n",
symname, vsym.addr, vsym.size );
ML_(addSym)( di, &vsym );
n_syms_read++;
vsym.isIFunc = False;
if (debug)
VG_(message)(Vg_UserMsg,
- "Adding function %s addr=%#lx length=%d\n",
+ " Adding function %s addr=%#lx length=%d\n",
symname, vsym.addr, vsym.size );
ML_(addSym)( di, &vsym );
n_syms_read++;
case S_GPROC_V3: {
if (debug)
VG_(message)(Vg_UserMsg,
- "S_LPROC_V3/S_GPROC_V3 %s\n", sym->proc_v3.name );
+ " S_LPROC_V3/S_GPROC_V3 %s\n", sym->proc_v3.name );
if (1) {
nmstr = ML_(addStr)(di, sym->proc_v3.name,
} /* for ( i = offset; i < size; i += length ) */
+ if (debug)
+ VG_(message)(Vg_UserMsg,
+ "END SnarfCodeView addr=%p offset=%d length=%d\n",
+ root, offset, size );
return n_syms_read;
}
struct startend * start;
Int this_seg;
+ Bool debug = di->trace_symtab;
Addr bias = BIAS_FOR_LINETAB;
ULong n_lines_read = 0;
+ if (debug)
+ VG_(message)(Vg_UserMsg,
+ "BEGIN SnarfLineTab linetab=%p size=%d\n",
+ linetab, size );
+
/*
* Now get the important bits.
*/
if (debug)
VG_(message)(Vg_UserMsg,
- "Adding %d lines for file %s segment %d addr=%#x end=%#x\n",
+ " Adding %d lines for file %s segment %d addr=%#x end=%#x\n",
linecount, filename, segno, start[k].start, start[k].end );
for ( j = 0; j < linecount; j++ ) {
: start[k].end);
if (debug)
VG_(message)(Vg_UserMsg,
- "Adding line %d addr=%#lx end=%#lx\n",
+ " Adding line %d addr=%#lx end=%#lx\n",
((unsigned short *)(pnt2.ui + linecount))[j],
startaddr, endaddr );
ML_(addLineInfo)(
}
}
+ if (debug)
+ VG_(message)(Vg_UserMsg,
+ "END SnarfLineTab linetab=%p size=%d\n",
+ linetab, size );
+
return n_lines_read;
}
unsigned i;
struct codeview_linetab2_block* lbh;
struct codeview_linetab2_file* fd;
- //const Bool debug = False;
+ Bool debug = di->trace_symtab;
Addr bias = BIAS_FOR_LINETAB2;
ULong n_line2s_read = 0;
char *modimage;
char *file;
+ Bool debug = di->trace_symtab;
Addr bias_for_fpo = BIAS_FOR_FPO;
ULong n_fpos_read = 0, n_syms_read = 0,
*/
modimage = pdb->read_file( pdb, symbols.gsym_file, &len_modimage );
if (modimage) {
+ if (debug)
+ VG_(umsg)("\n");
if (VG_(clo_verbosity) > 1)
VG_(message)(Vg_UserMsg, "Reading global symbols\n" );
DEBUG_SnarfCodeView( di, sectp_avma, modimage, 0, len_modimage );
total_size = pdb_get_file_size(pdb, file_nr);
if (symbol_size) {
+ if (debug)
+ VG_(umsg)("\n");
if (VG_(clo_verbosity) > 1)
VG_(message)(Vg_UserMsg, "Reading symbols for %s\n",
file_name );
}
if (lineno_size) {
+ if (debug)
+ VG_(umsg)("\n");
if (VG_(clo_verbosity) > 1)
VG_(message)(Vg_UserMsg, "Reading lines for %s\n", file_name );
n_lines_read