| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[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.outmain [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.outmain [inlined] __clang_trap_msg$Misc.$Function is not implemented$ at verbose_trap.cpp:0 [opt] * frame #1: 0x0000000100003fa4 a.outmain [inlined] Dummy::func(this=<unavailable>) at verbose_trap.cpp:3:5 [opt] frame #2: 0x0000000100003fa4 a.outmain at verbose_trap.cpp:8:13 [opt] frame #3: 0x0000000189d518b4 dyldstart + 1988 ``` | 2 年前 | |
When the Debugger runs HandleProcessEvent it should allow selecting the "Most relevant" frame. If you don't do that, then the correct frame gets selected, but it happens AFTER the frame info gets printed in the stop message, so you don't see the selected frame. The test for this hid the issue because it ran frame info and checked the result of that. That happens after the recognizer selects the frame, and so it was right. But if the recognizer is working correctly it will have already done the same printing in the stop message, and this way we also verify that the stop message was right. Differential Revision: https://reviews.llvm.org/D150315 | 3 年前 | |
[lldb/Test] Skip recognizer tests when Python is disabled The frame recognizer command only exists when Python scripting is enabled. Therefore the test should be made conditional on Python. Without it, the test fails with "'frame recognizer' is not a known command." | 5 年前 | |
[lldb] Disable verbose_trap.test on Windows (#99323) verbose_trap.test, added in #80368, fails on some Windows bots. See https://lab.llvm.org/buildbot/#/builders/141/builds/808. | 2 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 2 年前 |