RFR: 8264593: debug.cpp utilities should be available in product builds. [v2]

Kevin Walls kevinw at openjdk.java.net
Tue Apr 27 16:57:18 UTC 2021


> This is a pull request to move the ifndef PRODUCT in src/hotspot/share/utilities/debug.cpp, and add JNIEXPORT for symbol visibility on Windows.
> 
> With these changes, we can use gdb on a live Linux process of a product build JVM, and call debug.cpp utilities.
> e.g. "call universe()", or "call hsfind(0xADDRESS)".
> 
> (I found that making calls in the JLI_Launch thread (gdb's thread 1) will crash, but switching first to a JavaThread works.)
> 
> In Visual Studio use the Immediate window, just type the function name.  Verified that without the changes, the symbols can't be seen/called.
> 
> Printing happens on the LIVE jvm's tty (not the gdb session).
> 
> 
> WizardMode is a develop flag, can't be changed in a product build, so avoid changing that in the debug() utility.
> 
> 
> pa() is left ifndef PRODUCT, as the class AllocatedObj is ifndef PRODUCT in src/hotspot/share/memory/allocation.hpp
> 
> 
> pns(...) uses frame fr(sp, fp, pc); but we have an ifndef PRODUCT on frame constructor:  frame(void* sp, void* fp, void* pc);
> Leave pns and pns2 ifndef PRODUCT.
> 
> 
> File size changes:
> Linux: libjvm.so becomes 8904 bytes larger.
> Windows: jvm.dll becomes 6656 bytes larger.

Kevin Walls has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:

 - Merge remote-tracking branch 'upstream/master' into debug_utils
 - Remove pa() util as unnecessary.  Tidy help.
 - 8264593: debug.cpp utilities should be available in product builds.

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3307/files
  - new: https://git.openjdk.java.net/jdk/pull/3307/files/c3c81fc7..f6e19d64

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3307&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3307&range=00-01

  Stats: 611853 lines in 6126 files changed: 76854 ins; 524012 del; 10987 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3307.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3307/head:pull/3307

PR: https://git.openjdk.java.net/jdk/pull/3307


More information about the hotspot-dev mailing list