RFR: JDK-8199331 Don't limit debug information for fastdebug JDK native libraries

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Thu Mar 8 14:19:25 UTC 2018


Since long time ago, native libraries in JDK has been compiled with -g1 instead of -g, when doing a fastdebug build with gcc. (This does not apply to hotspot which is always compiled with -g.)

This means that the debug information generated is limited. The gcc manual says this about level 1:

"Level 1 produces minimal information, enough for making backtraces in parts of the program that you don't plan to debug. This includes descriptions of functions and external variables, and line number tables, but no information about local variables."

The reason for doing this is claimed to be concerns over size. However, debug symbols images only increased from 129 MB to 135 MB with -g instead of -g1. This does not seem like a valid concern.

As part of a general effort of simplifying and unifying the various options, I'd like to turn this to -g, so we have consistent debug capabilities regardless of build type.

Bug: https://bugs.openjdk.java.net/browse/JDK-8199331
Patch inline:
diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4
--- a/make/autoconf/flags-cflags.m4
+++ b/make/autoconf/flags-cflags.m4
@@ -108,11 +108,7 @@
 [
   # Debug symbols
   if test "x$TOOLCHAIN_TYPE" = xgcc; then
-    if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then
-      CFLAGS_DEBUG_SYMBOLS="-g1"
-    else
-      CFLAGS_DEBUG_SYMBOLS="-g"
-    fi
+    CFLAGS_DEBUG_SYMBOLS="-g"
   elif test "x$TOOLCHAIN_TYPE" = xclang; then
     CFLAGS_DEBUG_SYMBOLS="-g"
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then

/Magnus


More information about the build-dev mailing list