diff options
Diffstat (limited to 'gprofng/src/Dwarf.cc')
-rw-r--r-- | gprofng/src/Dwarf.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gprofng/src/Dwarf.cc b/gprofng/src/Dwarf.cc index 1b33ae8..5485be7 100644 --- a/gprofng/src/Dwarf.cc +++ b/gprofng/src/Dwarf.cc @@ -606,12 +606,15 @@ Dwarf::archive_Dwarf (LoadObject *lo) { mod->hdrOffset = dwrCUs->size (); DwrLineRegs *lineReg = dwrCU->get_dwrLineReg (); - dwrCU->srcFiles = new Vector<SourceFile *> (VecSize (lineReg->file_names)); - for (long i = 0, sz = VecSize (lineReg->file_names); i < sz; i++) + if (lineReg != NULL) { - char *fname = lineReg->getPath (i + 1); - SourceFile *sf = mod->findSource (fname, true); - dwrCU->srcFiles->append (sf); + dwrCU->srcFiles = new Vector<SourceFile *> (VecSize (lineReg->file_names)); + for (long i = 0, sz = VecSize (lineReg->file_names); i < sz; i++) + { + char *fname = lineReg->getPath (i + 1); + SourceFile *sf = mod->findSource (fname, true); + dwrCU->srcFiles->append (sf); + } } Dwarf_cnt ctx; @@ -986,9 +989,6 @@ DwrCU::append_Function (Dwarf_cnt *ctx) if (lineno > 0) { func->setLineFirst (lineno); - if (dwrLineReg == NULL) - dwrLineReg = new DwrLineRegs (new DwrSec (dwarf->debug_lineSec, - stmt_list_offset), comp_dir); int fileno = ((int) Dwarf_data (DW_AT_decl_file)) - 1; SourceFile *sf = ((fileno >= 0) && (fileno < VecSize (srcFiles))) ? srcFiles->get (fileno) : module->getMainSrc (); |