diff options
| author | Jaydeep Patil <jaydeep.patil@imgtec.com> | 2015-09-22 06:36:56 +0000 |
|---|---|---|
| committer | Jaydeep Patil <jaydeep.patil@imgtec.com> | 2015-09-22 06:36:56 +0000 |
| commit | 44d07fcc7c610730950e7e914e9e3bfb6736e65e (patch) | |
| tree | 6f3879ca2b2d899443cec6ed9f9842cef9bf0f9d /lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | |
| parent | 132c2c4bc7fd53b85b68b2d05033e05aa2585587 (diff) | |
| download | bcm5719-llvm-44d07fcc7c610730950e7e914e9e3bfb6736e65e.tar.gz bcm5719-llvm-44d07fcc7c610730950e7e914e9e3bfb6736e65e.zip | |
[LLDB][MIPS] microMIPS breakpoints, disassembly and compressed addresses
SUMMARY:
This patch detects microMIPS symbols, sets breakpoints using un-compressed address and
display disassembly in mixed mode for microMIPS applications (running on bare-iron targets).
Reviewers: clayborg
Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
Differential Revision: http://reviews.llvm.org/D12079
llvm-svn: 248248
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp')
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index cdb1798f4e2..43c3d7676ec 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -1110,6 +1110,7 @@ struct ParseDWARFLineTableCallbackInfo { LineTable* line_table; std::unique_ptr<LineSequence> sequence_ap; + lldb::addr_t addr_mask; }; //---------------------------------------------------------------------- @@ -1139,7 +1140,7 @@ ParseDWARFLineTableCallback(dw_offset_t offset, const DWARFDebugLine::State& sta assert(info->sequence_ap.get()); } line_table->AppendLineEntryToSequence (info->sequence_ap.get(), - state.address, + state.address & info->addr_mask, state.line, state.column, state.file, @@ -1179,6 +1180,28 @@ SymbolFileDWARF::ParseCompileUnitLineTable (const SymbolContext &sc) { ParseDWARFLineTableCallbackInfo info; info.line_table = line_table_ap.get(); + + /* + * MIPS: + * The SymbolContext may not have a valid target, thus we may not be able + * to call Address::GetOpcodeLoadAddress() which would clear the bit #0 + * for MIPS. Use ArchSpec to clear the bit #0. + */ + ArchSpec arch; + GetObjectFile()->GetArchitecture(arch); + switch (arch.GetMachine()) + { + case llvm::Triple::mips: + case llvm::Triple::mipsel: + case llvm::Triple::mips64: + case llvm::Triple::mips64el: + info.addr_mask = ~((lldb::addr_t)1); + break; + default: + info.addr_mask = ~((lldb::addr_t)0); + break; + } + lldb::offset_t offset = cu_line_offset; DWARFDebugLine::ParseStatementTable(get_debug_line_data(), &offset, ParseDWARFLineTableCallback, &info); if (m_debug_map_symfile) |

