[Lldb-commits] [lldb] [lldb-dap] Add an RAII helper for synchronous mode (NFC) (PR #137900)

via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 30 09:44:32 PDT 2025


================
@@ -235,4 +235,15 @@ std::string GetStringValue(const lldb::SBStructuredData &data) {
   return str;
 }
 
+ScopeSyncMode::ScopeSyncMode(lldb::SBDebugger &debugger)
+    : m_debugger(debugger) {
+  assert(m_debugger.GetAsync() && "Debugger not in asynchronous mode!");
----------------
jimingham wrote:

It's not just okay to allow scripts to temporarily change the Sync vrs. Async state of the debugger, it's pretty close to necessary.  Since we don't have a way from the SB API's to hijack the Process listener, the only way you can write a command that does "step, check something, step again" is to change the debugger mode to Sync.  

We could solve this by forcing everyone to write scripted thread plans for this sort of thing, but that's conceptually more difficult, and I think a lot of people aren't willing to figure that out.

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


More information about the lldb-commits mailing list