[Lldb-commits] [lldb] [lldb/API] Hoist some of SBFrame logic to lldb_private::StackFrame (NFC) (PR #116298)

via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 14 15:51:09 PST 2024


================
@@ -1230,6 +1230,57 @@ bool StackFrame::IsHidden() {
   return false;
 }
 
+const char *StackFrame::GetFunctionName() {
+  const char *name = nullptr;
+  SymbolContext sc = GetSymbolContext(
+      eSymbolContextFunction | eSymbolContextBlock | eSymbolContextSymbol);
+  if (sc.block) {
+    Block *inlined_block = sc.block->GetContainingInlinedBlock();
+    if (inlined_block) {
+      const InlineFunctionInfo *inlined_info =
----------------
jimingham wrote:

You didn't do this but since you're touching this...  GetInlinedFunctionInfo is not guaranteed to return a non-null pointer.  Other places that access the underlying m_inlineInfoSP always check it against nullptr before accessing it.  Probably a good idea to do that here as well...

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


More information about the lldb-commits mailing list