Solved

Eclipse: set java breakpoint anywhere in class

Posted on 2011-02-22
6
1,155 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to get all the API from website? 11 106
jsp login check 12 43
Notify sent to other threads in Java 9 34
web project error add remove 1 32
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…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This video teaches viewers about errors in exception handling.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

830 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