How to debug a Thread-running application?

Hello,

How to debug a Thread-running application by Netbeans 5.0?

Although I set breakpoints to the method of the Thread, the debugger never step into it? What can I do?

The code for implementation is like this:

[01]publicclass MyClass

[02]{

[03]publicstaticvoid main(String[] args)

[04]{

[05]// Something do before ...

[06]myMehotd();// Debugger would step-and-stop at the breakpoint here I set for this line ...

[07]MyThread myThread =new myThread();

[08]myThread.start();

[09]// Something do after ....

[10]}

[11]

[12]private myMethod()

[13]{

[14]// Debugger would step-and-stop at the breakpoint(s) here I set for this method ...

[15]}

[16]

[17]class MyThreadextends Thread

[18]{

[19]public MyThread()

[20]{

[21]// something do it for object-construction

[22]}

[23]

[24]publicvoid run()

[25]{

[26]// Debugger never step-and-stop at the breakpoint(s) here I set for this method ...

[27]}

[28]}

[29]}

[2005 byte] By [jdevnewbiea] at [2007-10-2 19:55:53]
# 1
For multi threaded debugging, I have for eclipse is the best. (Although it is not my faviourite IDE) I would suggest you try the same thing in eclipse.ORTry adding code System.out.println("whatever") to check these lines are being run.
Peter__Lawreya at 2007-7-13 22:35:10 > top of Java-index,Archived Forums,Debugging Tools and Techniques...