Skip to Main Content Skip to Search
Product Documentation

Using Breakpoints During Debugging

Running the Simulation Until the Next Breakpoint

By default, the debugger has a special built-in breakpoint at the end of the simulation. You can define your own breakpoints, as described in Defining a Breakpoint. To proceed in the simulation until the debugger reaches the next breakpoint, at the sedebug>> prompt, enter this command:

cont

You cannot set breakpoints for Simulink controlled block. Instead, set the breakpoint in the SimEvents block that initiates the signal execution.

Point at Which the Debugger Suspends the Simulation

When you enter a cont command, the debugger proceeds in the simulation until it reaches the first point in the simulation that meets one of these criteria:

The debugger reaches a given timed or event breakpoint zero or one time during the simulation. The debugger can reach a given block or entity breakpoint an arbitrary number of times during the simulation.

Unless all breakpoints are timed breakpoints, you might not be able to predict which breakpoint the debugger reaches next. Even though events have scheduled times, the debugger might reach an event breakpoint upon the cancelation of an event. You might not be able to predict the cancelation.

Ignoring or Removing Breakpoints

The table describes options for preventing the debugger from observing a particular breakpoint.

Treatment of BreakpointsAt sedebug>> Prompt, Enter...Result
Ignore a particular breakpoint while keeping it in the list of breakpoints and being able to reinstate it easilydisable b1, where b1 is the breakpoint identifierThe list of breakpoints indicates the breakpoint as disabled and the debugger does not observe the breakpoint. You can reverse this operation using enable b1.
Ignore a particular breakpoint without keeping it in the list of breakpoints and without being able to reinstate it easilybdelete b1, where b1 is the breakpoint identifierThe breakpoint no longer appears in the list of breakpoints, so the debugger does not observe it.
Ignore all timed and event breakpoints and run the simulation until the endruntoendThe simulation runs to completion and the debugger session ends.

To view breakpoint identifiers, at the sedebug>> prompt, enter breakpoints.

Enabling a Disabled Breakpoint

To reinstate a breakpoint that you previously disabled:

  1. View breakpoint identifiers. At the sedebug>> prompt, enter this command:

    breakpoints
  2. Enter a command like the following, replacing b1 with the identifier of the breakpoint that you want to reinstate:

    enable b1

You might want to disable and enable a breakpoint to focus on behavior of a block during a particular time interval. A block breakpoint helps you focus on that block. Disabling the block breakpoint, when the simulation time is outside the time interval of interest, helps you focus on only those periods that are relevant to you.

  


Free Discrete Event Simulation Technical Kit

Model electronic system architectures, process flows, and logistics as queuing systems or agent-based systems.

Get free kit

Trials Available

Try the latest version of discrete-event simulation products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS