Advertisement
English transcript
Together we walk through how to add a breakpoint for the increment method and
how to trigger that breakpoint.
Hopefully you were able to reproduce that on your computer.
For the decrement method, if we want to add a breakpoint,
I can just click here on line 33 to add a breakpoint.
Then I click on this green bug icon to launch the app in debug mode.
I'll see the Waiting For Debugger message,
and then it will go away shortly.
To trigger this breakpoint, I'm going to click on the minus button.
The app pauses at this line, and
I know that because the quantity value hasn't updated to one yet.
I see the list of variables down here, but
the quantity variable hasn't shown up yet.
I click on this button to step over this line to go to the next line.
Then I see that the quantity variable shows up, and the current value is one.
At this point, I can step over this line of code to the end of the method and
then just resume execution of the app.
Because I have two breakpoints in my app, if I click on the plus button,
it triggers the breakpoint in the increment method.
Then I can hit play to resume.
If I click on the minus button, it triggers a breakpoint in the decrement
method, and I can hit play to resume.
If I don't want the app to stop at either of those breakpoints,
I can just hit stop, and it detaches the debugger.
Then the app just runs as normal where it updates the screen immediately when I
click on the button.
how to trigger that breakpoint.
Hopefully you were able to reproduce that on your computer.
For the decrement method, if we want to add a breakpoint,
I can just click here on line 33 to add a breakpoint.
Then I click on this green bug icon to launch the app in debug mode.
I'll see the Waiting For Debugger message,
and then it will go away shortly.
To trigger this breakpoint, I'm going to click on the minus button.
The app pauses at this line, and
I know that because the quantity value hasn't updated to one yet.
I see the list of variables down here, but
the quantity variable hasn't shown up yet.
I click on this button to step over this line to go to the next line.
Then I see that the quantity variable shows up, and the current value is one.
At this point, I can step over this line of code to the end of the method and
then just resume execution of the app.
Because I have two breakpoints in my app, if I click on the plus button,
it triggers the breakpoint in the increment method.
Then I can hit play to resume.
If I click on the minus button, it triggers a breakpoint in the decrement
method, and I can hit play to resume.
If I don't want the app to stop at either of those breakpoints,
I can just hit stop, and it detaches the debugger.
Then the app just runs as normal where it updates the screen immediately when I
click on the button.