Solved

Eclipse: set java breakpoint anywhere in class

Posted on 2011-02-22
6
1,147 Views
Last Modified: 2012-05-11
I want to debug some code such that execution breaks at any point in a particular class. I could do this by setting a breakpoint in every method, but this would be a bit tedious. Is there an easier way to do this?
0
Comment
Question by:allelopath
  • 4
6 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 34953788
I'm not sure I understand what means that executin breaks as any point?
If it throws an excpetion for the beginning you could add
ex.printStackTrace() to the catch loop and it will tell you the exact
line where the error happens - then you can ut breakpoints
and check variables if necessary somewhere close to that place before the exception happens.

0
 
LVL 1

Author Comment

by:allelopath
ID: 34953818
Here:
http://www.experts-exchange.com/Programming/Languages/Java/Q_24361001.htmL
I see:
Open the Outline-View for your class ... select all methods ... right-click ... select "Toggle Method Breakpoint"

but I don't see "Toggle Method Breakpoint". I do see Toggle Class Load Breakpoint, which might suffice.
0
 
LVL 47

Expert Comment

by:for_yan
ID: 34953879
In the Run menu there is Toggle Method Breakpoint, I see it
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 47

Expert Comment

by:for_yan
ID: 34953905
But you need to have your cursor inside the method to be able to do ii
0
 
LVL 47

Accepted Solution

by:
for_yan earned 500 total points
ID: 34953916
Yes, if you select all methods in the outline view before, then go to Run - Toggle NMethod Breakpoint - and it would
put in all of them
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 34954125
What is the need to put lot of break point in the single class...

put only only one break point in the staring of the class and debug the class ....

when where its calls constructor called automatically then break point will enable press F5 for step by debug F6 for next line inspection !!

better try F6 then you can find error easily !!  

I think this only your asking
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
topping3 challenge 14 70
github account with ecipse 1 42
fibonacci ten numbers 4 30
arguments to jar 5 17
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now