diff --git a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp --- a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp +++ b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp @@ -60,8 +60,8 @@ uint64_t GetMCInst(const uint8_t *opcode_data, size_t opcode_data_len, lldb::addr_t pc, llvm::MCInst &mc_inst) const; - void PrintMCInst(llvm::MCInst &mc_inst, std::string &inst_string, - std::string &comments_string); + void PrintMCInst(llvm::MCInst &mc_inst, lldb::addr_t pc, + std::string &inst_string, std::string &comments_string); void SetStyle(bool use_hex_immed, HexImmediateStyle hex_style); bool CanBranch(llvm::MCInst &mc_inst) const; bool HasDelaySlot(llvm::MCInst &mc_inst) const; @@ -607,7 +607,7 @@ if (inst_size > 0) { mc_disasm_ptr->SetStyle(use_hex_immediates, hex_style); - mc_disasm_ptr->PrintMCInst(inst, out_string, comment_string); + mc_disasm_ptr->PrintMCInst(inst, pc, out_string, comment_string); if (!comment_string.empty()) { AppendComment(comment_string); @@ -1290,6 +1290,8 @@ if (!instr_printer_up) return Instance(); + instr_printer_up->setPrintBranchImmAsAddress(true); + // Not all targets may have registered createMCInstrAnalysis(). std::unique_ptr instr_analysis_up( curr_target->createMCInstrAnalysis(instr_info_up.get())); @@ -1337,13 +1339,13 @@ } void DisassemblerLLVMC::MCDisasmInstance::PrintMCInst( - llvm::MCInst &mc_inst, std::string &inst_string, + llvm::MCInst &mc_inst, lldb::addr_t pc, std::string &inst_string, std::string &comments_string) { llvm::raw_string_ostream inst_stream(inst_string); llvm::raw_string_ostream comments_stream(comments_string); m_instr_printer_up->setCommentStream(comments_stream); - m_instr_printer_up->printInst(&mc_inst, 0, llvm::StringRef(), + m_instr_printer_up->printInst(&mc_inst, pc, llvm::StringRef(), *m_subtarget_info_up, inst_stream); m_instr_printer_up->setCommentStream(llvm::nulls()); comments_stream.flush();