Skip to content

Commit 35c15e4

Browse files
authored
[lldb-dap] Fix address comparison in DisassembleRequestHandler (#140975)
Fix comparisons between addresses with the same load address that can unexpectedly return false in `DisassembleRequestHandler`
1 parent 795e889 commit 35c15e4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lldb/tools/lldb-dap/Handler/DisassembleRequestHandler.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ static DisassembledInstruction ConvertSBInstructionToDisassembledInstruction(
8787

8888
auto addr = inst.GetAddress();
8989
const auto inst_addr = addr.GetLoadAddress(target);
90+
91+
// FIXME: This is a workaround - this address might come from
92+
// disassembly that started in a different section, and thus
93+
// comparisons between this object and other address objects with the
94+
// same load address will return false.
95+
addr = lldb::SBAddress(inst_addr, target);
96+
9097
const char *m = inst.GetMnemonic(target);
9198
const char *o = inst.GetOperands(target);
9299
const char *c = inst.GetComment(target);

0 commit comments

Comments
 (0)