@@ -21,6 +21,8 @@ Once the breakpoints are set, the debugger can be run by selecting whatever it i
Now that we have run the debugger and stopped at the breakpoint, a lot of information is given in the Debug window.
#### * Variables and Values
The primary benefit to using the debugger is being able to see every variable and its currently assigned value. These are displayed in the main window. As the program is stepped through, these values will update, allowing the user to easily see when a value is assigned incorrectly.
It is possible to manually set the value of a variable by left clicking on it and selecting "Set Value...".
#### * Step Over
If you would like to skip over a function, use the Step Over button. This causes the debugger to run until the function is returned from, at which point it will pause again, giving control back to the user.
#### * Step Into
...
...
@@ -36,4 +38,28 @@ By pressing this button, all breakpoints will be "muted". A muted breakpoint rem
<palign="center">
<imgsrc="https://i.imgur.com/l480710.png"/>
</p>
\ No newline at end of file
</p>
## Breakpoint Types
There are several types of breakpoints, but the following tend to be the most frequently used.
### Line Breakpoint
The basic breakpoint. This must be set on an executable line of code (will not suspend the program if set on a blank line, for instance). This simply suspends the program, handing control over walking through the program over to the user.
### Method Breakpoint
This is created identically to how the Link Breakpoint is created. This is useful for checking that a method is being given the correct info, and is returning the correct info.
### Conditional Breakpoint
A basic breakpoint has the option to only suspend the program when a specific condition is met. This is extremely useful if, for example, there is a loop, but you only want to suspend the program on the nth iteration. A condition can be set that the breakpoint only suspends the program when the iterator variable equals n. While not exactly necessary in most cases, it does save a lot of extra clicking.
A basic example for how to set a condition is shown below.
<palign="center">
<imgsrc="https://i.imgur.com/YvFQZpx.gif"/>
</p>
### Logging Breakpoint
A basic breakpoint has the option to log the Stack trace (or simply state that it was reached). This is similar to using a print statement, except it is much easier to guarantee its removal once it is no longer needed (using the menu described later). Additionally, it makes it much easier to work backwards, as the exact route to reach that point has been printed.
Setting these options can be done by left clicking the breakpoint and doing the following:
<palign="center">
<imgsrc="https://i.imgur.com/eHAlcZh.gif"/>
</p>
### Field Watchpoint
Created by setting a breakpoint on a line that declares a variable/field. This suspends the program anytime the variable declared on that line is touched. Useful for finding where the value is being set incorrectly, without having to step through large chunks of code by hand.