Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8144855

Decoder::can_decode_C_frame_in_vm should be folded into os::dll_address_to_function_name

    Details

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                iklam Ioi Lam
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: