diff options
author | Ed Maste <emaste@freebsd.org> | 2017-10-02 14:35:07 +0000 |
---|---|---|
committer | Ed Maste <emaste@freebsd.org> | 2017-10-02 14:35:07 +0000 |
commit | d13f691f41c94b8681829c85ecb7a23fcbb9caf1 (patch) | |
tree | 42395ba6f8765094749b3337d444e2fbc1aa11d9 /lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | |
parent | e2aa5b2ace432d24be067044a333128514b46faf (diff) | |
download | bcm5719-llvm-d13f691f41c94b8681829c85ecb7a23fcbb9caf1.tar.gz bcm5719-llvm-d13f691f41c94b8681829c85ecb7a23fcbb9caf1.zip |
Improve FreeBSD kernel debugging
FreeBSD kernel modules are actually relocatable (.o) ELF files and this
previously caused some issues for LLDB. This change addresses these when
using lldb to symbolicate FreeBSD kernel backtraces.
The major problems:
- Relocations were not being applied to the DWARF debug info despite
there being code to do this. Several issues prevented it from working:
- Relocations are computed at the same time as the symbol table, but
in the case of split debug files, symbol table parsing always
redirects to the primary object file, meaning that relocations would
never be applied in the debug file.
- There's actually no guarantee that the symbol table has been parsed
yet when trying to parse debug information.
- When actually applying relocations, it will segfault because the
object files are not mapped with MAP_PRIVATE and PROT_WRITE.
- LLDB returned invalid results when performing ordinary address-to-
symbol resolution. It turned out that the addresses specified in the
section headers were all 0, so LLDB believed all the sections had
overlapping "file addresses" and would sometimes return a symbol from
the wrong section.
Patch by Brian Koropoff
Differential Revision: https://reviews.llvm.org/D38142
llvm-svn: 314672
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp')
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 4642c2e14dd..27752da86eb 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -436,7 +436,7 @@ void SymbolFileDWARF::InitializeObject() { ModuleSP module_sp(m_obj_file->GetModule()); if (module_sp) { const SectionList *section_list = module_sp->GetSectionList(); - const Section *section = + Section *section = section_list->FindSectionByName(GetDWARFMachOSegmentName()).get(); // Memory map the DWARF mach-o segment so we have everything mmap'ed |