debuggercdi/com.nokia.carbide.cpp.debug.crashdebugger/html/DebuggingInformation/CrashDebuggerCallStack.guide02.html
author timkelly
Tue, 04 May 2010 09:39:10 -0500
branchRCL_2_4
changeset 1325 98aebbb322f3
parent 990 5d016a880824
permissions -rw-r--r--
Fix bug 11210. NPEs when editing SBSv2 config tab data on old SBSv2 build configs. Now allows saving SBSv2 variant data for old SBSv2 configs (i.e. before we display the build alias in the config name)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
990
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     2
	"http://www.w3.org/TR/html4/loose.dtd">
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     3
	<html><head>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     4
	<title>Examining the call stack in Debugging information</title>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     5
	<link href="sysdoc-eclipse.css" type="text/css" rel="stylesheet" >
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     6
	<link href="sysdoc-eclipse.css" type="text/css" rel="stylesheet" >
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     7
	<link href="../../book.css" type="text/css" rel="stylesheet" >
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     8
<div class="Head1">
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     9
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    10
<h2>General Points</h2>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    11
</div>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    12
<div>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    13
<p>Tracing the call stack is an advanced use of the
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    14
<a href="CrashDebugger_cmd_m.guide.html" title="The debug monitor and command syntax / m - do a memory dump">m</a> command that
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    15
allows you to <a href="CrashDebuggerExaminingMemory.guide.html" title="Examining memory">examine memory</a>.</p>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    16
<p>Every time a function is called, the return address is
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    17
automatically saved into register R14 (Link Register). In addition
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    18
to this the return address is generally pushed onto the call stack; it is
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    19
always pushed in debug builds but the push operation is sometimes optimised out
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    20
in release builds. This allows you to trace back through the value of
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    21
R14 and these saved addresses to see the sequence of function
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    22
calls. Unfortunately this is quite tedious to do because the stack is also used
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    23
for automatic variables and other data. You need to work out which values on
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    24
the stack refer to return addresses. </p>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    25
<p>When you are debugging only ROM-based code, it is relatively easy
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    26
to identify the pushed return addresses because all code addresses will be in
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    27
the ROM range: 0xF800000 to 0xFFEFFFFF for the
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    28
<a href="CrashDebuggerMemoryMap.guide.html" title="Symbian OS memory map / Moving model">moving model</a>. However,
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    29
there is also data in the ROM, which means that an address on the stack which
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    30
is in the ROM range could point to data instead of code. If you want to trace
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    31
applications loaded into RAM, i.e. anything not run from drive Z:, then stack
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    32
tracing is more difficult because the code can move about and RAM-loaded code
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    33
is given an address assigned at load time.</p>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    34
<p>Note that <a href="CrashDebuggerUsingMAKSYM-Ref.guide.html">using the MAKSYM tool</a> is essential for tracing back through the stack.</p>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    35
</div>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    36
<h5>Related tasks</h5>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    37
<ul>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    38
  <li><a href="CrashDebuggerCallStack.guide03.html">Finding the Stack</a></li>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    39
  <li><a href="CrashDebuggerCallStack.guide04.html">Tracing through the Call Stack Heuristically</a></li>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    40
  <li><a href="CrashDebuggerCallStack.guide05.html">Walking through the Call Stack</a></li>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    41
</ul>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    42
<div id="footer">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    43
	   </body>
5d016a880824 revised some text and copyright date
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    44
	   </html>
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    45