minidump: Add ability to attach (breakpad) symbol files to placeholder modules
authorPavel Labath <pavel@labath.sk>
Mon, 11 Feb 2019 09:32:08 +0000 (09:32 +0000)
committerPavel Labath <pavel@labath.sk>
Mon, 11 Feb 2019 09:32:08 +0000 (09:32 +0000)
commit734648bb4affcecbf3435c8c8f8459968abce577
tree84e4b96029d04d71cc07defce5d2379f1a02c789
parent9beadff6a57b7a954f0d6bf2c68b4a7dff70d74d
minidump: Add ability to attach (breakpad) symbol files to placeholder modules

Summary:
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: 353677
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