Log stack-trace for run-webkit-tests when interrupted
authorjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2019 01:32:17 +0000 (01:32 +0000)
committerjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2019 01:32:17 +0000 (01:32 +0000)
commitc5d5f98647e10577ab8bad7d891a7a8190e092e3
tree00206b9e5b1e7949b3461d3fee475a071535e2e7
parent9a8e44eb4043797aa7044fda3f1c9b621af58345
Log stack-trace for run-webkit-tests when interrupted
https://bugs.webkit.org/show_bug.cgi?id=176393
<rdar://problem/34262310>

Reviewed by Lucas Forschler.

* Scripts/webkitpy/common/interrupt_debugging.py: Added.
(log_stack_trace): Given a Python frame object, log a stack trace to the provided file.
(StackTraceFileContext): Context which allows stack-traces to be printed to stderr or to a file.
(log_stack_trace_on_term): Attach a listener to SIGTERM so that a stack-trace can be logged when a program is terminated.
(log_stack_trace_on_ctrl_c): Attach a listener to SIGINT so that a stack-trace can be logged when a program is CTRL+Ced.
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(main): Set handlers to log stack trace on interruption.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244064 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/Scripts/webkitpy/common/interrupt_debugging.py [new file with mode: 0644]
Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py