Skip to main content

IAR Embedded Workbench for RISC-V 3.40

Using C-SPY macros

In this section:

For more examples using C-SPY macros, see:

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:

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.