Top


定義場所(file name)

hotspot/src/os/windows/vm/os_windows.cpp

説明(description)

// Get's a pc (hint) for a running thread. Currently used only for profiling.

名前(function name)

ExtendedPC os::get_thread_pc(Thread* thread) {

本体部(body)

  {- -------------------------------------------
  (1) (変数宣言など)
      ---------------------------------------- -}

      CONTEXT context;
      context.ContextFlags = CONTEXT_CONTROL;
      HANDLE handle = thread->osthread()->thread_handle();

  {- -------------------------------------------
  (1) GetThreadContext() を呼んで pc を取得し, リターンする.

      (ただし #ifdef _M_IA64 の場合は単に NULL (をラップしたExtendedPC) をリターンするだけ)
      ---------------------------------------- -}

    #ifdef _M_IA64
      assert(0, "Fix get_thread_pc");
      return ExtendedPC(NULL);
    #else
      if (GetThreadContext(handle, &context)) {
    #ifdef _M_AMD64
        return ExtendedPC((address) context.Rip);
    #else
        return ExtendedPC((address) context.Eip);
    #endif
      } else {
        return ExtendedPC(NULL);
      }
    #endif
    }

This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.