Update Debugging In Intellij authored by Gregory Neibert's avatar Gregory Neibert
...@@ -51,15 +51,19 @@ This is created identically to how the Link Breakpoint is created. This is usefu ...@@ -51,15 +51,19 @@ This is created identically to how the Link Breakpoint is created. This is usefu
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 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. A basic example for how to set a condition is shown below.
<p align="center"> <p align="center">
<img src="https://i.imgur.com/YvFQZpx.gif"/> <img src="https://i.imgur.com/YvFQZpx.gif"/>
</p> </p>
### Logging Breakpoint ### 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. 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: Setting these options can be done by left clicking the breakpoint and doing the following:
<p align="center"> <p align="center">
<img src="https://i.imgur.com/eHAlcZh.gif"/> <img src="https://i.imgur.com/eHAlcZh.gif"/>
</p> </p>
### Field Watchpoint ### 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. 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.
\ No newline at end of file