Author: Ely Ronnen Date: 2025-05-23T22:17:13+02:00 New Revision: 35c15e41ae9ce0c503efacda592c1aa5eb61e6ec
URL: https://github.com/llvm/llvm-project/commit/35c15e41ae9ce0c503efacda592c1aa5eb61e6ec DIFF: https://github.com/llvm/llvm-project/commit/35c15e41ae9ce0c503efacda592c1aa5eb61e6ec.diff LOG: [lldb-dap] Fix address comparison in DisassembleRequestHandler (#140975) Fix comparisons between addresses with the same load address that can unexpectedly return false in `DisassembleRequestHandler` Added: Modified: lldb/tools/lldb-dap/Handler/DisassembleRequestHandler.cpp Removed: ################################################################################ diff --git a/lldb/tools/lldb-dap/Handler/DisassembleRequestHandler.cpp b/lldb/tools/lldb-dap/Handler/DisassembleRequestHandler.cpp index 9aa6995e5d668..c9061ef19f17a 100644 --- a/lldb/tools/lldb-dap/Handler/DisassembleRequestHandler.cpp +++ b/lldb/tools/lldb-dap/Handler/DisassembleRequestHandler.cpp @@ -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 diff erent 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); _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits