--- old/make/lib/Lib-jdk.attach.gmk 2015-05-06 20:17:48.000000000 +0200 +++ new/make/lib/Lib-jdk.attach.gmk 2015-05-06 20:17:48.000000000 +0200 @@ -27,6 +27,12 @@ ################################################################################ +ifeq ($(OPENJDK_TARGET_OS), windows) + # In (at least) VS2013 and later, -DPSAPI_VERSION=1 is needed to generate + # a binary that is compatible with windows versions older than 7/2008R2. + # See MSDN documentation for GetProcessMemoryInfo for more information. + LIBATTACH_CFLAGS := -DPSAPI_VERSION=1 +endif $(eval $(call SetupNativeCompilation,BUILD_LIBATTACH, \ LIBRARY := attach, \ @@ -35,7 +41,7 @@ OPTIMIZATION := LOW, \ CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \ -I$(SUPPORT_OUTPUTDIR)/headers/jdk.attach \ - $(LIBJAVA_HEADER_FLAGS), \ + $(LIBJAVA_HEADER_FLAGS) $(LIBATTACH_CFLAGS), \ CFLAGS_windows := /Gy, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libattach/mapfile-$(OPENJDK_TARGET_OS), \ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ --- old/src/jdk.attach/share/classes/com/sun/tools/attach/spi/AttachProvider.java 2015-05-06 20:17:50.000000000 +0200 +++ new/src/jdk.attach/share/classes/com/sun/tools/attach/spi/AttachProvider.java 2015-05-06 20:17:49.000000000 +0200 @@ -241,7 +241,7 @@ * (using the zero-arg constructor) at the first invocation of this method. * The list returned by the first invocation of this method is the list * of providers. Subsequent invocations of this method return a list of the same - * providers. The list is unmodifable. + * providers. The list is unmodifiable. * * @return A list of the installed attach providers. */ @@ -264,8 +264,8 @@ ThreadDeath td = (ThreadDeath)t; throw td; } - // Ignore errors and exceptions - System.err.println(t); + // Log errors and exceptions since we cannot return them + t.printStackTrace(); } } }