Change ProcessMachCore to search for both a user-process dyld binary
and a mach kernel in all the pages of the core file. If it finds a user-process dyld binary, assume this is a user process that had a copy of the mach kernel in memory when it crashed (e.g. lldb doing kernel debugging) even though we found the kernel binary first. Also, change the error messages about sections extending past the end of the file to be warnings and make the messages sound less severe. Most user process core files have one section that isn't included in the file and there's no reason to worry people about that. <rdar://problem/14473235> llvm-svn: 190741
This commit is contained in:
@@ -1040,7 +1040,7 @@ ObjectFileMachO::CreateSections (SectionList &unified_section_list)
|
||||
// is null out the SectionList vector and if a process has been set up, dump a message
|
||||
// to stdout. The most common case here is core file debugging with a truncated file.
|
||||
const char *lc_segment_name = load_cmd.cmd == LC_SEGMENT_64 ? "LC_SEGMENT_64" : "LC_SEGMENT";
|
||||
module_sp->ReportError("is a corrupt mach-o file: load command %u %s has a fileoff (0x%" PRIx64 ") that extends beyond the end of the file (0x%" PRIx64 ")",
|
||||
module_sp->ReportWarning("load command %u %s has a fileoff (0x%" PRIx64 ") that extends beyond the end of the file (0x%" PRIx64 "), ignoring this section",
|
||||
i,
|
||||
lc_segment_name,
|
||||
load_cmd.fileoff,
|
||||
@@ -1058,7 +1058,7 @@ ObjectFileMachO::CreateSections (SectionList &unified_section_list)
|
||||
// is null out the SectionList vector and if a process has been set up, dump a message
|
||||
// to stdout. The most common case here is core file debugging with a truncated file.
|
||||
const char *lc_segment_name = load_cmd.cmd == LC_SEGMENT_64 ? "LC_SEGMENT_64" : "LC_SEGMENT";
|
||||
GetModule()->ReportError("is a corrupt mach-o file: load command %u %s has a fileoff + filesize (0x%" PRIx64 ") that extends beyond the end of the file (0x%" PRIx64 "), the segment will be truncated",
|
||||
GetModule()->ReportWarning("load command %u %s has a fileoff + filesize (0x%" PRIx64 ") that extends beyond the end of the file (0x%" PRIx64 "), the segment will be truncated to match",
|
||||
i,
|
||||
lc_segment_name,
|
||||
load_cmd.fileoff + load_cmd.filesize,
|
||||
|
||||
Reference in New Issue
Block a user