-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[lldb][Runtime] Move VerboseTrapFrameRecognizer into CPPLanguageRuntime #166157
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
Merged
Michael137
merged 3 commits into
llvm:main
from
Michael137:lldb/move-verbose-trap-recognizer
Nov 4, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| add_lldb_library(lldbPluginCPPRuntime | ||
| CPPLanguageRuntime.cpp | ||
| VerboseTrapFrameRecognizer.cpp | ||
|
|
||
| LINK_LIBS | ||
| lldbCore | ||
|
|
||
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
2 changes: 1 addition & 1 deletion
2
...rce/Target/VerboseTrapFrameRecognizer.cpp → .../CPlusPlus/VerboseTrapFrameRecognizer.cpp
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| int main() { | ||
| __builtin_verbose_trap("Foo", "Bar"); | ||
| return 0; | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Checks that the recognizers that should work across language runtimes | ||
| # are only registered once with the target. | ||
|
|
||
| # RUN: split-file %s %t | ||
|
|
||
| # RUN: %clang_host %t/main.cpp -g -o %t/cpp.out | ||
| # RUN: %lldb -b -s %t/commands.input %t/cpp.out | FileCheck %s | ||
|
|
||
| # RUN: %clang_host -x objective-c++ %t/main.mm -g -o %t/objcxx.out | ||
| # RUN: %lldb -b -s %t/commands.input %t/objcxx.out | FileCheck %s | ||
|
|
||
| # RUN: %clang_host %t/main.c -g -o %t/c.out | ||
| # RUN: %lldb -b -s %t/commands.input %t/c.out | FileCheck %s | ||
|
|
||
| # RUN: %clang_host -x objective-c %t/main.m -g -o %t/objc.out | ||
| # RUN: %lldb -b -s %t/commands.input %t/objc.out | FileCheck %s | ||
|
|
||
| #--- main.m | ||
| int main() {} | ||
|
|
||
| #--- main.c | ||
| int main() {} | ||
|
|
||
| #--- main.mm | ||
| int main() {} | ||
|
|
||
| #--- main.cpp | ||
| int main() {} | ||
|
|
||
| #--- commands.input | ||
|
|
||
| b main | ||
| frame recognizer list | ||
| run | ||
| frame recognizer list | ||
| continue | ||
| run | ||
| frame recognizer list | ||
|
|
||
| # CHECK: frame recognizer list | ||
| # CHECK-NEXT: no matching results found. | ||
|
|
||
| # CHECK: frame recognizer list | ||
| # CHECK: Verbose Trap StackFrame Recognizer | ||
| # CHECK: Assert StackFrame Recognizer | ||
| # CHECK-NOT: Verbose Trap StackFrame Recognizer | ||
| # CHECK-NOT: Assert StackFrame Recognizer | ||
|
|
||
| # FIXME: avoid duplicate frame recognizers in the target: https://github.com/llvm/llvm-project/issues/166341 | ||
| # CHECK: frame recognizer list | ||
delcypher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # CHECK: Verbose Trap StackFrame Recognizer | ||
| # CHECK: Assert StackFrame Recognizer | ||
| # CHECK: Verbose Trap StackFrame Recognizer | ||
| # CHECK: Assert StackFrame Recognizer | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # REQUIRES: system-darwin | ||
| # | ||
| # RUN: %clangxx_host -x objective-c -g %S/Inputs/verbose_trap.m -o %t.out | ||
| # RUN: %lldb -b -s %s %t.out | FileCheck %s | ||
|
|
||
| run | ||
| # CHECK: thread #{{.*}}stop reason = Foo: Bar | ||
| frame info | ||
| # CHECK: frame #{{.*}}`main at verbose_trap.m | ||
| frame recognizer info 0 | ||
| # CHECK: frame 0 is recognized by Verbose Trap StackFrame Recognizer | ||
| q |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
CPPLanguageRuntimeguaranteed to be loaded even if the process being debugged was built with C only?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe so yes. I don't know of a case where the C++ language plugin registration wouldn't trigger. IIUC, this would only happen if someone chose to compile the plugin out of LLDB when building it. I don't think we have a mechanism in CMake to do that yet? @jimingham @JDevlieghere Is my understanding correct here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can compile out plugins but it's not guaranteed to be safe. There are many "plugins" that LLDB can't work without (or plugins that depend on other plugins) so although it's possible, it's not encouraged or easy to do. I don't think we should account for that in our design.