Skip to content

Commit bb3903c

Browse files
committed
DisassembleRequestHandler address comparison workaround
1 parent 419aa75 commit bb3903c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lldb/test/API/tools/lldb-dap/disassemble/TestDAP_disassemble.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def test_disassemble(self):
2020
program = self.getBuildArtifact("a.out")
2121
self.build_and_launch(program)
2222
source = "main.c"
23-
self.source_path = os.path.join(os.getcwd(), source)
2423
self.set_source_breakpoints(source, [line_number(source, "// breakpoint 1")])
2524
self.continue_to_next_stop()
2625

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)