[Lldb-commits] [lldb] [lldb][test] Handle None function name in frame provider tests (PR #226936)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Sep 28 02:51:12 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: David Spickett (DavidSpickett)
<details>
<summary>Changes</summary>
Fixes #<!-- -->191859.
On Arm one of the functions has no name, which is a valid state.
```
Num frames: 7
0 frame #<!-- -->0: 0x092a151c a.out`baz at main.c:5:3 --name: baz
1 frame #<!-- -->1: 0x092a1540 a.out`bar at main.c:10:10 --name: bar
2 frame #<!-- -->2: 0x092a1560 a.out`foo at main.c:15:10 --name: foo
3 frame #<!-- -->3: 0x092a158c a.out`main at main.c:20:10 --name: main
4 frame #<!-- -->4: 0xf7ab939a libc.so.6` --name: None
5 frame #<!-- -->5: 0xf7ab943e libc.so.6`__libc_start_main + 94 --name: __libc_start_main
6 frame #<!-- -->6: 0x092a1434 a.out`_start + 40 --name: _start
```
The prefix provider needs to handle that possibility.
Though the Python type annotations on ScriptedFrame say that the name methods return string, in reality they can return None, which the C++ sides expect. I will fix that in another PR.
---
Full diff: https://github.com/llvm/llvm-project/pull/226936.diff
1 Files Affected:
- (modified) lldb/test/API/functionalities/scripted_frame_provider/pass_through_prefix/frame_provider.py (+3-1)
``````````diff
diff --git a/lldb/test/API/functionalities/scripted_frame_provider/pass_through_prefix/frame_provider.py b/lldb/test/API/functionalities/scripted_frame_provider/pass_through_prefix/frame_provider.py
index 18344208cac56..c73aefdf29367 100644
--- a/lldb/test/API/functionalities/scripted_frame_provider/pass_through_prefix/frame_provider.py
+++ b/lldb/test/API/functionalities/scripted_frame_provider/pass_through_prefix/frame_provider.py
@@ -19,7 +19,9 @@ def __init__(self, thread, idx, function_name, prefix):
super().__init__(thread, args)
self.idx = idx
- self.function_name = prefix + function_name
+ self.function_name = prefix
+ if function_name is not None:
+ self.function_name += function_name
def get_id(self):
return self.idx
``````````
</details>
https://github.com/llvm/llvm-project/pull/226936
More information about the lldb-commits
mailing list