JDK-8261098 : Add clhsdb "findsym" command
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-02-03
  • Updated: 2021-03-13
  • Resolved: 2021-02-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b11Fixed
Related Reports
Blocks :  
CSR :  
Relates :  
Relates :  
Relates :  
Description
There is currently no way to map a native symbol to its address, which is basically the opposite of what "findpc" does. It's very easy to add that support:

       new Command("findsym", "findsym name", false) {
           public void doit(Tokens t) {
               if (t.countTokens() != 1) {
                   usage();
               } else {
                      out.println(VM.getVM().getDebugger().lookup(null, t.nextToken()));
               }
           }
       },

And this is what it allows you to do:

hsdb> findsym MaxJNILocalCapacity
0x00007f3c3def6e20
hsdb> findpc 0x00007f3c3def6e20
Address 0x00007f3c3def6e20: MaxJNILocalCapacity
hsdb> examine 0x00007f3c3def6e20
0x00007f3c3def6e20: 0x0000000000010000

And 0x10000 is indeed the default value for MaxJNILocalCapacity as seen in globals.hpp:

  product(intx, MaxJNILocalCapacity, 65536,                                 \

Comments
Changeset: c158413e Author: Chris Plummer <cjplummer@openjdk.org> Date: 2021-02-19 00:58:28 +0000 URL: https://git.openjdk.java.net/jdk/commit/c158413e
19-02-2021