Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Debugging in Eclipse

 
Omkar Shetkar
Ranch Hand
Posts: 81
1
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I wanted to know is there any specialized way to debug multithreaded applications where I want to debug for exceptions like NullPointerException which is occurring randomly for randomly chosen thread. How to deal with this kind of situations? I will be waiting for your valuable replies...

Regards
Omkar V S
 
Tim Holloway
Saloon Keeper
Posts: 18303
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a thread throws a fatal exception while debugging in eclipse, the offending thread should halt but the rest of the app would keep running. In the debug window, you can select the dead thread and see its stack context. I think the other threads keep running, anyway. I forget.

It's also possible to set breakpoints on NullPointerExceptions using the Eclipse breakpoint editor. The main problem here is that certain libraries are quite sloppy about using Null Pointer and Array Out Of Bounds exceptions for application purposes, which they intercept internally and keep running. So if you set a general breakpoint, you may be flooded with noise exceptions.
 
Jay Damon
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To eliminate the "noise" exceptions, specify "uncaught" when creating a Java Exception Breakpoint.
 
Omkar Shetkar
Ranch Hand
Posts: 81
1
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic