Bug 218311 - KdpDebugTask do not attach debugger in some cases
KdpDebugTask do not attach debugger in some cases
Status: CLOSED FIXED
Product: javame
Classification: Unclassified
Component: -- Other --
7.2
PC Windows 7
: P2 (vote)
: 7.3
Assigned To: Tomas Zezula
issues@mobility
: 73_HR_FIX
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-13 17:28 UTC by alexander.burdukov
Modified: 2014-04-16 19:10 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alexander.burdukov 2012-09-13 17:28:59 UTC
The problem exists in NetBeans at least starting from 7.1.1 latest nightly 7.2.x and 7.3 builds are also affected.

On slow PCs debugger did not attached, but thinks that it attached successfully.
Reproduced with ME SDK (not in this case it can be reproduced not on every PC), but can be reproduced also using following steps without any emulator:

1. Create any simple Java ME project.
2. Optionally set breakpoint somewhere
3. Open project build-impl.xml file and find "cldc-debug" target
4. In this target comment out or remove invocation of "nb-run" target 
   and set jpda.port property to value some free port.
   E.g. "cldc-debug" target after these changes will look like:
    
   <target name="cldc-debug" if="cldc-platform.trigger">
        <parallel>
            <property name="jpda.port" value="65432"/>
            <sequential>
                <sleep seconds="5"/>
                <antcall target="nbdebug"/>
            </sequential>
        </parallel>
    </target>

5. Debug the project (probably, several attempt will be required for this step to reproduce)

As the result, you will see following in the output view:

cldc-debug:
nbdebug:
KdpDebugTask connecting to debugger 1 ..
Attached JPDA debugger to localhost:65432
semc-debug-start:
semc-build-j9-debug:
semc-icon-assembly:
semc-ppro-emulator:
semc-do-run:
semc-debug:
savaje-debug:
sjmc-debug:
ojec-debug:
cdc-hi-debug:
nokiaS80-debug:
debug:
BUILD SUCCESSFUL (total time: 12 seconds)

As you can see NetBeans thinks that it successfully attached debugger, but in fact we even did not opened a port to attach the debugger.

The problem is located it least in KdpDebugTask.execute method. It uses JPDADebugger.attach method to attach debugger. If this method did not thow any exception it is assumed as the debugger is attached. This assumption is incorrect: JPDADebugger.attach returns JPDADebugger object and at least the result value of JPDADebugger.getState() method must be taken into account to detect if the debugger was really attached.
Comment 1 alexander.burdukov 2012-09-13 17:30:49 UTC
The priority is set to P2 since due to this problem debugging with ME SDK works very unstable on wide range of PCs, however, ME SDK workarounded this problem on its side in the nearest release.
Comment 2 Tomas Zezula 2013-01-14 16:21:01 UTC
Fixed jet-main e27e4ab38382
Comment 3 Petr Somol 2013-01-14 17:09:59 UTC
reviewed the patch. false debugger attachment is now prevented.
Comment 4 Quality Engineering 2013-01-15 07:29:36 UTC
Integrated into 'main-golden', will be available in build *201301150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e27e4ab38382
User: Tomas Zezula <tzezula@netbeans.org>
Log: #218311:KdpDebugTask do not attach debugger in some cases
Comment 5 Stepan Zebra 2013-01-15 14:42:24 UTC
verified in trunk
Comment 6 Tomas Zezula 2013-01-18 10:14:50 UTC
Integrated into NB 7.3: 5d5eccb709b2
Comment 7 Quality Engineering 2013-01-19 00:03:15 UTC
Integrated into 'releases', will be available in build *201301182100* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/5d5eccb709b2
User: Tomas Zezula <tzezula@netbeans.org>
Log: #218311:KdpDebugTask do not attach debugger in some cases
Comment 8 Stepan Zebra 2013-01-25 11:40:08 UTC
verified in 7.3 RC1
Comment 9 alexander.burdukov 2014-04-16 19:10:55 UTC
Verified on NB8.0. Closing.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo