From a9679acd5c85b88afe827dc55dbe9a78b00c8918 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Tue, 12 Sep 2023 20:17:52 +0000 Subject: [PATCH] 8253620: Debug symbols for tests missing on macos and windows Reviewed-by: dholmes, ihse, jwaters --- make/common/TestFilesCompilation.gmk | 11 ++++++++++- make/test/JtregNativeHotspot.gmk | 1 - 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/make/common/TestFilesCompilation.gmk b/make/common/TestFilesCompilation.gmk index 9cd5b1bd0ba..d97d0e6c697 100644 --- a/make/common/TestFilesCompilation.gmk +++ b/make/common/TestFilesCompilation.gmk @@ -87,6 +87,15 @@ define SetupTestFilesCompilationBody $1_BUILD_INFO := $$($1_OUTPUT_DIR)/_$1-build-info.marker + # Tests are built with internal debug symbols where supported. + # With Visual Studio or on macosx, we revert to external. + $1_COPY_DEBUG_SYMBOLS := false + ifeq ($(TOOLCHAIN_TYPE), microsoft) + $1_COPY_DEBUG_SYMBOLS := true + else ifeq ($(call isTargetOs, macosx), true) + $1_COPY_DEBUG_SYMBOLS := true + endif + # Setup a compilation for each and every one of them $$(foreach file, $$($1_FILTERED_FILE_LIST),\ $$(eval name := $$(strip $$(basename $$(notdir $$(file))))) \ @@ -106,7 +115,7 @@ define SetupTestFilesCompilationBody LIBS := $$($1_LIBS_$$(name)), \ TOOLCHAIN := $(if $$(filter %.cpp, $$(file)), TOOLCHAIN_LINK_CXX, TOOLCHAIN_DEFAULT), \ OPTIMIZATION := $$(if $$($1_OPTIMIZATION_$$(name)),$$($1_OPTIMIZATION_$$(name)),LOW), \ - COPY_DEBUG_SYMBOLS := $$(if $$($1_COPY_DEBUG_SYMBOLS_$$(name)),$$($1_COPY_DEBUG_SYMBOLS_$$(name)),false), \ + COPY_DEBUG_SYMBOLS := $$($1_COPY_DEBUG_SYMBOLS), \ STRIP_SYMBOLS := $$(if $$($1_STRIP_SYMBOLS_$$(name)),$$($1_STRIP_SYMBOLS_$$(name)),false), \ BUILD_INFO_LOG_MACRO := LogInfo, \ )) \ diff --git a/make/test/JtregNativeHotspot.gmk b/make/test/JtregNativeHotspot.gmk index d4006d0e24f..84bd6b123f5 100644 --- a/make/test/JtregNativeHotspot.gmk +++ b/make/test/JtregNativeHotspot.gmk @@ -863,7 +863,6 @@ ifeq ($(call isTargetOs, windows), true) BUILD_HOTSPOT_JTREG_EXCLUDE += exesigtest.c libterminatedThread.c libTestJNI.c libCompleteExit.c libTestPsig.c exeGetCreatedJavaVMs.c BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libatExit := jvm.lib BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libnativeStack := jvm.lib - BUILD_HOTSPOT_JTREG_LIBRARIES_COPY_DEBUG_SYMBOLS_libnativeStack := true BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exedaemonDestroy := jvm.lib else BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exedaemonDestroy := -ljvm