diff options
author | Johnny Chen <johnny.chen@apple.com> | 2011-05-20 17:27:37 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2011-05-20 17:27:37 +0000 |
commit | 02cefc2c237d0d8ae15a4915f0386543dc191fca (patch) | |
tree | f33c8692bcf67bd67ba0fa1fc541340338c9409a /lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp | |
parent | 6ab2fa8f78f4c76da056580ec3ee1780eab08c76 (diff) | |
download | bcm5719-llvm-02cefc2c237d0d8ae15a4915f0386543dc191fca.tar.gz bcm5719-llvm-02cefc2c237d0d8ae15a4915f0386543dc191fca.zip |
Workaround the issue of llvm:tB (A8.6.16 B Encoding T2) not being processed as
a branch instruction and therefore the symbolic information is not being dumped for
non-raw mode.
The problem is that the ARMAsmParser is not recognizing the "#274" in "b #274"
as a valid operand when doing disassembly in non-raw mode.
llvm-svn: 131738
Diffstat (limited to 'lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp')
-rw-r--r-- | lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp index 9be65dc11ee..90e6413795e 100644 --- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp +++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp @@ -310,6 +310,30 @@ InstructionLLVM::Dump } } // for (tokenIndex) + // FIXME!!! + // Workaround for llvm::tB's operands not properly parsed by ARMAsmParser. + if (m_arch_type == llvm::Triple::thumb && opcode.GetString() == "b") { + const char *inst_str; + char *pos = NULL; + if (EDGetInstString(&inst_str, m_inst) == 0 && (pos = strstr(inst_str, "#")) != NULL) { + uint64_t operand_value = PC + atoi(++pos); + operands.Printf("0x%llx ", operand_value); + + lldb_private::Address so_addr; + if (exe_ctx && exe_ctx->target && !exe_ctx->target->GetSectionLoadList().IsEmpty()) { + if (exe_ctx->target->GetSectionLoadList().ResolveLoadAddress (operand_value, so_addr)) + so_addr.Dump(&comment, exe_scope, Address::DumpStyleResolvedDescriptionNoModule, Address::DumpStyleSectionNameOffset); + } else { + Module *module = GetAddress().GetModule(); + if (module) { + if (module->ResolveFileAddress (operand_value, so_addr)) + so_addr.Dump(&comment, exe_scope, Address::DumpStyleResolvedDescriptionNoModule, Address::DumpStyleSectionNameOffset); + } + } + } + } + // END of workaround. + // If both operands and comment are empty, we will just print out // the raw disassembly. if (operands.GetString().empty() && comment.GetString().empty()) |