2015-08-26 07:17:56 -04:00
thisdir = tools/mono-symbolicate
SUBDIRS =
i n c l u d e . . / . . / b u i l d / r u l e s . m a k e
PROGRAM = mono-symbolicate.exe
2017-04-10 11:41:01 +00:00
LOCAL_MCS_FLAGS = /D:NO_AUTHENTICODE /D:CECIL -nowarn:649
2016-08-03 10:59:49 +00:00
2017-04-10 11:41:01 +00:00
LIB_REFS = System.Xml System.Core System
2015-08-26 07:17:56 -04:00
i n c l u d e . . / . . / b u i l d / e x e c u t a b l e . m a k e
LIB_PATH = $( topdir) /class/lib/$( PROFILE)
2016-02-22 11:00:01 -05:00
MONO = MONO_PATH = " $( LIB_PATH) $( PLATFORM_PATH_SEPARATOR) $$ MONO_PATH " $( RUNTIME) -O= -inline
2015-08-26 07:17:56 -04:00
2016-08-03 10:59:49 +00:00
MSYM_DIR = $( OUT_DIR) /msymdir
2015-08-26 07:17:56 -04:00
TEST_CS = Test/StackTraceDumper.cs
TEST_EXE = $( OUT_DIR) /StackTraceDumper.exe
2016-08-03 10:59:49 +00:00
STACKTRACE_FILE = $( OUT_DIR) /stacktrace.out
SYMBOLICATE_RAW_FILE = $( OUT_DIR) /symbolicate_raw.out
SYMBOLICATE_RESULT_FILE = $( OUT_DIR) /symbolicate.result
2015-08-26 07:17:56 -04:00
SYMBOLICATE_EXPECTED_FILE = Test/symbolicate.expected
CHECK_DIFF = @\
2016-08-03 10:59:49 +00:00
$( MONO) $( TEST_EXE) > $( STACKTRACE_FILE) ; \
$( MONO) $( LIB_PATH) /$( PROGRAM) $( MSYM_DIR) $( STACKTRACE_FILE) > $( SYMBOLICATE_RAW_FILE) ; \
2017-06-07 13:16:24 +00:00
cat $( SYMBOLICATE_RAW_FILE) | tr '\\' '/' | sed "s/) .* in .*\/mcs\//) in mcs\//" | sed "s/) .* in .*\/external\//) in external\//" | sed '/\[MVID\]/d' | sed '/\[AOTID\]/d' > $( SYMBOLICATE_RESULT_FILE) ; \
2016-11-10 13:04:39 +00:00
DIFF = $$ ( diff -up $( SYMBOLICATE_EXPECTED_FILE) $( SYMBOLICATE_RESULT_FILE) ) ; \
2015-08-26 07:17:56 -04:00
if [ ! -z " $$ DIFF " ] ; then \
echo "Symbolicate tests failed." ; \
2016-08-03 10:59:49 +00:00
echo " If $( SYMBOLICATE_RESULT_FILE) is correct copy it to $( SYMBOLICATE_EXPECTED_FILE) . " ; \
2015-08-26 07:17:56 -04:00
echo "Otherwise runtime sequence points need to be fixed." ; \
echo " $$ DIFF " ; \
exit 1; \
fi
2016-08-03 10:59:49 +00:00
PREPARE_OUTDIR = @\
2015-08-26 07:17:56 -04:00
rm -rf $( OUT_DIR) ; \
mkdir -p $( OUT_DIR) ; \
2016-08-03 10:59:49 +00:00
mkdir -p $( MSYM_DIR) ;
COMPILE = \
$( CSCOMPILE) $( TEST_CS) -out:$( TEST_EXE) ; \
$( MONO) $( LIB_PATH) /$( PROGRAM) store-symbols $( MSYM_DIR) $( OUT_DIR) ; \
$( MONO) $( LIB_PATH) /$( PROGRAM) store-symbols $( MSYM_DIR) $( LIB_PATH) ;
2015-08-26 07:17:56 -04:00
2016-02-22 11:00:01 -05:00
check : test -local
AOT_SUPPORTED = $( shell $( MONO) --aot 2>& 1 | grep -q "AOT compilation is not supported" && echo 0 || echo 1)
2016-08-03 10:59:49 +00:00
test-local : test -without -aot test -with -aot test -with -aot -msym
test-without-aot : OUT_DIR = Test /without_aot
test-without-aot : all
@echo " Checking $( TEST_EXE) without AOT in $( OUT_DIR) "
$( PREPARE_OUTDIR)
$( COMPILE)
2015-08-26 07:17:56 -04:00
$( CHECK_DIFF)
2016-08-03 10:59:49 +00:00
test-with-aot : OUT_DIR = Test /with_aot
test-with-aot : all
2016-02-22 11:00:01 -05:00
i f e q ( $( AOT_SUPPORTED ) , 1 )
2016-08-03 10:59:49 +00:00
@echo " Checking $( TEST_EXE) with AOT in $( OUT_DIR) "
$( PREPARE_OUTDIR)
$( COMPILE)
@$( MONO) --aot $( TEST_EXE) > /dev/null
2015-08-26 07:17:56 -04:00
$( CHECK_DIFF)
2016-08-03 10:59:49 +00:00
e n d i f
test-with-aot-msym : OUT_DIR = Test /with_aot_msym
test-with-aot-msym : all
i f e q ( $( AOT_SUPPORTED ) , 1 )
@echo " Checking $( TEST_EXE) with AOT (using .msym) in $( OUT_DIR) "
$( PREPARE_OUTDIR)
$( COMPILE)
@$( MONO) --aot= msym-dir= $( MSYM_DIR) $( TEST_EXE) > /dev/null
2015-08-26 07:17:56 -04:00
$( CHECK_DIFF)
2016-02-22 11:00:01 -05:00
e n d i f