Bug 227746

Summary: Breakpoint condition "Multiple of" does not work with remote and slow VM.
Product: debugger Reporter: alexander.burdukov
Component: JavaAssignee: Martin Entlicher <mentlicher>
Status: NEW --- QA Contact: issues <issues.netbeans.org>
Priority: P3    
Version: 7.3   
Target Milestone: 7.4   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Report:

Description alexander.burdukov 2013-03-20 21:21:53 UTC
Reproduced with EA version of "Oracle Java ME SDK 3.3" connected to EA version of "Oracle Java ME Embedded 3.3 for Raspberry Pi".

Note, that in this case we have a Java VM on remote and slow physical board connected to PC where NetBeans is started.

1. Use following snippet:
package threads;

import javax.microedition.midlet.*;

public class IMlet extends MIDlet {
    public void startApp() {
        new NewThread().start();
        sleep(2); //1 sec
        new NewThread().start();
        sleep(2); //1 sec
        new NewThread().start();
        sleep(2); //1 sec
        new NewThread().start();
    public void pauseApp() {
    public void destroyApp(boolean unconditional) {

    private void exit() {
    private void sleep(long sec) {
        try {
            Thread.sleep(sec * 1000);
        } catch (InterruptedException ex) {

class NewThread extends Thread {
    private static int nr = 0;
    private int id;

    public NewThread() {
        id = nr++;
    public void run() {

2. Add a new thread break point:
Stop On: Thread Start, Hit count is multiple of 2, Suspend: Breakpoint thread
3. Add another breakpoint at line 14 (exit() call).
4. Debug the application.

You may find that sometimes the application stops on NewThread.run() two times,
and sometimes - only once. 

There is no "Multiple of" feature in JDWP protocol. It is emulated with "Equal to" feature, and setting new breakpoint on handling previous one. But with this approach a number of events can be missed because:
1) VM is not stopped (recommended setting is Suspend: Breakpoint thread) and continues to produce events while NetBeans handles the event
2) JDWP protocol is asynchronous. A number of ready events can be queued or being transferred already.
Comment 1 Martin Entlicher 2013-03-26 17:06:07 UTC
True. Thanks for your observation.
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo