Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minidump: Add ability to attach (breakpad) symbol files to placeholde…
…r 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
- Loading branch information
Showing
5 changed files
with
115 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
MODULE Linux x86_64 3B285CE327C387C262DB788BF5A4078B0 linux-x86_64 | ||
INFO CODE_ID E35C283BC327C28762DB788BF5A4078BE2351448 | ||
FUNC 3d0 18 0 crash() | ||
FUNC 3f0 10 0 _start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Test that we can attach breakpad symbols to the "placeholder" modules created | ||
# for minidump files. | ||
# | ||
# The minidump input for this test taken from packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new | ||
|
||
# RUN: %lldb -c %S/Inputs/linux-x86_64.dmp \ | ||
# RUN: -o "target symbols add -s /tmp/test/linux-x86_64 %S/Inputs/linux-x86_64.syms" \ | ||
# RUN: -s %s -o exit | FileCheck %s | ||
|
||
image list | ||
# CHECK-LABEL: image list | ||
# CHECK: E35C283B-C327-C287-62DB-788BF5A4078B-E2351448 0x0000000000400000 /tmp/test/linux-x86_64 | ||
|
||
image dump symtab /tmp/test/linux-x86_64 | ||
# CHECK-LABEL: image dump symtab /tmp/test/linux-x86_64 | ||
# CHECK: Symtab, file = /tmp/test/linux-x86_64, num_symbols = 2: | ||
# CHECK: [ 0] 0 X Code 0x00000000004003d0 0x00000000004003d0 0x0000000000000018 0x00000000 crash() | ||
# CHECK: [ 1] 0 X Code 0x00000000004003f0 0x00000000004003f0 0x0000000000000010 0x00000000 _start | ||
|
||
image lookup -a 0x4003f3 | ||
# CHECK-LABEL: image lookup -a 0x4003f3 | ||
# CHECK: Summary: linux-x86_64`_start + 3 | ||
|
||
image dump objfile /tmp/test/linux-x86_64 | ||
# CHECK-LABEL: image dump objfile /tmp/test/linux-x86_64 | ||
# CHECK: Placeholder object file for /tmp/test/linux-x86_64 loaded at [0x400000-0x401000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters