]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: support bogo -wait-for-debugger
authorDaniel McCarney <daniel@binaryparadox.net>
Wed, 19 Feb 2025 17:39:32 +0000 (12:39 -0500)
committerDaniel McCarney <daniel@binaryparadox.net>
Mon, 10 Mar 2025 21:20:11 +0000 (14:20 -0700)
commit01688daca63c3775f07f908268af99bd3d3c9386
tree44648e35a75c3c171bf760d99416b3e186fd3db7
parent2611d81dc82ba18bb9dd45afce9a412b0b821913
crypto/tls: support bogo -wait-for-debugger

When this command line flag is provided to the BoGo runner it will:

* Disable some timeouts
* Limit concurrency to 1 worker at a time
* Pass the -wait-for-debugger flag to the shim process
* Print the PID of the shim process to status output

On the shim-side, we need to react to -wait-for-debugger by sending
ourselves a SIGSTOP signal. When a debugger attaches to the shim the
process will be resumed.

This makes it possible to debug both the runner side and the shim side
of a BoGo interaction without resorting to print style debugging.

Since SIGSTOP is not a signal we can use on Windows this functionality
is limited to unix builds.

Updates #72006

Change-Id: Iafa08cf71830cdfde3e6ee4826914236e3cd7e57
Reviewed-on: https://go-review.googlesource.com/c/go/+/650737
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/crypto/tls/bogo_shim_notunix_test.go [new file with mode: 0644]
src/crypto/tls/bogo_shim_test.go
src/crypto/tls/bogo_shim_unix_test.go [new file with mode: 0644]