allow dump_syms to operate on contents in memory

dump_syms assumes it is operating on a file and can access a compliant
file system. This change allows dump_syms to operate on the contents of
a file that has already been read into memory. This is useful in a
server context where the file does not exist on the local file system.

Change-Id: Id63f115c2df287083d548dadd5ac487f97bde057
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3327644
Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Adam Duke 2022-01-25 17:04:16 -05:00 committed by Mark Mentovai
parent 92a20b6504
commit 772cfc1db6
7 changed files with 97 additions and 230 deletions

View file

@ -1449,7 +1449,7 @@ bool MinidumpGenerator::WriteCVRecord(MDRawModule* module, int cpu_type,
unsigned char identifier[16];
bool result = false;
if (in_memory) {
MacFileUtilities::MachoID macho(module_path,
MacFileUtilities::MachoID macho(
reinterpret_cast<void*>(module->base_of_image),
static_cast<size_t>(module->size_of_image));
result = macho.UUIDCommand(cpu_type, CPU_SUBTYPE_MULTIPLE, identifier);