Skip to content

Commit 6d9e91f

Browse files
committed
8373246: JDK-8351842 broke native debugging on Linux
Reviewed-by: erikj Backport-of: b5ac8f8
1 parent d5dde3f commit 6d9e91f

File tree

3 files changed

+29
-59
lines changed

3 files changed

+29
-59
lines changed

make/Bundles.gmk

Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -185,77 +185,30 @@ endif
185185

186186
ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
187187

188-
SYMBOLS_EXCLUDE_PATTERN := %.debuginfo %.diz %.map
189-
190-
# There may be files with spaces in the names, so use ShellFindFiles
191-
# explicitly.
188+
# There may be files with spaces in the names, so use ShellFindFiles explicitly.
192189
ALL_JDK_FILES := $(call ShellFindFiles, $(JDK_IMAGE_DIR))
193-
ifneq ($(JDK_IMAGE_DIR), $(JDK_SYMBOLS_IMAGE_DIR))
194-
ALL_JDK_SYMBOLS_FILES := $(call ShellFindFiles, $(JDK_SYMBOLS_IMAGE_DIR))
195-
else
196-
ALL_JDK_SYMBOLS_FILES := $(ALL_JDK_FILES)
197-
endif
198190
ifneq ($(JDK_IMAGE_DIR), $(JDK_DEMOS_IMAGE_DIR))
199191
ALL_JDK_DEMOS_FILES := $(call ShellFindFiles, $(JDK_DEMOS_IMAGE_DIR))
200192
else
201193
ALL_JDK_DEMOS_FILES := $(ALL_JDK_FILES)
202194
endif
203195

204-
# Create special filter rules when dealing with unzipped .dSYM directories on
205-
# macosx
206-
ifeq ($(call isTargetOs, macosx), true)
207-
ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), false)
208-
JDK_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \
209-
$(call containing, .dSYM/, $(patsubst $(JDK_IMAGE_DIR)/%, %, \
210-
$(ALL_JDK_SYMBOLS_FILES))))
211-
endif
212-
endif
213-
214-
# Create special filter rules when dealing with debug symbols on windows
215-
ifeq ($(call isTargetOs, windows), true)
216-
ifeq ($(SHIP_DEBUG_SYMBOLS), )
217-
JDK_SYMBOLS_EXCLUDE_PATTERN := %.pdb
218-
endif
219-
endif
220-
221196
JDK_BUNDLE_FILES := \
222197
$(filter-out \
223-
$(JDK_SYMBOLS_EXCLUDE_PATTERN) \
224198
$(JDK_EXTRA_EXCLUDES) \
225-
$(SYMBOLS_EXCLUDE_PATTERN) \
226199
$(JDK_IMAGE_HOMEDIR)/demo/% \
227200
, \
228201
$(ALL_JDK_FILES) \
229202
)
230203

231-
JDK_SYMBOLS_BUNDLE_FILES := \
232-
$(call FindFiles, $(SYMBOLS_IMAGE_DIR))
204+
JDK_SYMBOLS_BUNDLE_FILES := $(call FindFiles, $(SYMBOLS_IMAGE_DIR))
233205

234206
TEST_DEMOS_BUNDLE_FILES := $(filter $(JDK_DEMOS_IMAGE_HOMEDIR)/demo/%, \
235207
$(ALL_JDK_DEMOS_FILES))
236208

237209
ALL_JRE_FILES := $(call ShellFindFiles, $(JRE_IMAGE_DIR))
238210

239-
# Create special filter rules when dealing with unzipped .dSYM directories on
240-
# macosx
241-
ifeq ($(OPENJDK_TARGET_OS), macosx)
242-
ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), false)
243-
JRE_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \
244-
$(call containing, .dSYM/, $(patsubst $(JRE_IMAGE_DIR)/%, %, $(ALL_JRE_FILES))))
245-
endif
246-
endif
247-
248-
# Create special filter rules when dealing with debug symbols on windows
249-
ifeq ($(call isTargetOs, windows), true)
250-
ifeq ($(SHIP_DEBUG_SYMBOLS), )
251-
JRE_SYMBOLS_EXCLUDE_PATTERN := %.pdb
252-
endif
253-
endif
254-
255-
JRE_BUNDLE_FILES := $(filter-out \
256-
$(JRE_SYMBOLS_EXCLUDE_PATTERN) \
257-
$(SYMBOLS_EXCLUDE_PATTERN), \
258-
$(ALL_JRE_FILES))
211+
JRE_BUNDLE_FILES := $(ALL_JRE_FILES)
259212

