[Lldb-commits] [lldb] [lldb-dap] Add an option to show function args in stack frames (PR #71843)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 9 12:04:22 PST 2023


================
@@ -1232,6 +1234,32 @@ const char *SBFrame::GetFunctionName() const {
   return name;
 }
 
+void SBFrame::GetDisplayFunctionNameWithArgs(SBStream &output) {
+  Stream &strm = output.ref();
+
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        FormatEntity::Entry format;
----------------
clayborg wrote:

Make this static and add a llvm::once call around the intiailization so we don't need to parse the format each time we call this function. If we make this static, rename to `g_format` to indicate it is a global.

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


More information about the lldb-commits mailing list