Products & Services Solutions Academia Support User Community Company

Learn more about SimEvents   

Debugger Efficiency Tips

Executing Commands Automatically When the Debugger Starts

If you want to execute one or more commands in the debugger immediately after initializing the model, you can include those commands when you invoke sedebug. You might find executing commands automatically to be useful for setting the same breakpoints or detail settings across multiple debugging sessions, or helping someone reproduce a problem that you are seeing in a model.

To start a debugger session that executes commands automatically:

  1. Create an empty options structure using the se_getdbopts function.

    opts_struct = se_getdbopts;
  2. Define the StartFcn field of the options structure as a cell array of strings, where each string is an individual command that you want to execute after initializing the model. Here is an example:

    opts_struct.StartFcn = {'detail(''cal'',1)', 'tbreak 5'};
  3. Start a debugger session using the sedebug function with the options structure as the second input argument. Here is an example:

    sedebug('sedemo_event_priorities', opts_struct)
  4. End the debugger session. At the sedebug>> prompt, enter:

    sedb.quit

For an example, see the se_getdbopts reference page.

Tips for Creating a StartFcn Cell Array

Creating Shortcuts for Debugger Commands

If you use a particular debugger command frequently, such as step or step over, a shortcut you can click might provide an efficient way to issue the command repeatedly. To learn about shortcuts, see Running Frequently Used Statement Groups with MATLAB Shortcuts.

  


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-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS