Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Eclipse: set java breakpoint anywhere in class

Posted on 2011-02-22
6
Medium Priority
?
1,174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses

722 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