Using C-SPY macros
For more examples using C-SPY macros, see:
The tutorial about simulating an interrupt, which you can find in the Information Center
Registering C-SPY macros—an overview
C-SPY must know that you intend to use your defined macro functions, and therefore you must register your macros. There are various ways to register macro functions:
You can register macro functions during the C-SPY startup sequence, see Registering and executing using setup macros and setup files.
You can register macros interactively in the Macro Registration window, see Macro Registration window. Registered macros appear in the Debugger Macros window, see Debugger Macros window.
You can register a file containing macro function definitions, using the system macro __
registerMacroFile. This means that you can dynamically select which macro files to register, depending on the runtime conditions. Using the system macro also lets you register multiple files at the same moment. For information about the system macro, see __registerMacroFile.
Which method you choose depends on which level of interaction or automation you want, and depending on at which stage you want to register your macro.
Executing C-SPY macros—an overview
There are various ways to execute macro functions:
You can execute macro functions during the C-SPY startup sequence and at other predefined stages during the debug session by defining setup macro functions in a setup macro file, see Registering and executing using setup macros and setup files.
The Quick Watch window lets you evaluate expressions, and can thus be used for executing macro functions. For an example, see Executing macros using Quick Watch.
The Macro Quicklaunch window is similar to the Quick Watch window, but is more specifically designed for C-SPY macros. See Macro Quicklaunch window.
A macro can be connected to a breakpoint; when the breakpoint is triggered the macro is executed. For an example, see Executing a macro by connecting it to a breakpoint.
Which method you choose depends on which level of interaction or automation you want, and depending on at which stage you want to execute your macro.