-
Notifications
You must be signed in to change notification settings - Fork 3
/
analyse_crash_dump.ps1
50 lines (40 loc) · 1.13 KB
/
analyse_crash_dump.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# ----------------------------------------------------------------------------
# Show context and call stack of an AOS crash dump
# ----------------------------------------------------------------------------
Set-StrictMode -Version Latest
function CurrentScriptDirectory() {
return Split-Path $Script:MyInvocation.MyCommand.Path
}
function DumpFileName() {
return $Script:args[0]
}
function AnalyseDump() {
$dump_arg = DumpFileName
& $python3_exe $analyse_impl_script_file $dump_arg
}
function ThrowIfNoDebuggingTools() {
if (!$debugging_tools_available) {
throw "Environment variable 'WIN_DEBUGGING_TOOLS_PATH' doesn't exist"
}
}
function ThrowIfNoPython() {
if (!$python3_available) {
throw "Environment variable 'PYTHON3_PATH' doesn't exist"
}
}
function CheckArguments() {
if ($Script:args.Count -ne 1) {
throw "Exactly one argument expected"
}
}
function Main() {
CheckArguments
ThrowIfNoDebuggingTools
ThrowIfNoPython
AnalyseDump
}
# Dot source common.ps1
$common_script = Join-Path (CurrentScriptDirectory) "common.ps1"
. $common_script
# Script entry point
Main