[llvm-branch-commits] [lldb] release/22.x: [lldb-dap] Remove end line and column from disassemble response (#180037) (PR #180198)

Cullen Rhodes via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Feb 9 01:54:03 PST 2026


https://github.com/c-rhodes updated https://github.com/llvm/llvm-project/pull/180198

>From 8479c04674ffe146b523a3661ae4cec0cd7deaf4 Mon Sep 17 00:00:00 2001
From: Ebuka Ezike <e_ezike at apple.com>
Date: Fri, 6 Feb 2026 12:04:22 +0000
Subject: [PATCH] [lldb-dap] Remove end line and column from disassemble
 response (#180037)

The end line entry calculated from the instruction's end address is
unreliable and could produce incorrect source ranges. especially if the
instruction spans multiple lines.

We can end in situations where the current end line is the next start
line and the source line is show to the client twice. confusing users
what maps to what.

| With EndLine |
| :------------: |
| <img width="892" height="486" alt="Screenshot 2026-02-05 at 21 37 08"
src="https://github.com/user-attachments/assets/f2fef592-5754-4168-bf93-2baba4742c5d"
/> |

| Without Endline |
| :---------------: |
| <img width="892" height="486" alt="Screenshot 2026-02-05 at 21 59 29"
src="https://github.com/user-attachments/assets/538dd462-9c7f-4483-804c-65fd83b5f2f2"
/>|

 Or the endline is smaller than the startline.
 ```json
 {
  "address": "0x5555555557B4",
  "column": 3,
  "endLine": 2,
  "instruction": "add     rsp, 0x20                ",
  "instructionBytes": "48 83 c4 20",
  "line": 17,
  "location": {
    "name": "test.cpp",
    "path": "/buildbot/test_process/test.cpp"
  }
},
```

(cherry picked from commit bde4754bc48029398b5ba22b4478a6b0202ab827)
---
 .../Handler/DisassembleRequestHandler.cpp        | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/lldb/tools/lldb-dap/Handler/DisassembleRequestHandler.cpp b/lldb/tools/lldb-dap/Handler/DisassembleRequestHandler.cpp
index 6d2eb74a9634c..8387f9ab5c387 100644
--- a/lldb/tools/lldb-dap/Handler/DisassembleRequestHandler.cpp
+++ b/lldb/tools/lldb-dap/Handler/DisassembleRequestHandler.cpp
@@ -156,22 +156,6 @@ static DisassembledInstruction ConvertSBInstructionToDisassembledInstruction(
     const auto column = line_entry.GetColumn();
     if (column != 0 && column != LLDB_INVALID_COLUMN_NUMBER)
       disassembled_inst.column = column;
-
-    lldb::SBAddress end_addr = line_entry.GetEndAddress();
-    auto end_line_entry = GetLineEntryForAddress(target, end_addr);
-    if (end_line_entry.IsValid() &&
-        end_line_entry.GetFileSpec() == line_entry.GetFileSpec()) {
-      const auto end_line = end_line_entry.GetLine();
-      if (end_line != 0 && end_line != LLDB_INVALID_LINE_NUMBER &&
-          end_line != line) {
-        disassembled_inst.endLine = end_line;
-
-        const auto end_column = end_line_entry.GetColumn();
-        if (end_column != 0 && end_column != LLDB_INVALID_COLUMN_NUMBER &&
-            end_column != column)
-          disassembled_inst.endColumn = end_column - 1;
-      }
-    }
   }
 
   return disassembled_inst;



More information about the llvm-branch-commits mailing list