aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/win32/sys.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-12-04 11:09:06 +0100
committerLukas Larsson <[email protected]>2014-12-19 10:39:52 +0100
commitffd0153e6dffcc29cf79d0191860047dba0438bb (patch)
tree31a0ced512b5b243caa5933c73aa4dc70d6c0c87 /erts/emulator/sys/win32/sys.c
parente2a600341324d2ce3689119f8fd61b248702d79f (diff)
downloadotp-ffd0153e6dffcc29cf79d0191860047dba0438bb.tar.gz
otp-ffd0153e6dffcc29cf79d0191860047dba0438bb.tar.bz2
otp-ffd0153e6dffcc29cf79d0191860047dba0438bb.zip
erts: Improve crash dumps
This commit improves crash dumps in several ways: * Suspends schedulers to get a current snapshot * Dumps information about scheduler * Dumps stack trace of current running process (including Garbing processes)
Diffstat (limited to 'erts/emulator/sys/win32/sys.c')
-rw-r--r--erts/emulator/sys/win32/sys.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/erts/emulator/sys/win32/sys.c b/erts/emulator/sys/win32/sys.c
index 164ef95629..5d51659b4e 100644
--- a/erts/emulator/sys/win32/sys.c
+++ b/erts/emulator/sys/win32/sys.c
@@ -247,6 +247,27 @@ void erl_sys_args(int* argc, char** argv)
#endif
}
+/*
+ * Function returns 1 if we can read from all values in between
+ * start and stop.
+ */
+int
+erts_sys_is_area_readable(char *start, char *stop) {
+ volatile char tmp;
+ __try
+ {
+ while(start < stop) {
+ tmp = *start;
+ start++;
+ }
+ }
+ __except(EXCEPTION_EXECUTE_HANDLER)
+ {
+ return 0;
+ }
+ return 1;
+}
+
int erts_sys_prepare_crash_dump(int secs)
{
Port *heart_port;