15.04.2018 Views

programming-for-dummies

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Fixing a Program with a Debugger 99<br />

A breakpoint lets you tell the computer, “Skip from the beginning of the program<br />

to the breakpoint and then step through the rest of the program line by<br />

line.” Figure 4-6 shows how you can highlight a line with a breakpoint. That<br />

way your program runs from the beginning to the first breakpoint. After your<br />

program stops at a breakpoint, you can step through the rest of your program<br />

line by line.<br />

Book I<br />

Chapter 4<br />

Programming Tools<br />

Figure 4-6:<br />

Breakpoints<br />

let you skip<br />

over parts of<br />

your<br />

program<br />

that you<br />

don’t want<br />

to examine<br />

line by line.<br />

Over and out<br />

The stepping over and stepping out commands are used to debug a large<br />

program that consists of multiple subprograms. Normally, stepping would<br />

<strong>for</strong>ce you to examine every subprogram, line by line. However, what if you<br />

know the problem isn’t in a specific subprogram?<br />

By using the step over and step out commands, you can avoid stepping<br />

through lines of code stored in a subprogram.<br />

Step over<br />

To avoid stepping through every subprogram, debuggers let you use the<br />

step over command. This tells the computer, “See that entire subprogram?<br />

Treat it as a single command and don’t bother stepping through it line by<br />

line.” Figure 4-7 shows how the step over command works.<br />

The step over command lets you completely skip over any lines of code<br />

stored inside of a subprogram.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!