minidump: Add ability to attach (breakpad) symbol files to placeholder modules
authorPavel Labath <pavel@labath.sk>
Wed, 27 Mar 2019 10:54:10 +0000 (10:54 +0000)
committerPavel Labath <pavel@labath.sk>
Wed, 27 Mar 2019 10:54:10 +0000 (10:54 +0000)
commitee7ceacaca1da20a6287695536378a2060bdb6b9
tree0d80afdcd0807153fceb95afdff4fa4210e38f37
parent46edefe3c498f80999e1717d34e902a6d0fdf267
minidump: Add ability to attach (breakpad) symbol files to placeholder modules

This re-commits r354263, which was because it uncovered with handling of
modules with empty (zero) UUIDs. This would cause us to treat two
modules as intentical even though they were not. This caused an assert
in PlaceholderObjectFile::SetLoadAddress to fire, because we were trying
to load the module twice even though it was designed to be only loaded
at a specific address. (The same problem also existed with the previous
implementation, but it had no asserts to warn us about this.) These
issues have now been fixed in r356896.

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

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: 357060
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