minidump: Add ability to attach (breakpad) symbol files to placeholder modules
authorPavel Labath <pavel@labath.sk>
Mon, 18 Feb 2019 11:55:01 +0000 (11:55 +0000)
committerPavel Labath <pavel@labath.sk>
Mon, 18 Feb 2019 11:55:01 +0000 (11:55 +0000)
commit515e7cdec04a4f77defecbc9453e11159b635ddf
tree7c0742e1ca09c9a864253f0a20cf413458eaf7ed
parentf53621bb0f52f2079163c96a86715deb512efb2e
minidump: Add ability to attach (breakpad) symbol files to placeholder modules

This re-commits r353677, which was reverted due to test failures on the
windows bot. The issue there was that ObjectFilePECOFF vended its base
address through the incorrect interface. SymbolFilePDB depended on that,
which lead to assertion failures when SymbolFilePDB was attempting to
use the placeholder object files as a base. This has been fixed in
r354258

It also fixes one small problem in the original patch. The issue was that the
Module class would attempt to overwrite the object file we created in
CreateModuleFromObjectFile if the file corresponding to the placeholder object
file happened to exist (but we have already disqualified it due to UUID
mismatch. The fix is simple -- we set the m_did_load_objfile flag to properly
record the fact that we have already created an object file for the module.

The original commit message was:

The reason this wasn't working was that ProcessMinidump was creating odd
object-file-less modules, and SymbolFileBreakpad required the module to
have an associated object file because it needed to get its base
address.

This fixes that by introducing a PlaceholderObjectFile to serve as a
dummy object file. The general idea for this is taken from D55142, but
I've reworked it a bit to avoid the need for the PlaceholderModule
class. Now that we have an object file, our modules are sufficiently
similar to regular modules that we can use the regular Module class
almost out of the box -- the only thing I needed to tweak was the
Module::CreateModuleFromObjectFile functon to set the module's FileSpec
in addition to it's architecture. This wasn't needed for ObjectFileJIT
(the other user of CreateModuleFromObjectFile), but it shouldn't hurt it
either, and the change seems like a straightforward extension of this
function.

Reviewers: clayborg, lemo, amccarth

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D57751

llvm-svn: 354263
lldb/include/lldb/Core/Module.h
lldb/lit/Minidump/Inputs/linux-x86_64.dmp [new file with mode: 0644]
lldb/lit/Minidump/Inputs/linux-x86_64.syms [new file with mode: 0644]
lldb/lit/Minidump/breakpad-symbols.test [new file with mode: 0644]
lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp