[Lldb-commits] [lldb] fallback to assembly when source code is not available (PR #136494)
Ely Ronnen via lldb-commits
lldb-commits at lists.llvm.org
Sun Apr 20 09:03:25 PDT 2025
https://github.com/eronnen created https://github.com/llvm/llvm-project/pull/136494
Show assembly code when the source code for a frame is not available in the debugger machine
Fix #136492
After the fix:
[Screencast From 2025-04-20 18-00-30.webm](https://github.com/user-attachments/assets/1ce41715-cf4f-42a1-8f5c-6196b9d685dc)
>From f9d6bcdc606d28db5de42fcdeca55408979ddafb Mon Sep 17 00:00:00 2001
From: Ely Ronnen <elyronnen at gmail.com>
Date: Sun, 20 Apr 2025 17:07:09 +0200
Subject: [PATCH] fallback to assembly when source code is not available
---
lldb/tools/lldb-dap/JSONUtils.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lldb/tools/lldb-dap/JSONUtils.cpp b/lldb/tools/lldb-dap/JSONUtils.cpp
index 33f10c93d2ada..5b647950cfc6e 100644
--- a/lldb/tools/lldb-dap/JSONUtils.cpp
+++ b/lldb/tools/lldb-dap/JSONUtils.cpp
@@ -750,9 +750,11 @@ llvm::json::Value CreateStackFrame(lldb::SBFrame &frame,
EmplaceSafeString(object, "name", frame_name);
auto line_entry = frame.GetLineEntry();
+ auto file_spec = line_entry.GetFileSpec();
// A line entry of 0 indicates the line is compiler generated i.e. no source
// file is associated with the frame.
- if (line_entry.GetFileSpec().IsValid() &&
+ if (file_spec.IsValid() &&
+ file_spec.Exists() &&
(line_entry.GetLine() != 0 ||
line_entry.GetLine() != LLDB_INVALID_LINE_NUMBER)) {
object.try_emplace("source", CreateSource(line_entry));
More information about the lldb-commits
mailing list