문제

Possible Duplicate:
Program Counter register values for a Java program

Is it possible to obtain the program counter (PC) register values of a running Java application?

도움이 되었습니까?

해결책

It depends on how you want to go about it. For example, if via the JVM Tool Interface, there is an exposed function named GetFrameLocation. This should be equivalent to the program counter.

jvmtiEnv *penv;
...
jmethodID cur_method;
jlocation cur_loc;
(*penv)->GetFrameLocation(0, 0, &cur_method, &cur_loc);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top