K
Ken.C
Hi,
I did Google search but didn't get much useful info...
Basically, I encountered IndexOutOfBoundsException when trying to get
current stack frame:
1 void methodEntryEvent(MethodEntryEvent event) {
2 Method method = event.method();
3 ThreadReference thread = (ThreadReference) event.thread();
4 try {
5 StackFrame stackFrame = thread.frame(0);
.............
}
catch(IncompatibleThreadStateException e){
........
}
}
The exception occurred at line 5. Test codes running on the target VM
are:
public static void main(String[] args) {
String name = "Someone";
System.out.println(foo(name));
}
private static String foo(String name) {
System.out.println(bar(888));
return "Hi, " + name + ".";
}
private static int bar(int a) {
return 999;
}
Does anyone know why the stack counter is always 0 in my codes?
Thanks a lot
I did Google search but didn't get much useful info...
Basically, I encountered IndexOutOfBoundsException when trying to get
current stack frame:
1 void methodEntryEvent(MethodEntryEvent event) {
2 Method method = event.method();
3 ThreadReference thread = (ThreadReference) event.thread();
4 try {
5 StackFrame stackFrame = thread.frame(0);
.............
}
catch(IncompatibleThreadStateException e){
........
}
}
The exception occurred at line 5. Test codes running on the target VM
are:
public static void main(String[] args) {
String name = "Someone";
System.out.println(foo(name));
}
private static String foo(String name) {
System.out.println(bar(888));
return "Hi, " + name + ".";
}
private static int bar(int a) {
return 999;
}
Does anyone know why the stack counter is always 0 in my codes?
Thanks a lot