260213
ifeq ($(MACOSX_CODESIGN_MODE), hardened)
261214
# Macosx release build and code signing available.

make/CreateJmods.gmk

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,14 @@ ifeq ($(call isTargetOs, windows), true)
218218
ifeq ($(SHIP_DEBUG_SYMBOLS), )
219219
JMOD_FLAGS += --exclude '**{_the.*,_*.marker*,*.diz,*.pdb,*.map}'
220220
else
221-
JMOD_FLAGS += --exclude '**{_the.*,_*.marker*,*.diz,*.map}'
221+
JMOD_FLAGS += --exclude '**{_the.*,_*.marker*,*.map}'
222222
endif
223223
else
224-
JMOD_FLAGS += --exclude '**{_the.*,_*.marker*,*.diz,*.debuginfo,*.dSYM/**,*.dSYM}'
224+
ifeq ($(SHIP_DEBUG_SYMBOLS), )
225+
JMOD_FLAGS += --exclude '**{_the.*,_*.marker*,*.diz,*.debuginfo,*.dSYM/**,*.dSYM}'
226+
else
227+
JMOD_FLAGS += --exclude '**{_the.*,_*.marker*}'
228+
endif
225229
endif
226230

227231
# Unless we are creating a very large module, use the small tool JVM options

make/autoconf/jdk-options.m4

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -316,23 +316,36 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
316316
AC_MSG_CHECKING([if we should add external native debug symbols to the shipped bundles])
317317
AC_ARG_WITH([external-symbols-in-bundles],
318318
[AS_HELP_STRING([--with-external-symbols-in-bundles],
319-
[which type of external native debug symbol information shall be shipped in product bundles (none, public, full)
320-
(e.g. ship full/stripped pdbs on Windows) @<:@none@:>@])])
319+
[which type of external native debug symbol information shall be shipped with bundles/images (none, public, full).
320+
@<:@none in release builds, full otherwise. --with-native-debug-symbols=external/zipped is a prerequisite. public is only supported on Windows@:>@])],
321+
[],
322+
[with_external_symbols_in_bundles=default])
321323
322324
if test "x$with_external_symbols_in_bundles" = x || test "x$with_external_symbols_in_bundles" = xnone ; then
323325
AC_MSG_RESULT([no])
324326
elif test "x$with_external_symbols_in_bundles" = xfull || test "x$with_external_symbols_in_bundles" = xpublic ; then
325-
if test "x$OPENJDK_TARGET_OS" != xwindows ; then
326-
AC_MSG_ERROR([--with-external-symbols-in-bundles currently only works on windows!])
327-
elif test "x$COPY_DEBUG_SYMBOLS" != xtrue ; then
328-
AC_MSG_ERROR([--with-external-symbols-in-bundles only works when --with-native-debug-symbols=external is used!])
329-
elif test "x$with_external_symbols_in_bundles" = xfull ; then
327+
if test "x$COPY_DEBUG_SYMBOLS" != xtrue ; then
328+
AC_MSG_ERROR([--with-external-symbols-in-bundles only works when --with-native-debug-symbols=external/zipped is used!])
329+
elif test "x$with_external_symbols_in_bundles" = xpublic && test "x$OPENJDK_TARGET_OS" != xwindows ; then
330+
AC_MSG_ERROR([--with-external-symbols-in-bundles=public is only supported on Windows!])
331+
fi
332+
333+
if test "x$with_external_symbols_in_bundles" = xfull ; then
330334
AC_MSG_RESULT([full])
331335
SHIP_DEBUG_SYMBOLS=full
332336
else
333337
AC_MSG_RESULT([public])
334338
SHIP_DEBUG_SYMBOLS=public
335339
fi
340+
elif test "x$with_external_symbols_in_bundles" = xdefault ; then
341+
if test "x$DEBUG_LEVEL" = xrelease ; then
342+
AC_MSG_RESULT([no (default)])
343+
elif test "x$COPY_DEBUG_SYMBOLS" = xtrue ; then
344+
AC_MSG_RESULT([full (default)])
345+
SHIP_DEBUG_SYMBOLS=full
346+
else
347+
AC_MSG_RESULT([no (default, native debug symbols are not external/zipped)])
348+
fi
336349
else
337350
AC_MSG_ERROR([$with_external_symbols_in_bundles is an unknown value for --with-external-symbols-in-bundles])
338351
fi

0 commit comments

Comments
 (0)