IAR C-SPY

Introduction to the THREADX Debugger Plugin for the IAR Embedded Workbench C-SPY Debugger

The advanced, best-of-class THREADX RTOS awareness plugin for C-SPY is delivered and installed as a part of the ARM® IAR Embedded Workbench IDE. The plugin facilitates rapid understanding of what is happening in the THREADX application, including information about all application threads, execution profile information, performance metrics, and all THREADX objects created by the application. In addition, the advanced THREADX plugin for C-SPY provides thread-specific breakpoint and debug services.

ThreadX Debugger Plugin for the IAR Embedded Workbench C-SPY Debugger

To be able to use the plugin, you must start the ARM® IAR Embedded Workbench and choose Project Options. Select the C-SPY Debugger category, select the Plugins tab and then check the THREADX box. Click OK.

Introduction to the THREADX Plugin

The plugin introduces the following elements in the C-SPY user interface. In the View menu, it installs a number of entries corresponding to the various types of THREADX-specific windows that can be opened by the plugin. In the Breakpoints dialog box, available by choosing Edit Breakpoints, a new option is enabled for making standard breakpoints thread-specific.

Windows

The RTOS plugin introduces fourteen new debugger windows. Right-clicking in most of the windows opens a context menu where the display format can be set to hexadecimal or decimal. Selecting the Color Changes command highlights all window updates.

The Thread List Window

This is arguably the single most important window of the RTOS plugin.

This window shows a list of all threads created by the current application (by calls to tx_thread_create) and some items pertaining to their current state. The currently active thread is indicated by the color green (and typically by a state of Running in the State column). The threads are ordered in the display in the same order they were created.

You can examine a particular thread by double-clicking on the corresponding row in the window. All debugger windows (Watch, Locals, Register, Call Stack, Source, Disassembly, etc.) will then show the state of the program from the point of view of the thread in question. A thread selected in this way is indicated in the Thread window by a larger black font.

The last row of the Thread window is always No Task. Double-clicking on this row makes the debugger show the state of the program as it currently is (that is, as it would be shown without an RTOS plugin), in effect always following the active task.

Note that if a task has been selected by double-clicking, the debugger will show the state of that particular task until another task (or No Task) is selected, even if execution is performed by or in another task. For example, if task A is currently active (Running) and you double-click on task B, which is READY, you will see information about the suspended task B.

Inspector Windows

The thirteen other windows display RTOS information of various types. These windows are formatted, passive displays of various internal RTOS data structures and information.

Execution Profile

When enabled by the application in the THREADX project settings (see Express Logic’s Execution Profile Kit for details), the C-SPY debugger presents the Execution Profile information collected by THREADX during execution. To display the Execution Profile information, simply select THREADX Execution Profile from the main menu and you will see information similar to the following:

Execution Profile information provides an overview of Idle, Interrupt and Overall Thread execution, as well as execution of each specific thread.

Thread Performance Metrics

When enabled by the application in the THREADX project settings, tx_port, or tx_user.h (please refer to the THREADX_User_Guide.pdf for details), the C-SPY debugger presents the Thread Performance Metrics collected by THREADX. To display the Thread Performance Metrics, simply select THREADX Thread Performance Metrics from the main menu and you will see information similar to the following:

Communication Performance Metrics

When enabled by the application in the THREADX project settings, tx_port, or tx_user.h (please refer to the THREADX_User_Guide.pdf for details), the C-SPY debugger presents the Communication Performance Metrics collected by THREADX. To display the Communication Performance Metrics, simply select THREADX Communication Performance Metrics from the main menu and you will see information similar to the following:

Synchronization Performance Metrics

When enabled by the application in the THREADX project settings, tx_port, or tx_user.h (please refer to the THREADX_User_Guide.pdf for details), the C-SPY debugger presents the Synchronization Performance Metrics collected by THREADX. To display the Synchronization Performance Metrics, simply select THREADX Synchronization Performance Metrics from the main menu and you will see information similar to the following:

Timer Performance Metrics

When enabled by the application in the THREADX project settings, tx_port, or tx_user.h (please refer to the THREADX_User_Guide.pdf for details), the C-SPY debugger presents the Timer Performance Metrics collected by THREADX. To display the Timer Performance Metrics, simply select THREADX Timer Performance Metrics from the main menu and you will see information similar to the following:

Memory Performance Metrics

When enabled by the application in the THREADX project settings, tx_port, or tx_user.h (please refer to the THREADX_User_Guide.pdf for details), the C-SPY debugger presents the Memory Performance Metrics collected by THREADX. To display the Memory Performance Metrics, simply select THREADX Memory Performance Metrics from the main menu and you will see information similar to the following:

Timers

When selected via THREADX Timers from the main menu, the C-SPY debugger presents information about the current status of all timers created by the application in a format similar to the following:

Queues

When selected via THREADX Queues from the main menu, the C-SPY debugger presents information about the current status of all message queues created by the application in a format similar to the following:

Semaphores

When selected via THREADX Semaphores from the main menu, the C-SPY debugger presents information about the current status of all semaphores created by the application in a format similar to the following:

Mutexes

When selected via THREADX Mutexes from the main menu, the C-SPY debugger presents information about the current status of all mutexes created by the application in a format similar to the following:

Event Flag Groups

When selected via THREADX Event Flag Groups from the main menu, the C-SPY debugger presents information about the current status of all event flag groups created by the application in a format similar to the following:

Byte Pools

When selected via THREADX Byte Pools from the main menu, the C-SPY debugger presents information about the current status of all byte pools created by the application in a format similar to the following:

Block Pools

When selected via THREADX Block Pools from the main menu, the C-SPY debugger presents information about the current status of all block pools created by the application in a format similar to the following:

Breakpoints

The presence of the RTOS plugin enables a task condition for all standard breakpoints, as shown below:

Clicking the Task button brings up the following dialog box:

You can make a breakpoint thread-specific by clicking the check box and selecting a task from the drop-down list. Note: The drop-down list only shows threads which have been created at the time. Note also: If the code at the breakpoint is only ever executed by one specific thread, there is no need to make the breakpoint thread-specific.

Subscribe to our news