Bug 21483 - Error from ClassPrepareEvent when debugging WTK
Summary: Error from ClassPrepareEvent when debugging WTK
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 2.0   Edit
Hardware: Other All
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Darin Swanson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-11 09:25 EDT by Jared Burns CLA
Modified: 2002-07-23 15:15 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Burns CLA 2002-07-11 09:25:40 EDT
This bug is related to Bug 12966.

1. Import the example classes from the J2ME Wireless Toolkit (WTK) found in 
$WTK_HOME/apps/demos/classes
2. Place a method entry breakpoint on a method in the 
example.manyballs.ManyBalls class.
3. Launch the J2ME WTK gray phone emulator with the "ManyBalls" example 
with the following commandline and attach with a remote java launch config:
emulator -Xdebug -Xdevice:DefaultGrayPhone -classpath
../apps/demos/classes:../lib/midpapi.zip
-Xrunjdwp:transport=dt_socket,address=8000,server=y 
example.manyballs.ManyBalls
4. The following exception occurs:
java.lang.InternalError: Got event of unknown type
at 
org.eclipse.jdi.internal.request.EventRequestManagerImpl.findRequest(EventRe
questManagerImpl.java:498)
at org.eclipse.jdi.internal.event.EventImpl.read(EventImpl.java:153)
at org.eclipse.jdi.internal.event.EventSetImpl.read(EventSetImpl.java:147)
at 
org.eclipse.jdi.internal.event.EventQueueImpl.remove(EventQueueImpl.java:59)
at 
org.eclipse.jdi.internal.event.EventQueueImpl.remove(EventQueueImpl.java:42)
at 
org.eclipse.jdt.internal.debug.core.EventDispatcher.run(EventDispatcher.java
:194)
at java.lang.Thread.run(Thread.java:536)

This exception is thrown while receiving the class prepare event for the
ManyBalls class. The error message here is misleading. The problem isn't 
really an unknown event type, it's the fact that the ClassPrepareEvent is 
coming to us from the VM with a status of VERIFIED instead of PREPARED. Our 
ClassPrepareEventImpl.read(...) method says:
if ((event.fStatus & ReferenceTypeImpl.JDWP_CLASS_STATUS_PREPARED) == 0)
  return null;
EventImpl.read(...) gets this null result from the ClassPrepareEventImpl 
and passes it into EventRequestManagerImpl.findRequest(...) where the 
exception is thrown.

There are at least three things to look at here:
Why does the VM give us a ClassPrepareEvent for an unprepared class?
Why do we return null from ClassPrepareEventImpl when we get a class status 
other than what we expect?
Why do we return null from ClassPrepareEventImpl but not handle null in 
EventImpl.read(...)?
Comment 1 Vickie Yang CLA 2002-07-11 21:57:58 EDT
I don't think that Eclipse should drop the ClassPrepareEvent for an unprepared 
class by returning null. 
Comment 2 Jared Burns CLA 2002-07-12 11:08:07 EDT
I agree with Vickie that the code looks like it doesn't belong.

I've removed the status check from ClassPrepareEventImpl.read(...) and sent 
email to the original implementor to double-check that there isn't some case 
which we're overlooking.
Comment 3 Jared Burns CLA 2002-07-12 11:08:44 EDT
Darin, please verify.
Comment 4 Vickie Yang CLA 2002-07-14 21:41:41 EDT
Good.
Comment 5 Darin Swanson CLA 2002-07-15 13:58:51 EDT
Verified code change.
Comment 6 Darin Wright CLA 2002-07-23 15:15:54 EDT
Fix released to 2.0.1 and HEAD (2.1)