Skip to content

[lldb-dap] Fix address comparison in DisassembleRequestHandler #140975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lldb/tools/lldb-dap/Handler/DisassembleRequestHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ static DisassembledInstruction ConvertSBInstructionToDisassembledInstruction(

auto addr = inst.GetAddress();
const auto inst_addr = addr.GetLoadAddress(target);

// FIXME: This is a workaround - this address might come from
// disassembly that started in a different section, and thus
// comparisons between this object and other address objects with the
// same load address will return false.
addr = lldb::SBAddress(inst_addr, target);

const char *m = inst.GetMnemonic(target);
const char *o = inst.GetOperands(target);
const char *c = inst.GetComment(target);
Expand Down
Loading