make err msg in MachSymtabSectionInfo::GetSection clear about the file

This error message didn't specify which file was malformed, so
there's some hunting-around required if it comes up.  We have the
filename; include it in the error message.
This commit is contained in:
Jason Molenda 2019-12-18 16:11:06 -08:00
parent 7e8541f3df
commit 7026b34702
1 changed files with 8 additions and 2 deletions

View File

@ -1865,9 +1865,15 @@ public:
m_section_infos[n_sect].vm_range.SetByteSize(
section_sp->GetByteSize());
} else {
const char *filename = "<unknown>";
SectionSP first_section_sp(m_section_list->GetSectionAtIndex(0));
if (first_section_sp)
filename = first_section_sp->GetObjectFile()->GetFileSpec().GetPath().c_str();
Host::SystemLog(Host::eSystemLogError,
"error: unable to find section for section %u\n",
n_sect);
"error: unable to find section %d for a symbol in %s, corrupt file?\n",
n_sect,
filename);
}
}
if (m_section_infos[n_sect].vm_range.Contains(file_addr)) {