#!/bin/bash
#

exec_bin=/opt/tools/dotnet-dump
dump_file=$1

if [ -z "$dump_file" ]; then
    echo "usage: sh $0 /opt/edoc2.dump"
    exit 101
fi

if [ ! -f "$exec_bin" -o ! -f "$dump_file" ]; then
    echo "$exec_bin or $dump_file not found."
    exit 101
fi



$exec_bin analyze $1 >/tmp/edoc2_analyze_$(date +%F).txt << EOF
clrstack -all
quit
EOF

echo "dump file save to /tmp/"
