[Lldb-commits] [lldb] [lldb-dap] Add an option to provide a format for stack frames (PR #71843)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 13 16:51:49 PST 2023


================
@@ -824,4 +824,15 @@ bool ReplModeRequestHandler::DoExecute(lldb::SBDebugger debugger,
   return true;
 }
 
+void DAP::SetFrameFormat(llvm::StringRef format) {
+  if (format.empty())
+    return;
+  lldb::SBError error;
+  g_dap.frame_format = lldb::SBFormat::Parse(format.data(), error);
+  if (error.Fail()) {
+    llvm::errs() << "The provided frame format '" << format
+                 << "' couldn't be parsed. " << error.GetCString() << "\n";
----------------
clayborg wrote:

Dump to the console instead of `lldb::errs()` or `llvm::outs()` as stdout/stderr go to `/dev/null` as the stdin/stdout is used for packets. When we start lldb-dap, we dup the stdin/out/err file descriptors so they don't use FD 0, 1 and 2, and then we close stdin/out/err and redirect to /dev/null. Dump to the console with:
```
    g_dap.SendOutput(OutputType::Console, llvm::StringRef(...));
```


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


More information about the lldb-commits mailing list