JDK-8144855 : Decoder::can_decode_C_frame_in_vm should be folded into os::dll_address_to_function_name
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2015-12-07
  • Updated: 2019-05-02
  • Resolved: 2018-10-16
Related Reports
Relates :  
Relates :  
Relates :  
Description
Currently, only frame.cpp has this hotspot/src/share/vm/runtime/frame.cpp

  bool in_vm = os::address_is_in_vm(pc);
  // function name - os::dll_address_to_function_name() may return confusing
  // names if pc is within jvm.dll or libjvm.so, because JVM only has
  // JVM_xxxx and a few other symbols in the dynamic symbol table. Do this
  // only for native libraries.
  if (!in_vm || Decoder::can_decode_C_frame_in_vm()) {
    found = os::dll_address_to_function_name(pc, buf, buflen, &offset);

    if (found) {
      st->print("  %s+0x%x", buf, offset);
    }
  }

In all other invocations of os::dll_address_to_function_name, no call to Decoder::can_decode_C_frame_in_vm() is made.

./src/share/vm/compiler/disassembler.cpp:  found = os::dll_address_to_function_name(adr, buf, sizeof(buf), &offset);
./src/share/vm/utilities/nativeCallStack.cpp:      if (os::dll_address_to_function_name(pc, buf, sizeof(buf), &offset)) {
./src/share/vm/runtime/fprofiler.cpp:      if (os::dll_address_to_function_name(epc.pc(), buf, sizeof(buf), NULL)) {
./src/share/vm/runtime/frame.cpp:  // function name - os::dll_address_to_function_name() may return confusing
./src/share/vm/runtime/frame.cpp:    found = os::dll_address_to_function_name(pc, buf, buflen, &offset);

So, is (!in_vm || Decoder::can_decode_C_frame_in_vm()) really necessary (this seems to be a Windows-only thing). If it is, we should move the check into os::dll_address_to_function_name, or else people will just forget (or not know) to call it.

Comments
Note that this issue has been implicitly fixed with JDK-8185712.
17-10-2018

Triage: This is not on our current list of priorities. We will considered this feature if we receive additional customer requirements.
16-10-2018