My first post here.
I am presently implementing JDWP into a small VM - no JVMTI underneath. I am having trouble understanding the interaction between debugger (eclipse 3.4) and debuggee (the VM).
The VM starts a single thread and suspends all while it waits for a incoming connection. A connection comes in from eclipse and debugger/debuggee make their way through all commands/replies up the the VirtualMachine_Resume command to get things started again.
During all this, the debugger requests a event set CLASS_PREPARE on a class with a classmatch filter and a SuspendPolicy of THREAD. Fair enough.
So ... the VM sends the CLASS_PREPARE command to the debugger and then suspends the single thread. As there is only one thread, the VM has to basically spin waiting for something from the debugger to resume the thread (I guess ??).
BUT .. then the debugger nevers sends anything.
Is my understanding correct? Should the debugger respond to get stuff going again? (yes - "I'm doing something wrong", no = "I don't understand, please explain ...")
All help appreciated.
Self-reply .. for the record and as a note to other (unfortunate) persons who are implementing JDWP from the spec.
My issue was with what happened when the VM started. I was performing the startup VMStart interaction before the main class had been loaded. It is wise to start the VM/debugger interaction after the main class has been loaded - escpecially if your testing involves putting a breakpoint in the main class. :-/