[Bug 227746] New: Breakpoint condition "Multiple of" does not work with remote and slow VM.

  • From:
  • To:
  • Subject: [Bug 227746] New: Breakpoint condition "Multiple of" does not work with remote and slow VM.
  • Date: Wed, 20 Mar 2013 21:21:53 +0000
  • Auto-submitted: auto-generated

http://netbeans.org/bugzilla/show_bug.cgi?id=227746

             Bug #: 227746
        Issue Type: DEFECT
           Summary: Breakpoint condition "Multiple of" does not work with
                    remote and slow VM.
    Classification: Unclassified
           Product: debugger
           Version: 7.3
          Platform: PC
        OS/Version: Windows 7
            Status: NEW
          Priority: P3
         Component: Java
        AssignedTo: 

        ReportedBy: 

         QAContact: 



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();
        exit();
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }

    private void exit() {
        destroyApp(true);
        notifyDestroyed();
    }

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

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.

-- 
Configure bugmail: http://netbeans.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.


[Bug 227746] New: Breakpoint condition "Multiple of" does not work with remote and slow VM.

alexander . burdukov 03/20/2013

[Bug 227746] Breakpoint condition "Multiple of" does not work with remote and slow VM.

mentlicher 03/26/2013

Project Features

About this Project

Debugger was started in November 2009, is owned by tpavek, and has 29 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close