Skip to content

🍒 [lldb] Clear Frames when changing disable-language-runtime-unwindplans (#151208) #11100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

felipepiovezan
Copy link

@felipepiovezan felipepiovezan commented Aug 1, 2025

This patch uses the "setting changed" callback to clear previously
cached stack frames when
`target.process.disable-language-runtime-unwindplans` is changed. This
is necessary so that changing the setting followed by a `backtrace`
command produces an accurate backtrace.

With this, a user can create a custom command like below in order to
quickly inspect a backtrace created without language plugins.

```
debugger.HandleCommand("settings set target.process.disable-language-runtime-unwindplans true")
debugger.HandleCommand("bt " + command)
debugger.HandleCommand("settings set target.process.disable-language-runtime-unwindplans false")
```

In the future, we may consider implementing this as an option to
`backtrace`. Currently, this process setting is the only way of
affecting the unwinder, and changing the process setting as part of the
backtrace implementation doesn't feel right.

There are no upstream users of this flag, so we cannot write a test for
it here.

(cherry picked from commit 03bb10bea6edeb6b1cbcb3fc6b590e585ae43ad6)

rdar://156508664

…ns` (llvm#151208)

This patch uses the "setting changed" callback to clear previously
cached stack frames when
`target.process.disable-language-runtime-unwindplans` is changed. This
is necessary so that changing the setting followed by a `backtrace`
command produces an accurate backtrace.

With this, a user can create a custom command like below in order to
quickly inspect a backtrace created without language plugins.

```
debugger.HandleCommand("settings set target.process.disable-language-runtime-unwindplans true")
debugger.HandleCommand("bt " + command)
debugger.HandleCommand("settings set target.process.disable-language-runtime-unwindplans false")
```

In the future, we may consider implementing this as an option to
`backtrace`. Currently, this process setting is the only way of
affecting the unwinder, and changing the process setting as part of the
backtrace implementation doesn't feel right.

There are no upstream users of this flag, so we cannot write a test for
it here.

(cherry picked from commit 03bb10b)
@felipepiovezan felipepiovezan requested a review from a team as a code owner August 1, 2025 01:09
@felipepiovezan
Copy link
Author

@swift-ci test

This can only be tested on downstream LLDB, as it requires a language
with a custom unwind plan.
@felipepiovezan felipepiovezan force-pushed the felipe/unwinder_callback_62 branch from fcb6640 to 3c902c1 Compare August 1, 2025 20:28
@felipepiovezan
Copy link
Author

@swift-ci test

1 similar comment
@felipepiovezan
Copy link
Author

@swift-ci test

@felipepiovezan
Copy link
Author

@swift-ci test macos platform

@adrian-prantl adrian-prantl merged commit f7fe371 into swiftlang:swift/release/6.2 Aug 4, 2025
3 checks passed
@felipepiovezan felipepiovezan deleted the felipe/unwinder_callback_62 branch August 4, 2025 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants