[lldb] Cherry-pick missing frame provider chaining changes#12243
Merged
adrian-prantl merged 4 commits intoswiftlang:swift/release/6.3from Feb 2, 2026
Merged
[lldb] Cherry-pick missing frame provider chaining changes#12243adrian-prantl merged 4 commits intoswiftlang:swift/release/6.3from
adrian-prantl merged 4 commits intoswiftlang:swift/release/6.3from
Conversation
…lvm#172767) This patch is a follow-up to 96c733e to fix a missing space in the frame.pc format entity. This space was intended to be prepended to the module format entity scope but if the module is not valid, which is often the case for python pc-less scripted frames, the space between the pc and the function name is missing. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma> (cherry picked from commit 6767b86)
This patch adds `get_priority()` support to synthetic frame providers to enable priority-based selection when multiple providers match a thread. This is the first step toward supporting frame provider chaining for visualizing coroutines, Swift async tasks, and et al. Priority ordering follows Unix nice convention where lower numbers indicate higher priority (0 = highest). Providers without explicit priority return `std::nullopt`, which maps to UINT32_MAX (lowest priority), ensuring backward compatibility with existing providers. The implementation adds `GetPriority()` as a virtual method to `SyntheticFrameProvider` base class, implements it through the scripting interface hierarchy (`ScriptedFrameProviderInterface` and `ScriptedFrameProviderPythonInterface`), and updates `Thread::GetStackFrameList()` to sort applicable providers by priority before attempting to load them. Python frame providers can now specify priority: ```python @staticmethod def get_priority(): return 10 # Or return None for default priority. ``` Signed-off-by: Med Ismail Bennani <ismail@bennani.ma> (cherry picked from commit d6a73d0)
…lvm#172849) This patch allows threads to have multiple SyntheticFrameProviderSP instances that chain together sequentially. Each provider receives the output of the previous provider as input, creating a transformation pipeline. It changes `Thread::m_frame_provider_sp` to a vector, adds provider parameter to SyntheticStackFrameList to avoid calling back into `Thread::GetFrameProvider()` during frame fetching, updated `LoadScriptedFrameProvider()` to chain providers by wrapping each previous provider's output in a `SyntheticStackFrameList` for the next provider and finally, loads ALL matching providers in priority order instead of just the first one. The chaining works as follows: ``` Real Unwinder Frames ↓ Provider 1 (priority 10) → adds/transforms frames ↓ Provider 2 (priority 20) → transforms Provider 1's output ↓ Provider 3 (priority 30) → transforms Provider 2's output ↓ Final frame list shown to user ``` This patch also adds a test for this (test_chained_frame_providers) to verify that 3 providers chain correctly: `AddFooFrameProvider`, `AddBarFrameProvider`, `AddBazFrameProvider`. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma> (cherry picked from commit 17b01bb)
Author
|
@swift-ci test |
Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
Author
|
Regenerated the static bindings |
Author
|
@swift-ci test |
Author
|
@swift-ci test macOS Platform |
adrian-prantl
approved these changes
Jan 31, 2026
Author
|
@swift-ci test windows platform |
1 similar comment
Author
|
@swift-ci test windows platform |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The PR cherry-picks the missing changes to support chaining frame providers: