debuggercdi/com.nokia.carbide.cpp.debug.crashdebugger/html/DebuggingInformation/CrashDebuggerExaminingMemory.guide02.html
Add S60 5.2 support.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<title>Dumping the Contents of Classes</title>
<link href="sysdoc-eclipse.css" type="text/css" rel="stylesheet" media="screen">
<link href="sysdoc-eclipse.css" type="text/css" rel="stylesheet" media="print">
<link href="../../book.css" type="text/css" rel="stylesheet" >
<div class="Head1">
<h2>Dumping the Contents of Classes</h2>
</div>
<div>
<p>You can use the
<a href="CrashDebugger_cmd_m.guide.html" title="The debug monitor and command syntax / m - do a memory dump">m</a> command to
inspect the contents of structures and class instances, but you need to be
aware of a few things about the memory layout:</p>
<ul>
<li>
<p>Symbian OS is little-endian, which means that all values are
stored so that the least significant bytes are stored at the lower addresses in
memory (or “backwards” as commonly perceived).</p>
<p>For example, the value 0x1234ABCD would be shown in the memory
dump as:</p>
<p class="listing">CD AB 34 12</p>
</li>
<li>
<p>The compiler may add padding between variables either to speed
up access or to avoid alignment restrictions; for example, words cannot be on
odd addresses. </p>
<p>As an example, the following struct:</p>
<p class="listing">struct SExample<br>
{<br>
TUint8 iByte;<br>
TInt iInteger;<br>
};</p>
<p>would be laid out in memory as:</p>
<p class="listing">+0(1) iByte<br>
+1(3) padding<br>
+4(4) iInteger</p>
<p>The padding and alignment is compiler-dependent. Generally,
fields must be aligned on a boundary equal to their size; for example, a TUint32 is 4 bytes wide so it must lie on a 4-byte
boundary, i.e. the least significant two bits of the address must be
zero.</p>
<p>When using GCC, classes which derive from CBase will have a virtual table pointer as the first word
in the class data and classes which derive from DBase will
have a virtual table pointer as the second word in the class data.</p>
<p>When using an EABI-compliant compiler, the virtual table
pointer is always the first word of the class.</p>
</li>
</ul>
</div>
<div id="footer">Copyright © 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>
</body>
</html>