Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Eclipse: set java breakpoint anywhere in class

Posted on 2011-02-22
6
Medium Priority
?
1,185 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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 keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses

963 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