Debugging
Importance of debugging
Debugging is a great way to understand the application flow during the application penetration test and monitor the input we provide in order to reach our objectives.
Sample code
Below we can find sample Java program which takes the input from the user and plays with him in guessing game.
User provide the number and program tells him is it too low or to high until he wins.
Debugging
In order to debug the application we click the Run and Debug button at the top left side of the screen.
In order to pause the program on the chosen line we have to select it before clicking the button. In the screenshot below breakpoints are set to line 12 and 13.
After setting the breakpoints application runs and stops at the line 12. In order to go to the next breakpoint we press "Step Over" button at the top of the screen.
Due to debugging we are able to see the values of the variables we could not see otherwise. For example when application stops at breakpoint set at line 13 at the left side of the screen we can see the local variables. One of them is randomNumber which is visible only during debugging. In this case debugging allows us to see the number which is required to win and complete the game.
Remote Debugging
Remote Debugging is a funcionality which enables us to debug a process running on a remote system.
Last updated