The Call Stack window displays the list of function calls (stack frames) that were active when program execution halted. When execution halts, SEGGER Embedded Studio populates the call-stack window from the active (currently executing) task. For simple, single-threaded applications not using the SEGGER Embedded Studio tasking library, there is only a single task; but for multi-tasking programs that use the SEGGER Embedded Studio Tasking Library, there may be any number of tasks. SEGGER Embedded Studio updates the Call Stack window when you change the active task in the Threads window.

The Call Stack window has a toolbar and a main call-stack display.

Button Description
Move the insertion point to where the call was made to the selected frame.
Set the debugger context to the selected stack frame.
Move the debugger context down one stack to the called function.
Move the debugger context up one stack to the calling function.
Select the fields to display for each entry in the call stack.
Set the debugger context to the most recent stack frame and move the insertion point to the currently executing statement.

The main part of the Call Stack window displays each unfinished function call (active stack frame) at the point when program execution halted. The most recent stack frame is displayed at the bottom of the list and the oldest is displayed at the top of the list.

SEGGER Embedded Studio displays these icons to the left of each function name:

Icon Description
Indicates the stack frame of the current task.
Indicates the stack frame selected for the debugger context.
Indicates that a breakpoint is active and when the function returns to its caller.

These icons can be overlaid to show, for instance, the debugger context and a breakpoint on the same stack frame.

Showing the call-stack window

To activate the Call Stack window:

Configuring the call-stack window

Each entry in the Call Stack window displays the function name and, additionally, parameter names, types, and values. You can configure the Call Stack window to show varying amounts of information for each stack frame. By default, SEGGER Embedded Studio displays all information.

To show or hide a field:
  1. On the Call Stack toolbar, click the Options button on the far right.
  2. Select the fields to show, and deselect the ones that should be hidden.

Changing the debugger context

You can select the stack frame for the debugger context from the Call Stack window.

To move the debugger context to a specific stack frame:

—or—

—or—

The debugger moves the insertion point to the statement where the call was made. If there is no debug information for the statement at the call location, SEGGER Embedded Studio opens a disassembly window at the instruction.

To move the debugger context up one stack frame:

—or—

—or—

The debugger moves the insertion point to the statement where the call was made. If there is no debug information for the statement at the call location, SEGGER Embedded Studio opens a disassembly window at the instruction.

To move the debugger context down one stack frame:

—or—

—or—

The debugger moves the insertion point to the statement where the call was made. If there is no debug information for the statement at the call location, SEGGER Embedded Studio opens a disassembly window at the instruction.

Setting a breakpoint on a return to a function

To set a breakpoint on return to a function:

—or—

—or—