aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
diff options
context:
space:
mode:
authorMichael Buch <michaelbuch12@gmail.com>2024-07-16 04:28:18 +0100
committerGitHub <noreply@github.com>2024-07-16 04:28:18 +0100
commit8a27ef676e3c607daede048e5021db18a970aa71 (patch)
treefa84848c81735e96d0fa96b768e167db84da1807 /llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
parent94ed08d6b2a80cd6838bd16f21e8437918fc4dc1 (diff)
downloadllvm-8a27ef676e3c607daede048e5021db18a970aa71.zip
llvm-8a27ef676e3c607daede048e5021db18a970aa71.tar.gz
llvm-8a27ef676e3c607daede048e5021db18a970aa71.tar.bz2
[lldb] Add frame recognizer for __builtin_verbose_trap (#80368)
This patch adds a frame recognizer for Clang's `__builtin_verbose_trap`, which behaves like a `__builtin_trap`, but emits a failure-reason string into debug-info in order for debuggers to display it to a user. The frame recognizer triggers when we encounter a frame with a function name that begins with `__clang_trap_msg`, which is the magic prefix Clang emits into debug-info for verbose traps. Once such frame is encountered we display the frame function name as the `Stop Reason` and display that frame to the user. Example output: ``` (lldb) run warning: a.out was compiled with optimization - stepping may behave oddly; variables may not be available. Process 35942 launched: 'a.out' (arm64) Process 35942 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = Misc.: Function is not implemented frame #1: 0x0000000100003fa4 a.out`main [inlined] Dummy::func(this=<unavailable>) at verbose_trap.cpp:3:5 [opt] 1 struct Dummy { 2 void func() { -> 3 __builtin_verbose_trap("Misc.", "Function is not implemented"); 4 } 5 }; 6 7 int main() { (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = Misc.: Function is not implemented frame #0: 0x0000000100003fa4 a.out`main [inlined] __clang_trap_msg$Misc.$Function is not implemented$ at verbose_trap.cpp:0 [opt] * frame #1: 0x0000000100003fa4 a.out`main [inlined] Dummy::func(this=<unavailable>) at verbose_trap.cpp:3:5 [opt] frame #2: 0x0000000100003fa4 a.out`main at verbose_trap.cpp:8:13 [opt] frame #3: 0x0000000189d518b4 dyld`start + 1988 ```
Diffstat (limited to 'llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp')
0 files changed, 0 insertions, 0 deletions