2.3.158. WHERE

Displays a call stack.

Syntax

WHERE [number_of_levels]

where:

number_of_levels

Specifies the number of levels you want to examine. If you do not supply this parameter, all levels are displayed.

Description

The WHERE command displays a call stack. This shows you the function that you are in, and the function that called that, and the function that called that, until the debugger cannot continue. A call stack is not a history of every function call in the life of the process.

The call stack requires debug information for every procedure called. If debug information is not available, the call stack stops. The call stack might also stop prematurely because the stack frames read by the debugger do not conform to the expected structure, for example if memory corruption has occurred, or if a scheduler has created new stack frames.

Examples

The following example shows how to use WHERE:

> where
#0: (0x24000148) DHRY_2_1\\Proc_7 Line 79. File='C:\Program
Files\ARM\RVDS\Examples\...\...\...\...\main\dhrystone\dhry_2.c'
#1: (0x24000674) DHRY_1_1\\main Line 164. File='C:\Program
Files\ARM\RVDS\Examples\...\...\...\...\main\dhrystone\dhry_1.c'

This shows a request for a full stack trace of the dhrystone program. The program was stopped at line 79 of procedure Proc_7(). The call stack tells you that this call of Proc_7() was made by code at line 164 of main().

The call stack does not tell you what called main(). Normally, there is bootstrap code in __main() that calls main, but because this code is not normally compiled with debug symbols included, this procedure is not shown in the call stack.

> where 1
#0: (0x240002B8) DHRY_1_1\\Proc_3 Line 355. File='C:\Program
Files\ARM\RVDS\Examples\...\...\...\...\main\dhrystone\dhry_1.c'

This shows a request for a single level stack trace of the dhrystone program. The program was stopped at line 355 of procedure Proc_3(). Compare this to the output of CONTEXT at the same location:

At the PC: (0x240002B8): DHRY_1_1\Proc_3 Line 355

See also

Copyright © 2002-2011 ARM. All rights reserved.ARM DUI 0175N
Non-ConfidentialID052111