Partager via


Set Breakpoints (Compact 7)

3/12/2014

You can set a breakpoint by using a source window, the New Breakpoint window, the Call Stack window, and the Disassembly window.

Note

When you set a breakpoint in source code, the color of the breakpoint glyph indicates the state of the breakpoint. If you set a breakpoint and its glyph is a hollow circle with a caution triangle, the breakpoint is not yet instantiated. When the module is loaded into memory, the breakpoint glyph will display as a solid red circle. For more information about breakpoint states, see Breakpoints.

To set a breakpoint by using a source window

  1. In a source window, move the cursor to the line where you want execution to break. If the statement spans two or more lines, move the cursor to the last line of the statement.

    Note

    To set a breakpoint at the beginning of a function, position the cursor at the source code line that contains the opening brace of the function.

  2. Right-click the source code line, click Breakpoint, and then click Toggle Breakpoint.

    or

    Click the line, and then press F9.

To set a breakpoint by using the New Breakpoint window

  1. Go to the New Breakpoint window by using one of two methods:

    • On the Debug menu, click New Breakpoint, and then click Break at Function.
    • On the Debug menu, click Windows, click Breakpoints, and then click the New Breakpoint button, which is the leftmost button and shows a hand icon.
  2. In the New Breakpoint window, on the Location tab, in the Break at box, add a breakpoint by typing the following syntax:

    {,,modulename} function_name
    

    You can create this syntax for EXEs and DLLs. For example:

    {,,shell.exe} SHGetFileInfo
    {,,pm.dll} PlatformResumeSystem
    

    Note

    Be sure to use the exact syntax shown in this step, including the braces and the two commas.

  3. Click OK.

To set a breakpoint by using the Call Stack window

  1. When you are debugging and in break mode, on the Debug menu, click Windows, and then click Call Stack.

  2. In the Call Stack window, right-click a line, and then click Insert/Remove Breakpoint.

    A red circle appears in the left margin next to the function name, indicating that the breakpoint is set.

    Note

    The breakpoint is set at the next executable instruction in the function call.

To set a breakpoint by using the Disassembly window

  1. When you are debugging and in break mode, on the Debug menu, click Windows, and then click Disassembly.

  2. In the Disassembly window, right-click a line, and then click Toggle Breakpoint.

    A red circle appears in the left margin next to the line, indicating that the breakpoint is set.

See Also

Concepts

Breakpoints
Kernel Debugger
Debugging

Other Resources

Windows Embedded Compact 7