]> Cypherpunks repositories - gostls13.git/commit
runtime: enable crash dump creation on Windows
authorZhi Zheng <zhi.zheng052@gmail.com>
Mon, 5 Apr 2021 23:00:07 +0000 (16:00 -0700)
committerPatrik Nyblom <pnyb@google.com>
Fri, 29 Oct 2021 17:44:52 +0000 (17:44 +0000)
commit353d5b6c536c7028eba058ba27014fae0206298a
treeafc219639acf70a7a07dadf0751694aad5c8b0dc
parentd8fc7f785e84515c0a5beb8baeb3c1ca35bebf68
runtime: enable crash dump creation on Windows

This change provides ability to create dumps on Windows that can be used by
"dlv core" command. Currently only full dumps can be correctly read by Delve.
Below are the steps to create and use the dumps.

1. Configure Windows OS to collect dumps before running the program.
Instructions on how to do the configuration are here:
https://docs.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps.
In order for Delve to read the dump, set the DumpType to full dump, i.e. DumpType=2.

2. Go program only generates dumps when the environment variable GOTRACEBACK
is set to crash. Run command "set GOTRACEBACK=crash" before running the program.

3. Dump files will be generated in %LOCALAPPDATA%\CrashDumps

4. Use Delve command "dlv core" to open the dump, e.g.: "dlv core a.exe a.exe.3840.dmp".

Fixes #20498

Change-Id: Ib9aa82e7aea9da19594dc49348876997b24e9600
Reviewed-on: https://go-review.googlesource.com/c/go/+/307372
Run-TryBot: Alessandro Arzilli <alessandro.arzilli@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Patrik Nyblom <pnyb@google.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
src/runtime/os_windows.go
src/runtime/panic.go
src/runtime/signal_windows.go