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

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 9 13:16:41 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;
+        Status s = FormatEntity::Parse("${function.name-with-args}", format);
+        assert(
+            s.Success() &&
+            "The ${function.name-with-args} format must be parsed correctly");
----------------
bulbazord wrote:

I don't think this should be an assertion. If something internally went wrong with LLDB, we shouldn't crash. This might be a good place to return an SBError

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


More information about the lldb-commits mailing list