* produce (more) user messages when valgrind cannot read a pdb file.
* recover properly from an invalid/unsupported pdb file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16465
381805 arm32 needs ld.so index hardwire for new glibc security fixes
382256 gz compiler flag test doesn't work for gold
382407 vg_perf needs "--terse" command line option
-
+382515 "Assertion 'di->have_dinfo' failed." on wine's dlls/mscoree/tests/mscoree.c
Release 3.13.0 (15 June 2017)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/* don't set up any of the di-> fields; let
ML_(read_pdb_debug_info) do it. */
- ML_(read_pdb_debug_info)( di, avma_obj, bias_obj,
- pdbimage, n_pdbimage, pdbname, pdb_mtime );
- // JRS fixme: take notice of return value from read_pdb_debug_info,
- // and handle failure
- vg_assert(di->have_dinfo); // fails if PDB read failed
+ if (ML_(read_pdb_debug_info)( di, avma_obj, bias_obj,
+ pdbimage, n_pdbimage, pdbname, pdb_mtime )) {
+ vg_assert(di->have_dinfo); // fails if PDB read failed
+ if (VG_(clo_verbosity) > 0) {
+ VG_(message)(Vg_UserMsg, "LOAD_PDB_DEBUGINFO: done: "
+ "%lu syms, %lu src locs, %lu fpo recs\n",
+ di->symtab_used, di->loctab_used, di->fpo_size);
+ }
+ } else {
+ VG_(message)(Vg_UserMsg, "LOAD_PDB_DEBUGINFO: failed loading info "
+ "from %s\n", pdbname);
+ discard_DebugInfo (di);
+ }
VG_(am_munmap_valgrind)( (Addr)pdbimage, n_pdbimage );
VG_(close)(fd_pdbimage);
- if (VG_(clo_verbosity) > 0) {
- VG_(message)(Vg_UserMsg, "LOAD_PDB_DEBUGINFO: done: "
- "%lu syms, %lu src locs, %lu fpo recs\n",
- di->symtab_used, di->loctab_used, di->fpo_size);
- }
}
out:
{
static const HChar pdbtxt[]= "Microsoft C/C++";
HChar* txteof = VG_(strchr)(pdbimage, '\032');
- if (! txteof)
+ if (! txteof) {
+ VG_(umsg)("LOAD_PDB_DEBUGINFO: \\032 header character not found. "
+ " possible invalid/unsupported pdb file format?\n");
return NULL;
- if (0!=VG_(strncmp)(pdbimage, pdbtxt, -1+ sizeof(pdbtxt)))
+ }
+ if (0!=VG_(strncmp)(pdbimage, pdbtxt, -1+ sizeof(pdbtxt))) {
+ VG_(umsg)("LOAD_PDB_DEBUGINFO: %s header string not found. "
+ " possible invalid/unsupported pdb file format?\n",
+ pdbtxt);;
return NULL;
+ }
*signature = *(unsigned*)(1+ txteof);
HChar *img_addr = pdbimage; // so we can do address arithmetic
VG_(umsg)("LOAD_PDB_DEBUGINFO: Processing PDB file %s\n", pdbname );
dos_avma = (IMAGE_DOS_HEADER *)obj_avma;
- if (dos_avma->e_magic != IMAGE_DOS_SIGNATURE)
- return False;
+ if (dos_avma->e_magic != IMAGE_DOS_SIGNATURE) {
+ VG_(umsg)("LOAD_PDB_DEBUGINFO: IMAGE_DOS_SIGNATURE not found. "
+ " possible invalid/unsupported pdb file format?\n");
+ return False;
+ }
ntheaders_avma
= (IMAGE_NT_HEADERS *)((Char*)dos_avma + dos_avma->e_lfanew);
- if (ntheaders_avma->Signature != IMAGE_NT_SIGNATURE)
+ if (ntheaders_avma->Signature != IMAGE_NT_SIGNATURE) {
+ VG_(umsg)("LOAD_PDB_DEBUGINFO: IMAGE_NT_SIGNATURE not found. "
+ " possible invalid/unsupported pdb file format?\n");
return False;
+ }
sectp_avma
= (IMAGE_SECTION_HEADER *)(
*/
signature = 0;
hdr = find_pdb_header( pdbimage, &signature );
- if (0==hdr)
+ if (0==hdr) {
+ VG_(umsg)("LOAD_PDB_DEBUGINFO: find_pdb_header found no hdr. "
+ " possible invalid/unsupported pdb file format?\n");
return False; /* JRS: significance? no pdb header? */
+ }
VG_(memset)(&reader, 0, sizeof(reader));
reader.u.jg.header = hdr;