RFR: 8374521: Support fine-grained native debug levels [v2]

Aleksey Shipilev shade at openjdk.org
Tue Jan 6 15:47:31 UTC 2026


> [JDK-8374507](https://bugs.openjdk.org/browse/JDK-8374507) forced me to look into debug info sizes again. And I remembered that GCC actually have debug-level support, which can select what kind of diagnostic data is in the debug info. See: https://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Debugging-Options.html
> 
> Allowing users to configure the debug level allows two major deviations from the default level (2):
>  level=1: significantly reduce the debug info size, but still allow backtrace reconstruction
>  level=3: add even more debugging info, like macro expansion, into the debug data
> 
> This RFE upstreams the variant the patch that I have been using in builds.shipilev.net binaries: the fastdebug variants there are done with GCC level=1, greatly optimizing the debug binary sizes, while still maintaining the major benefit of debug binaries -- rich crash diagnostics.
> 
> I threw in this option into current GHA builds to conserve more disk space on runners and/or transfers. 
> 
> I am open for bikeshedding on the option name :)

Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:

  --with-debug-info-level

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/29056/files
  - new: https://git.openjdk.org/jdk/pull/29056/files/ebca865c..4971365c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=29056&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=29056&range=00-01

  Stats: 21 lines in 5 files changed: 0 ins; 0 del; 21 mod
  Patch: https://git.openjdk.org/jdk/pull/29056.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29056/head:pull/29056

PR: https://git.openjdk.org/jdk/pull/29056


More information about the build-dev mailing list