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

## Call Stack user interface

The Call Stack window is divided into a tool bar and the main breakpoint display.

###### Call Stack tool bar

Button | Description
| Moves the cursor to where the call to the selected frame was made.
| Sets the debugger context to the selected stack frame.
| Moves the debugger context down one stack to the called function
| Moves the debugger context up one stack to the calling function
| Selects the fields to display for each entry in the call stack.
| Sets the debugger context to the most recent stack frame and moves the cursor to the currently executing statement.

###### Call Stack display

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

CrossStudio 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 display the Call Stack window if it is hidden, do one of the following:

- From the View menu, click Other Windows then Call Stack.

—or—

- From the Debug menu, click Debug Windows then Call Stack.

—or—

- Type Ctrl+Alt+S.

—or—

- On the Debug tool bar, click the Call Stack icon.

—or—

- Right click the tool bar area to display the View menu.
- From the popup menu, click Other Windows then Breakpoints.

## 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 to display varying amounts of information for each stack frame. By default, CrossStudio displays all information.

###### Displaying or hiding parameter names

To display or hide the name of each parameter in the call stack, do the following:

- On the Call Stack tool bar, click the Fields button.
- From the dropdown menu, check or uncheck Parameter Names.

###### Displaying or hiding parameter values

To display or hide the value of each parameter in the call stack, do the following

- On the Call Stack tool bar, click the Fields button.
- From the dropdown menu, check or uncheck Parameter Valuev.

###### Displaying or hiding parameter types

To display or hide the type of each parameter in the call stack, do the following:

- On the Call Stack tool bar, click the Fields button.
- From the dropdown menu, check or uncheck Parameter Types.

###### Displaying or hiding file names and source line numbers

To display or hide the file name and source line number columns of each frame in the call stack, do the following:

- On the Call Stack tool bar, click the Fields button.
- From the dropdown menu, check or uncheck Call Sourrce Location.

###### Displaying or hiding call addresses

To display or hide the call address of each frame in the call stack, do the following:

- On the Call Stack tool bar, click the Fields button.
- From the dropdown menu, check or uncheck Call Address.

## Changing the debugger context

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

###### Selecting a specific stack frame

To move the debugger context to a specific stack frame, do one of the following:

- In the Call Stack window, double click the stack frame to move to.

—or—

- In the Call Stack window, click the stack frame to move to.
- On the Call Stack window's tool bar, click the Switch To Frame button.

—or—

- In the Call Stack window, right click the stack frame to move to.
- From the popup menu, select Switch To Frame.

The debugger moves the cursor to the statement where the call was made. If there is no debug information for the statement at the call location, CrossStudio opens a disassembly window at the instruction.

###### Moving up one stack frame

To move the debugger context up one stack frame to the calling function, do one of the following:

- On the Call Stack window's tool bar, click the Up One Stack Frame button.

—or—

- On the Debug Location tool bar, click the Up One Stack Frame button.

—or—

- Type Alt+-.

The debugger moves the cursor to the statement where the call was made. If there is no debug information for the statement at the call location, CrossStudio opens a disassembly window at the instruction.

###### Moving down one stack frame

To move the debugger context down one stack frame to the called function, do one of the following:

- On the Call Stack window's tool bar, click the Down One Stack Frame button.

—or—

- On the Debug Location tool bar, click the Down One Stack Frame button.

—or—

- Type Alt++.

The debugger moves the cursor to the statement where the call was made. If there is no debug information for the statement at the call location, CrossStudio 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, do one of the following:

- In the Call Stack window, click the stack frame on the function to stop at when it is returned to.
- From the Build tool bar, click the Toggle Breakpoint button.

—or—

- In the Call Stack window, click the stack frame on the function to stop at when it is returned to.
- Type F9.

—or—

- In the Call Stack window, right click the function to stop at when it is returned to.
- From the popup menu, click Toggle Breakpoint.