Solved

Eclipse: set java breakpoint anywhere in class

Posted on 2011-02-22
6
1,139 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Updating Java 9 87
countAbc challenge 9 49
Java passing arguments (type error) 2 35
github account with ecipse 1 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…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This video teaches viewers about errors in exception handling.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

757 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

19 Experts available now in Live!

Get 1:1 Help Now