This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 241333 - Debugging JavaME: MethodExit breakpoint not supported by CLDC_VM gives raw exception in NetBeans
Summary: Debugging JavaME: MethodExit breakpoint not supported by CLDC_VM gives raw ex...
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-03 12:49 UTC by BorisUlasevich
Modified: 2014-02-07 02:39 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
long text in popup window (8.95 KB, text/plain)
2014-02-03 12:49 UTC, BorisUlasevich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description BorisUlasevich 2014-02-03 12:49:26 UTC
Created attachment 144729 [details]
long text in popup window

We do not support Method Entry/Exit exception in JavaME CLDC VM. On JDWP level we answer "NOT_IMPLEMENTED" to METHOD_EXIT request:
<== 8c: EventRequest.Set eventKind:METHOD_EXIT suspendPolicy:EVENT_THREAD modifiers:1 modKind:CLASSONLY clazz:16 
==> 8c: ERROR NOT_IMPLEMENTED  

Since NetBeans 8.0 user gets popup window with long listing of internal NetBeans exception call stack on attempt to set up method_exit breakpoint.

Can you please handle UnsupportedOperationException from EventRequestImpl.enable, and use the same way with Field_Access breakpoint which we do not support as well: write error message to console, and make breakpoint disabled?
Comment 1 Martin Entlicher 2014-02-03 12:54:57 UTC
O.K. Actually we can only solve defects into 8.0 now and this looks more like a defect, thus I change it from enhancement to defect.
We should also invalidate the breakpoints in the GUI when they're not supported.
Comment 2 Martin Entlicher 2014-02-04 13:34:26 UTC
There are methods VirtualMachine.canWatchFieldAccess() and VirtualMachine.canWatchFieldModification(), but there does not seem to be anything like that for method breakpoints.
The Javadoc does not say, that EventRequest.enable() can throw UnsupportedOperationException.
http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/EventRequest.html#enable%28%29
Unchecked exceptions are the biggest problem in JDI.
Comment 3 Martin Entlicher 2014-02-04 13:38:45 UTC
Shouldn't EventRequestManager.createMethodExitRequest() throw UnsupportedOperationException like e.g. createAccessWatchpointRequest() does? It looks like the API does not count with unsupported method entry/exit breakpoints.
Comment 4 Martin Entlicher 2014-02-04 17:26:21 UTC
We already do check canWatchFieldAccess() and canWatchFieldModification() in FieldBreakpointImpl, therefore field breakpoints should be marked as invalid when not supported.

Unsupported method breakpoints should be handled by changeset: 271601:57935f9028cd
http://hg.netbeans.org/core-main/rev/57935f9028cd
Comment 5 Quality Engineering 2014-02-07 02:39:57 UTC
Integrated into 'main-silver', will be available in build *201402070001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/57935f9028cd
User: mentlicher@netbeans.org
Log: #241333: No all request kinds can be supported, check if EventRequest.enable() throws UnsupportedOperationException.