The current debug agent uses the following code to determine whether a thread
is suspended at a breakpoint:
if ((thread_ee != 0) && (thread_ee->current_frame != 0) &&
(thread_ee->current_frame->lastpc != 0) &&
(*thread_ee->current_frame->lastpc == opc_breakpoint)) {
return sun_tools_debug_AgentConstants_THR_STATUS_BREAK;
}
However, the VM does not initialize the lastpc field to 0. If the
debug agent happens to suspend a thread between the time when a new
frame is pushed on the stack and the time when the first bytecode for
the corresponding method is interpreted, the code above is likely
to crash the VM.
I fixed this in the Java WorkShop version of the VM by initializing
the lastpc field every time a new frame is pushed on the stack. The
only negative effect of this change is a slight increase in the method
invocation time. Since the code is already initializing many other
fields, the cost of initializing one more field should be minimal.
robert.wilson@Eng 1997-09-26
john.bui@eng 1997-10-17
No specific test case available. Implicity tested, closed with exposure.
is suspended at a breakpoint:
if ((thread_ee != 0) && (thread_ee->current_frame != 0) &&
(thread_ee->current_frame->lastpc != 0) &&
(*thread_ee->current_frame->lastpc == opc_breakpoint)) {
return sun_tools_debug_AgentConstants_THR_STATUS_BREAK;
}
However, the VM does not initialize the lastpc field to 0. If the
debug agent happens to suspend a thread between the time when a new
frame is pushed on the stack and the time when the first bytecode for
the corresponding method is interpreted, the code above is likely
to crash the VM.
I fixed this in the Java WorkShop version of the VM by initializing
the lastpc field every time a new frame is pushed on the stack. The
only negative effect of this change is a slight increase in the method
invocation time. Since the code is already initializing many other
fields, the cost of initializing one more field should be minimal.
robert.wilson@Eng 1997-09-26
john.bui@eng 1997-10-17
No specific test case available. Implicity tested, closed with exposure.