[Lldb-commits] [lldb] [lldb-dap] Handle stack frames without a module (PR #136777)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 23 20:16:46 PDT 2025


================
@@ -42,10 +43,19 @@ SourceRequestHandler::Run(const protocol::SourceArguments &args) const {
   if (!frame.IsValid())
     return llvm::make_error<DAPError>("source not found");
 
-  lldb::SBInstructionList insts = frame.GetSymbol().GetInstructions(dap.target);
   lldb::SBStream stream;
   lldb::SBExecutionContext exe_ctx(frame);
-  insts.GetDescription(stream, exe_ctx);
+  lldb::SBSymbol symbol = frame.GetSymbol();
+
+  if (symbol.IsValid()) {
+    lldb::SBInstructionList insts = symbol.GetInstructions(dap.target);
+    insts.GetDescription(stream, exe_ctx);
+  } else {
+    // No valid symbol, just return the disassembly
----------------
JDevlieghere wrote:

```suggestion
    // No valid symbol, just return the disassembly.
```
[When writing comments, write them as English prose, using proper capitalization, punctuation, etc.](https://llvm.org/docs/CodingStandards.html#commenting)

https://github.com/llvm/llvm-project/pull/136777


More information about the lldb-commits mailing list