test/TestCommon.gmk
changeset 49147 af37d9997bd6
parent 48980 ab7784555b4c
child 49194 ece10494786c
--- a/test/TestCommon.gmk	Wed Mar 07 19:14:36 2018 +0100
+++ b/test/TestCommon.gmk	Wed Mar 07 22:30:39 2018 +0100
@@ -34,6 +34,9 @@
 USE_JTREG_ASSERT ?= true
 LIMIT_JTREG_VM_MEMORY ?= true
 
+X:=
+SPACE:=$(X) $(X)
+
 .DEFAULT : all
 
 # Empty these to get rid of some default rules
@@ -87,6 +90,11 @@
   endif
 endif
 
+# convert list of directories to dos paths
+define MixedDirs
+$(foreach i,$1,$(shell $(GETMIXEDPATH) "${i}"))
+endef
+
 ifdef ALT_SLASH_JAVA
   SLASH_JAVA = $(ALT_SLASH_JAVA)
 endif
@@ -124,6 +132,19 @@
   PRODUCT_HOME := $(PRODUCT_HOME)
 endif
 
+# On Windows, setup the _NT_SYMBOL_PATH if possible.
+ifeq ($(PLATFORM), windows)
+  ifndef _NT_SYMBOL_PATH
+    ifdef PRODUCT_SYMBOLS_HOME
+      _NT_SYMBOL_PATH := \
+          $(subst $(SPACE),;,$(strip $(call MixedDirs, $(sort $(dir $(wildcard \
+          $(addprefix $(PRODUCT_SYMBOLS_HOME)/bin/, *.pdb */*.pdb)))))))
+      export _NT_SYMBOL_PATH
+    endif
+  endif
+  JTREG_BASIC_OPTIONS += -e:_NT_SYMBOL_PATH='$(_NT_SYMBOL_PATH)'
+endif
+
 # Expect JPRT to set JPRT_PRODUCT_ARGS (e.g. -server etc.)
 #   Should be passed into 'java' only.
 #   Could include: -d64 -server -client OR any java option
@@ -334,11 +355,6 @@
   JTREG_EXCLUSIONS = $(PROBLEM_LISTS:%=-exclude:%)
 endif
 
-# convert list of directories to dos paths
-define MixedDirs
-$(foreach i,$1,$(shell $(GETMIXEDPATH) "${i}"))
-endef
-
 # ------------------------------------------------------------------
 
 # When called from JPRT the TESTDIRS variable is set to the jtreg tests to run