[Lldb-commits] [lldb] [lldb][Format] Display only the inlined frame name in backtraces if available (PR #135343)

via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 11 07:56:59 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions h,cpp -- lldb/include/lldb/Symbol/SymbolContext.h lldb/source/Core/FormatEntity.cpp lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp lldb/source/Symbol/SymbolContext.cpp lldb/test/API/functionalities/param_entry_vals/basic_entry_values/main.cpp lldb/test/API/functionalities/tail_call_frames/inlining_and_tail_calls/main.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp
index 45f30e186..a9626bbc3 100644
--- a/lldb/source/Symbol/SymbolContext.cpp
+++ b/lldb/source/Symbol/SymbolContext.cpp
@@ -893,9 +893,8 @@ char const *SymbolContext::GetPossiblyInlinedFunctionName(
     return name;
 
   // If we do have an inlined frame name, return that.
-  if (char const *inline_name = inline_info->GetMangled()
-                                    .GetName(mangling_preference)
-                                    .AsCString())
+  if (char const *inline_name =
+          inline_info->GetMangled().GetName(mangling_preference).AsCString())
     return inline_name;
 
   // Sometimes an inline frame may not have mangling information,
diff --git a/lldb/test/API/functionalities/tail_call_frames/inlining_and_tail_calls/main.cpp b/lldb/test/API/functionalities/tail_call_frames/inlining_and_tail_calls/main.cpp
index 5e5c0aa1d..e0c8f3cd7 100644
--- a/lldb/test/API/functionalities/tail_call_frames/inlining_and_tail_calls/main.cpp
+++ b/lldb/test/API/functionalities/tail_call_frames/inlining_and_tail_calls/main.cpp
@@ -2,8 +2,9 @@ volatile int x;
 
 void __attribute__((noinline)) tail_call_sink() {
   x++; //% self.filecheck("bt", "main.cpp", "-check-prefix=TAIL-CALL-SINK")
-  // TAIL-CALL-SINK: frame #0: 0x{{[0-9a-f]+}} a.out`tail_call_sink() at main.cpp:[[@LINE-1]]:4
-  // TAIL-CALL-SINK-NEXT: inlinable_function_which_tail_calls() at main.cpp{{.*}} [artificial]
+  // TAIL-CALL-SINK: frame #0: 0x{{[0-9a-f]+}} a.out`tail_call_sink() at
+  // main.cpp:[[@LINE-1]]:4 TAIL-CALL-SINK-NEXT:
+  // inlinable_function_which_tail_calls() at main.cpp{{.*}} [artificial]
   // TAIL-CALL-SINK-NEXT: main{{.*}}
 }
 
@@ -17,10 +18,9 @@ void __attribute__((noinline)) func3() {
 
 void __attribute__((always_inline)) inline_sink() {
   x++; //% self.filecheck("bt", "main.cpp", "-check-prefix=INLINE-SINK")
-  // INLINE-SINK: frame #0: 0x{{[0-9a-f]+}} a.out`inline_sink() at main.cpp:[[@LINE-1]]:4
-  // INLINE-SINK-NEXT: func2{{.*}}
-  // INLINE-SINK-NEXT: func1{{.*}} [artificial]
-  // INLINE-SINK-NEXT: main{{.*}}
+  // INLINE-SINK: frame #0: 0x{{[0-9a-f]+}} a.out`inline_sink() at
+  // main.cpp:[[@LINE-1]]:4 INLINE-SINK-NEXT: func2{{.*}} INLINE-SINK-NEXT:
+  // func1{{.*}} [artificial] INLINE-SINK-NEXT: main{{.*}}
 }
 
 void __attribute__((noinline)) func2() { inline_sink(); /* inlined */ }

``````````

</details>


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


More information about the lldb-commits mailing list