================
@@ -34,26 +36,22 @@ SourceRequestHandler::Run(const protocol::SourceArguments 
&args) const {
     return llvm::make_error<DAPError>(
         "invalid arguments, expected source.sourceReference to be set");
 
-  lldb::SBProcess process = dap.target.GetProcess();
-  // Upper 32 bits is the thread index ID
-  lldb::SBThread thread =
-      process.GetThreadByIndexID(GetLLDBThreadIndexID(source));
-  // Lower 32 bits is the frame index
-  lldb::SBFrame frame = thread.GetFrameAtIndex(GetLLDBFrameID(source));
-  if (!frame.IsValid())
+  lldb::SBAddress address(source, dap.target);
+  if (!address.IsValid())
     return llvm::make_error<DAPError>("source not found");
 
+  lldb::SBSymbol symbol = address.GetSymbol();
+
   lldb::SBStream stream;
-  lldb::SBExecutionContext exe_ctx(frame);
-  lldb::SBSymbol symbol = frame.GetSymbol();
+  lldb::SBExecutionContext exe_ctx(dap.target);
 
   if (symbol.IsValid()) {
----------------
da-viper wrote:

Same as above check if it is in a function scope. 

https://github.com/llvm/llvm-project/pull/139969
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to