debuggercdi/com.nokia.carbide.cpp.debug.crashdebugger/html/DebuggingInformation/CrashDebuggerCallStack.guide02.html
author fturovic <frank.turovich@nokia.com>
Thu, 02 Apr 2009 15:23:07 -0500
branchRCL_2_0
changeset 25 1f39fea73e7e
parent 2 d760517a8095
child 990 5d016a880824
child 1024 48b401835d0a
permissions -rw-r--r--
updated splash for 2.0.4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
cawthron
parents:
diff changeset
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
cawthron
parents:
diff changeset
     2
	"http://www.w3.org/TR/html4/loose.dtd">
cawthron
parents:
diff changeset
     3
	<html><head>
cawthron
parents:
diff changeset
     4
	<title>Examining the call stack in Debugging information</title>
cawthron
parents:
diff changeset
     5
	<link href="sysdoc-eclipse.css" type="text/css" rel="stylesheet" >
cawthron
parents:
diff changeset
     6
	<link href="sysdoc-eclipse.css" type="text/css" rel="stylesheet" >
cawthron
parents:
diff changeset
     7
	<link href="../../book.css" type="text/css" rel="stylesheet" >
cawthron
parents:
diff changeset
     8
<div class="Head1">
cawthron
parents:
diff changeset
     9
cawthron
parents:
diff changeset
    10
<h2>General Points</h2>
cawthron
parents:
diff changeset
    11
</div>
cawthron
parents:
diff changeset
    12
<div>
cawthron
parents:
diff changeset
    13
<p>Tracing the call stack is an advanced use of the
cawthron
parents:
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
cawthron
parents:
diff changeset
    15
allows you to <a href="CrashDebuggerExaminingMemory.guide.html" title="Examining memory">examine memory</a>.</p>
cawthron
parents:
diff changeset
    16
<p>Every time a function is called, the return address is
cawthron
parents:
diff changeset
    17
automatically saved into register R14 (Link Register). In addition
cawthron
parents:
diff changeset
    18
to this the return address is generally pushed onto the call stack; it is
cawthron
parents:
diff changeset
    19
always pushed in debug builds but the push operation is sometimes optimised out
cawthron
parents:
diff changeset
    20
in release builds. This allows you to trace back through the value of
cawthron
parents:
diff changeset
    21
R14 and these saved addresses to see the sequence of function
cawthron
parents:
diff changeset
    22
calls. Unfortunately this is quite tedious to do because the stack is also used
cawthron
parents:
diff changeset
    23
for automatic variables and other data. You need to work out which values on
cawthron
parents:
diff changeset
    24
the stack refer to return addresses. </p>
cawthron
parents:
diff changeset
    25
<p>When you are debugging only ROM-based code, it is relatively easy
cawthron
parents:
diff changeset
    26
to identify the pushed return addresses because all code addresses will be in
cawthron
parents:
diff changeset
    27
the ROM range: 0xF800000 to 0xFFEFFFFF for the
cawthron
parents:
diff changeset
    28
<a href="CrashDebuggerMemoryMap.guide.html" title="Symbian OS memory map / Moving model">moving model</a>. However,
cawthron
parents:
diff changeset
    29
there is also data in the ROM, which means that an address on the stack which
cawthron
parents:
diff changeset
    30
is in the ROM range could point to data instead of code. If you want to trace
cawthron
parents:
diff changeset
    31
applications loaded into RAM, i.e. anything not run from drive Z:, then stack
cawthron
parents:
diff changeset
    32
tracing is more difficult because the code can move about and RAM-loaded code
cawthron
parents:
diff changeset
    33
is given an address assigned at load time.</p>
cawthron
parents:
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>
cawthron
parents:
diff changeset
    35
</div>
cawthron
parents:
diff changeset
    36
<h5>Related tasks</h5>
cawthron
parents:
diff changeset
    37
<ul>
cawthron
parents:
diff changeset
    38
  <li><a href="CrashDebuggerCallStack.guide03.html">Finding the Stack</a></li>
cawthron
parents:
diff changeset
    39
  <li><a href="CrashDebuggerCallStack.guide04.html">Tracing through the Call Stack Heuristically</a></li>
cawthron
parents:
diff changeset
    40
  <li><a href="CrashDebuggerCallStack.guide05.html">Walking through the Call Stack</a></li>
cawthron
parents:
diff changeset
    41
</ul>
cawthron
parents:
diff changeset
    42
<div id="footer">Copyright &copy; 2009 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>
cawthron
parents:
diff changeset
    43
	   </body>
cawthron
parents:
diff changeset
    44
	   </html>
cawthron
parents:
diff changeset
    45