From c0a779600707af9e6faf8552134a3cc05219f75a Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sat, 27 Jul 2013 19:07:02 -0400 Subject: [PATCH] Debugger: Fix step over on x86-64. DisassemblerX8664::GetNextInstructionInfo() was mistakenly truncating the instruction address due to a copy-and-paste bug when it was initially spawned off DisassemblerX86. This would result in the temporary breakpoints for skipping over function calls never getting set properly, leading to us stepping into the PLT on a step over. --- .../debugger/arch/x86_64/disasm/DisassemblerX8664.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apps/debugger/arch/x86_64/disasm/DisassemblerX8664.cpp b/src/apps/debugger/arch/x86_64/disasm/DisassemblerX8664.cpp index 07424ce51b..70bbf04192 100644 --- a/src/apps/debugger/arch/x86_64/disasm/DisassemblerX8664.cpp +++ b/src/apps/debugger/arch/x86_64/disasm/DisassemblerX8664.cpp @@ -111,10 +111,10 @@ DisassemblerX8664::GetNextInstruction(BString& line, target_addr_t& _address, if (size < 1) return B_ENTRY_NOT_FOUND; - uint64 address = ud_insn_off(fUdisData); + target_addr_t address = ud_insn_off(fUdisData); char buffer[256]; - snprintf(buffer, sizeof(buffer), "0x%08" B_PRIx64 ": %16.16s %s", address, + snprintf(buffer, sizeof(buffer), "0x%016" B_PRIx64 ": %16.16s %s", address, ud_insn_hex(fUdisData), ud_insn_asm(fUdisData)); // TODO: Resolve symbols! @@ -159,7 +159,7 @@ DisassemblerX8664::GetNextInstructionInfo(InstructionInfo& _info, if (size < 1) return B_ENTRY_NOT_FOUND; - uint32 address = (uint32)ud_insn_off(fUdisData); + target_addr_t address = ud_insn_off(fUdisData); instruction_type type = INSTRUCTION_TYPE_OTHER; target_addr_t targetAddress = 0; @@ -172,7 +172,7 @@ DisassemblerX8664::GetNextInstructionInfo(InstructionInfo& _info, targetAddress = GetInstructionTargetAddress(state); char buffer[256]; - snprintf(buffer, sizeof(buffer), "0x%08" B_PRIx32 ": %16.16s %s", address, + snprintf(buffer, sizeof(buffer), "0x%016" B_PRIx64 ": %16.16s %s", address, ud_insn_hex(fUdisData), ud_insn_asm(fUdisData)); // TODO: Resolve symbols!