Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions make/Bundles.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ define SetupBundleFileBody
&& $(TAR) cf - -$(TAR_INCLUDE_PARAM) $$($1_$$d_LIST_FILE) \
$(TAR_IGNORE_EXIT_VALUE) ) \
| ( $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) && $(TAR) xf - )$$(NEWLINE) )
# Rename stripped pdb files
# Rename full pdb files for symbols bundle
ifeq ($(call isTargetOs, windows)+$(SHIP_DEBUG_SYMBOLS), true+public)
for f in `$(FIND) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) -name "*.stripped.pdb"`; do \
$(ECHO) Renaming $$$${f} to $$$${f%stripped.pdb}pdb $(LOG_INFO); \
$(MV) $$$${f} $$$${f%stripped.pdb}pdb; \
for f in `$(FIND) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) -name "*.full.pdb"`; do \
$(ECHO) Renaming $$$${f} to $$$${f%full.pdb}pdb $(LOG_INFO); \
$(MV) $$$${f} $$$${f%full.pdb}pdb; \
done
endif
# Unzip any zipped debuginfo files
Expand Down Expand Up @@ -225,10 +225,7 @@ ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
else
ifeq ($(SHIP_DEBUG_SYMBOLS), public)
JDK_SYMBOLS_EXCLUDE_PATTERN := \
$(filter-out \
%.stripped.pdb, \
$(filter %.pdb, $(ALL_JDK_FILES)) \
)
$(filter %.full.pdb, $(ALL_JDK_FILES))
endif
endif
endif
Expand Down Expand Up @@ -270,10 +267,7 @@ ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
else
ifeq ($(SHIP_DEBUG_SYMBOLS), public)
JRE_SYMBOLS_EXCLUDE_PATTERN := \
$(filter-out \
%.stripped.pdb, \
$(filter %.pdb, $(ALL_JRE_FILES)) \
)
$(filter %.full.pdb, $(ALL_JRE_FILES))
endif
endif
endif
Expand Down
14 changes: 4 additions & 10 deletions make/CreateJmods.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,13 @@ $(call FillFindCache, \
ifneq ($(LIBS_DIR), )
DEPS += $(call FindFiles, $(LIBS_DIR))
ifeq ($(call isTargetOs, windows)+$(SHIP_DEBUG_SYMBOLS), true+public)
# For public debug symbols on Windows, we have to use stripped pdbs and rename them
rename_stripped = $(patsubst %.stripped.pdb,%.pdb,$1)
# For public debug symbols on Windows, we have to filter out full pdbs
LIBS_DIR_FILTERED := $(subst modules_libs,modules_libs_filtered, $(LIBS_DIR))
FILES_LIBS := $(filter-out %.pdb, $(call FindFiles, $(LIBS_DIR))) \
$(filter %.stripped.pdb, $(call FindFiles, $(LIBS_DIR)))
FILES_LIBS := $(filter-out %.full.pdb, $(call FindFiles, $(LIBS_DIR)))
$(eval $(call SetupCopyFiles, COPY_FILTERED_LIBS, \
SRC := $(LIBS_DIR), \
DEST := $(LIBS_DIR_FILTERED), \
FILES := $(FILES_LIBS), \
NAME_MACRO := rename_stripped, \
))
DEPS += $(COPY_FILTERED_LIBS)
JMOD_FLAGS += --libs $(LIBS_DIR_FILTERED)
Expand All @@ -80,16 +77,13 @@ endif
ifneq ($(CMDS_DIR), )
DEPS += $(call FindFiles, $(CMDS_DIR))
ifeq ($(call isTargetOs, windows)+$(SHIP_DEBUG_SYMBOLS), true+public)
# For public debug symbols on Windows, we have to use stripped pdbs and rename them
rename_stripped = $(patsubst %.stripped.pdb,%.pdb,$1)
# For public debug symbols on Windows, we have to filter out full pdbs
CMDS_DIR_FILTERED := $(subst modules_cmds,modules_cmds_filtered, $(CMDS_DIR))
FILES_CMDS := $(filter-out %.pdb, $(call FindFiles, $(CMDS_DIR))) \
$(filter %.stripped.pdb, $(call FindFiles, $(CMDS_DIR)))
FILES_CMDS := $(filter-out %.full.pdb, $(call FindFiles, $(CMDS_DIR)))
$(eval $(call SetupCopyFiles, COPY_FILTERED_CMDS, \
SRC := $(CMDS_DIR), \
DEST := $(CMDS_DIR_FILTERED), \
FILES := $(FILES_CMDS), \
NAME_MACRO := rename_stripped, \
))
DEPS += $(COPY_FILTERED_CMDS)
JMOD_FLAGS += --cmds $(CMDS_DIR_FILTERED)
Expand Down
7 changes: 4 additions & 3 deletions make/common/native/DebugSymbols.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ define CreateDebugSymbols
endif

ifeq ($(call isTargetOs, windows), true)
$1_EXTRA_LDFLAGS += -debug "-pdb:$$($1_SYMBOLS_DIR)/$$($1_BASENAME).pdb" \
"-map:$$($1_SYMBOLS_DIR)/$$($1_BASENAME).map"
$1_EXTRA_LDFLAGS += -debug "-map:$$($1_SYMBOLS_DIR)/$$($1_BASENAME).map"
ifeq ($(SHIP_DEBUG_SYMBOLS), public)
$1_EXTRA_LDFLAGS += "-pdbstripped:$$($1_SYMBOLS_DIR)/$$($1_BASENAME).stripped.pdb"
$1_EXTRA_LDFLAGS += "-pdbstripped:$$($1_SYMBOLS_DIR)/$$($1_BASENAME).pdb" "-pdb:$$($1_SYMBOLS_DIR)/$$($1_BASENAME).full.pdb"
else
$1_EXTRA_LDFLAGS += "-pdb:$$($1_SYMBOLS_DIR)/$$($1_BASENAME).pdb"
endif
endif

Expand Down
8 changes: 4 additions & 4 deletions test/jdk/jdk/modules/etc/JmodExcludedFiles.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -82,10 +82,10 @@ boolean isNativeDebugSymbol(String name) {
}
if (OperatingSystem.isWindows() && name.endsWith(".pdb")) {
// on Windows we check if we should have public symbols through --with-external-symbols-in-bundles=public (JDK-8237192)
String strippedpdb = javaHome + "/bin/" + name.substring(index + 1, name.length() - 4) + ".stripped.pdb";
if (!Files.exists(Paths.get(strippedpdb))) {
String fullpdb = javaHome + "/bin/" + name.substring(index + 1, name.length() - 4) + ".full.pdb";
if (!Files.exists(Paths.get(fullpdb))) {
System.err.println("Found symbols in " + jmod + ": " + name +
". No stripped pdb file " + strippedpdb + " exists.");
". No full pdb file " + fullpdb + " exists.");
return true;
}
}
Expand Down