Skip to content

Commit 39c94f1

Browse files
committed
feat(vulkan): improve fatal error handling and context capture in Vulkan script
- Enhanced the breakpoint command for fatal errors to automatically capture context, including program counter, backtrace, register state, and arguments. - Streamlined output for post-run scenarios to provide clearer diagnostics when the process exits normally. - Improved clarity of crash context messages for better debugging and analysis.
1 parent e19d3fa commit 39c94f1

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

scripts/capture_vulkan_bt.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,28 @@ handle SIGABRT stop print
5454
handle SIGFPE stop print
5555
handle SIGILL stop print
5656
handle SIGBUS stop print
57-
# Set breakpoint on fatal error function to catch before exit
57+
# Set breakpoint on fatal error function and auto-capture when hit
5858
break ri.Error
59-
run
60-
# If we hit the breakpoint or a signal, capture context
61-
if $_isvoid($pc) == 0
62-
printf "\n== Crash context (process stopped) ==\n"
59+
commands
60+
printf "\n== Fatal error breakpoint hit ==\n"
6361
printf "PC=%p\n", $pc
6462
info symbol $pc
6563
printf "\n== Full backtrace ==\n"
6664
thread apply all bt full
6765
printf "\n== Register state ==\n"
6866
info registers
67+
printf "\n== Arguments ==\n"
68+
info args
6969
printf "\n== Local variables ==\n"
7070
info locals
71+
# Continue to let process exit normally after capturing context
7172
continue
72-
else
73-
printf "\n== Process exited ==\n"
74-
printf "Check output above for error message\n"
7573
end
74+
run
75+
# After run completes, the breakpoint commands above will have captured
76+
# context if ri.Error was called. If process exited normally, we can't
77+
# access registers anymore, so just show what we can.
78+
printf "\n== Post-run information ==\n"
7679
# Always show these (they work even after exit)
7780
printf "\n== Shared library info ==\n"
7881
info sharedlibrary idtech3_vulkan_x86_64.so

0 commit comments

Comments
 (0)