8199197: Set _NT_SYMBOL_PATH when running tests on windows

Reviewed-by: ihse, ctornqvi
This commit is contained in:
Erik Joelsson 2018-03-07 22:30:39 +01:00
parent eb36e850a5
commit 2c4466755b
4 changed files with 52 additions and 6 deletions

View File

@ -60,6 +60,18 @@ define SetTestOpt
endif
endef
# Setup _NT_SYMBOL_PATH on Windows
ifeq ($(OPENJDK_TARGET_OS), windows)
ifndef _NT_SYMBOL_PATH
# Can't use PathList here as it adds quotes around the value.
_NT_SYMBOL_PATH := \
$(subst $(SPACE),;, $(foreach p, $(sort $(dir $(wildcard \
$(addprefix $(SYMBOLS_IMAGE_DIR)/bin/, *.pdb */*.pdb)))), $(call FixPath, $p)))
export _NT_SYMBOL_PATH
$(info _NT_SYMBOL_PATH $(_NT_SYMBOL_PATH))
endif
endif
################################################################################
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, RunTests.gmk))
@ -496,6 +508,11 @@ define SetupRunJtregTestBody
$1_JTREG_BASIC_OPTIONS += -e:JIB_DATA_DIR
# Some tests needs to find a boot JDK using the JDK8_HOME variable.
$1_JTREG_BASIC_OPTIONS += -e:JDK8_HOME=$$(BOOT_JDK)
# If running on Windows, propagate the _NT_SYMBOL_PATH to enable
# symbol lookup in hserr files
ifeq ($$(OPENJDK_TARGET_OS), windows)
$1_JTREG_BASIC_OPTIONS += -e:_NT_SYMBOL_PATH
endif
$1_JTREG_BASIC_OPTIONS += \
$$(addprefix -javaoption:, $$(JTREG_JAVA_OPTIONS)) \

View File

@ -113,6 +113,7 @@ $(eval $(call SetupVariable,JT_HOME))
# These can have default values based on the ones above
$(eval $(call SetupVariable,JDK_IMAGE_DIR,$(OUTPUTDIR)/images/jdk))
$(eval $(call SetupVariable,TEST_IMAGE_DIR,$(OUTPUTDIR)/images/test))
$(eval $(call SetupVariable,SYMBOLS_IMAGE_DIR,$(OUTPUTDIR)/images/symbols))
# Provide default values for tools that we need
$(eval $(call SetupVariable,MAKE,make,NO_CHECK))
@ -245,6 +246,7 @@ $(call CreateNewSpec, $(NEW_SPEC), \
JT_HOME := $(JT_HOME), \
JDK_IMAGE_DIR := $(JDK_IMAGE_DIR), \
TEST_IMAGE_DIR := $(TEST_IMAGE_DIR), \
SYMBOLS_IMAGE_DIR := $(SYMBOLS_IMAGE_DIR), \
MAKE := $(MAKE), \
BASH := $(BASH), \
JIB_JAR := $(JIB_JAR), \

View File

@ -743,11 +743,22 @@ var getJibProfilesProfiles = function (input, common, data) {
dependencies: [ "devkit" ],
environment_path: input.get("devkit", "install_path")
+ "/Xcode.app/Contents/Developer/usr/bin"
}
};
profiles["run-test"] = concatObjects(profiles["run-test"], macosxRunTestExtra);
profiles["run-test-jprt"] = concatObjects(profiles["run-test-jprt"], macosxRunTestExtra);
profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"], macosxRunTestExtra);
}
// On windows we want the debug symbols available at test time
if (input.build_os == "windows") {
windowsRunTestPrebuiltExtra = {
dependencies: [ testedProfile + ".jdk_symbols" ],
environment: {
"PRODUCT_SYMBOLS_HOME": input.get(testedProfile + ".jdk_symbols", "home_path"),
}
};
profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"],
windowsRunTestPrebuiltExtra);
}
// Generate the missing platform attributes
profiles = generatePlatformAttributes(profiles);

View File

@ -34,6 +34,9 @@ JTREG_VM_TYPE ?= -agentvm
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 @@ else
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 @@ ifndef PRODUCT_HOME
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 @@ else
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