diff options
author | Michael Buch <michaelbuch12@gmail.com> | 2024-09-19 10:06:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-19 10:06:28 +0100 |
commit | bca507387ae1945137214ec7fb80b709927ee6e8 (patch) | |
tree | 4562c3356068bdd642c937718d1293e9e4f6c6c7 /llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp | |
parent | 57777a5066a6b872f7576a81f021d18899595e38 (diff) | |
download | llvm-bca507387ae1945137214ec7fb80b709927ee6e8.zip llvm-bca507387ae1945137214ec7fb80b709927ee6e8.tar.gz llvm-bca507387ae1945137214ec7fb80b709927ee6e8.tar.bz2 |
[lldb][FrameRecognizer] Display the first non-std frame on verbose_trap (#108825)
This attempts to improve user-experience when LLDB stops on a
verbose_trap. Currently if a `__builtin_verbose_trap` triggers, we
display the first frame above the call to the verbose_trap. So in the
newly added test case, we would've previously stopped here:
```
(lldb) run
Process 28095 launched: '/Users/michaelbuch/a.out' (arm64)
Process 28095 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = Bounds error: out-of-bounds access
frame #1: 0x0000000100003f5c a.out`std::__1::vector<int>::operator[](this=0x000000016fdfebef size=0, (null)=10) at verbose_trap.cpp:6:9
3 template <typename T>
4 struct vector {
5 void operator[](unsigned) {
-> 6 __builtin_verbose_trap("Bounds error", "out-of-bounds access");
7 }
8 };
```
After this patch, we would stop in the first non-`std` frame:
```
(lldb) run
Process 27843 launched: '/Users/michaelbuch/a.out' (arm64)
Process 27843 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = Bounds error: out-of-bounds access
frame #2: 0x0000000100003f44 a.out`g() at verbose_trap.cpp:14:5
11
12 void g() {
13 std::vector<int> v;
-> 14 v[10];
15 }
16
```
rdar://134490328
Diffstat (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions