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.
I have setup a debug anttask as described by the NetBeans 4.0 online documentation: <target name="debug" depends="compile" description="Debug Project"> <fail unless="netbeans.home">This target can only run inside the NetBeans IDE.</fail> <nbjpdastart name="Framework" addressproperty="jpda.address" transport="dt_socket"> <classpath> <pathelement location="${rtbindir}"/> <pathelement location="${bindir}"/> <path refid="xml-paths"/> </classpath> <!-- Optional - If source roots are properly declared in project, should work without setting source path. <sourcepath path="debug.sourcepath"/> --> </nbjpdastart> <java fork="true" classname="com.geniouz.StartWrapper"> <jvmarg value="-Xdebug"/> <jvmarg value="-Xnoagent"/> <jvmarg value="-Djava.compiler=none"/> <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/> <classpath> <pathelement location="${rtbindir}"/> <pathelement location="${bindir}"/> <path refid="xml-paths"/> </classpath> </java> </target> When I do "Debug Project" from the project menu the debugger starts and it stops at my breakpoint as it should. So far, so good. But when I then try pressing "Step over" or "Step into" the debugger continues execution up to the next breakpoint or to the next exception or end of program if no more breakpoints. In other words, those 2 functions does exactly the same thing as "Continue"!! I have to set hundreds of breakpoints to be able to debug since single stepping simply does not work. This behaviour is the same running on Linux or on Windows XP. It does not matter if you run the ide on jdk 1.4 or jdk 1.5 the behaviour is still the same. It is not an installation specific problem. The problem exists for all members of my current project running on Windows XP on HP laptops. I have the same problem in my Linux installation at home (debugging different project with different ant script). The 4.0 RC2 and the 4.0 release and the 4.1 EA has the same problem. Maybee I'm doing something wrong in the ant task. In project properties "Build & Run" there is a <link-to-help> klickable that brings up the help for making a debug ant task. I copied the example from that help and changed the class to run and the classpaths. This problem renders the debugger useless. We have a very tight project and have some debugging to do, so this is a very serious problem for us.
It just occured to me to add that this problem occurs in a freeform project where I supply the Ant script. This is implied in the description below, but not clearly stated. I have not tested a project where Netbeans creates the Ant script. I have no such projects since all my projects existed before Netbeans 4.0 :-) /Tommy Svensson
There are two possible causes of this problem: 1) your javac ant task does not have debug="true" param set. application is compiled without debug information, in this case. 2) you do not have correctly setuped classpath and sourcepath. How to detect: start debugging, Main Manu - Window - Debugging - Sources. In this view you should see all source roots. How to fix: check classpath in your script. Check Project - properties - output. You should have selected output directory for all your source roots.
Yes, it was the <sourcepath></sourcepath> in <nbjpdastart> that was missing! When I added that it worked! I was about to suggest adding that to the documentation, but it already is there, I just didn't see it. In the target I pasted in above that was taken from the documentation there is a commented out <sourcepath>. There is however a comment that says "If source roots are properly declared in project, should work without setting source path". If "properly declared in project" means specified in the project properties under "Sources" that comment is incorrect! My source paths are specified there, but the debugger did not work until I put a specific <sourcepath> in the Ant script. /Tommy Svensson