Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Debugging vs setting a breakfront and running a program
Debugging vs setting a breakfront and running a program [message #1799332] Tue, 04 December 2018 21:28 Go to next message
Robert Murch is currently offline Robert MurchFriend
Messages: 13
Registered: August 2018
Junior Member
What is the difference between using the debug option and simply setting a breakpoint then running an application? I have never actually used the debugger before I have always just set breakpoints and ran my programs up to the point. What does the debugger do exactly?
Re: Debugging vs setting a breakfront and running a program [message #1799336 is a reply to message #1799332] Wed, 05 December 2018 05:27 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
I'm not sure which language your using, Java I'll assume. If you simply run the application, it won't stop at breakpoints. Breakpoints only work when debugging the application. Then when it hits the breakpoint you'll be asked if you want to turn to the Debug perspective; at least that's what it does by default. Here you can see in the Debug view your running application and all its threads. You can click any stack frame and in the Variables view to see the values of all the variables that are in scope in order to inspect the state. The debugger is your best friend. You should learn everything that it can do for you. For example, in the Breakpoints view's view toolbar you can "Add Exception Breakpoint", i.e., the little J! icon. Then you can have your application stop whenever an exception of the specific type is thrown; that makes it easy for example to track down NullPointerExceptions. And of course the toolbar in the Debug perspective has buttons for continue, step over, and step into so you can walk through the logic. Also very useful is the Drop To Frame button; this lets you "restart" a method back to its start, in case you've stepped past the logic you want to inspect. Also, the debugger supports hot replace, i.e., you can modify a method and when you save, the running process is updated to use that new logic, making it easier to fix problems on the fly without relaunching the whole application. Note too that breakpoints can have conditions on them, so that your application will only stop at the breakpoint when the condition expression evaluates to true; very useful when your breakpoint will be hit a thousand times but your only interested in one particular case; you can even use breakpoint conditions to add print statements "System.out.println(x); return false;" to do logging. As I said, the debugger is really your best friend.

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:help me , want to add "system.out.printbytephoto" to java IDE.
Next Topic:Webapp coonector in jetty 9
Goto Forum:
  


Current Time: Tue Apr 23 12:38:31 GMT 2024

Powered by FUDForum. Page generated in 0.08110 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top