Post-mortem analysis tools in .NET

Creator QR Code in .NET Post-mortem analysis tools
14.2.4 Post-mortem analysis tools
Scanning Quick Response Code In Visual Studio .NET
Using Barcode Control SDK for .NET Control to generate, create, read, scan barcode image in VS .NET applications.
Under Symbian OS, we use post-mortem tools to analyze the cause of crashes and hangs after software has failed. The analysis can apply to speci c executables, or to whole-system crashes. The tool is dormant on the target, waiting for a trigger from the operating system indicating abnormal termination. In response to this trigger, the tool will gather information from the kernel and system servers about the crash to present to the debugger. Some tools (for example, D_EXC and the crash logger) save a human-readable context dump to a le that can be analyzed off the phone. Others (for example, the crash debugger) are interactive, and allow the developer to interrogate the host over a communications link. The debug API provides triggers and hooks for various system events, on which to hang the post-mortem analysis tools. Code can be installed and run on events such as: hardware exceptions, thread death, kernel death and trace output. For more details, see the documentation for TEventCode in the Symbian Developer Library s C++ component reference section. Usage information for the previously mentioned crash debugger postmortem tool can be found in the Symbian Developer Library Device Driver Guide for EKA2 versions of Symbian OS. Figure 14.6 shows the details of the post-mortem tool on the target. You can see that this architecture is similar to the run-mode architecture, with the host PC side omitted. In fact, the set of kernel interfaces used by both tool-types are largely the same. In the post-mortem case, the kernel-side agent uses the kernel debug API to register with kernel events associated with thread termination. The user-side agent is responsible for outputting the information over a communications channel or to disk.
QR Code Creator In VS .NET
Using Barcode drawer for .NET Control to generate, create Denso QR Bar Code image in Visual Studio .NET applications.
KERNEL-SIDE DEBUG
Scan QR In .NET Framework
Using Barcode decoder for Visual Studio .NET Control to read, scan read, scan image in Visual Studio .NET applications.
host
Bar Code Encoder In VS .NET
Using Barcode creation for .NET Control to generate, create bar code image in .NET applications.
target
Reading Bar Code In .NET Framework
Using Barcode decoder for .NET Control to read, scan read, scan image in .NET framework applications.
Applications
Generating Quick Response Code In Visual C#
Using Barcode drawer for Visual Studio .NET Control to generate, create Denso QR Bar Code image in .NET framework applications.
I/O Server
QR Code 2d Barcode Generation In .NET
Using Barcode encoder for ASP.NET Control to generate, create QR Code JIS X 0510 image in ASP.NET applications.
User Side Agent EXE
Making Quick Response Code In Visual Basic .NET
Using Barcode generator for Visual Studio .NET Control to generate, create QR Code image in Visual Studio .NET applications.
System Servers
Bar Code Creation In .NET Framework
Using Barcode printer for .NET Control to generate, create bar code image in Visual Studio .NET applications.
user kernel
Painting EAN / UCC - 14 In .NET Framework
Using Barcode creator for Visual Studio .NET Control to generate, create EAN / UCC - 13 image in Visual Studio .NET applications.
I/O Channel Peripheral (LDD) Kernel Agent LDD
Code 128A Drawer In .NET Framework
Using Barcode drawer for .NET framework Control to generate, create Code 128 image in VS .NET applications.
Peripheral (PDD)
EAN / UCC - 14 Generation In VS .NET
Using Barcode generator for Visual Studio .NET Control to generate, create Case Code image in Visual Studio .NET applications.
Kernel Debug API
Creating EAN13 In C#.NET
Using Barcode printer for .NET Control to generate, create EAN 13 image in VS .NET applications.
to Disk, or Communication Channel
Bar Code Reader In VS .NET
Using Barcode recognizer for .NET Control to read, scan read, scan image in VS .NET applications.
Figure 14.6 Target post-mortem tools architecture
Printing Data Matrix ECC200 In Visual C#.NET
Using Barcode maker for Visual Studio .NET Control to generate, create Data Matrix 2d barcode image in Visual Studio .NET applications.
A good example of this architecture is the D_EXC tool. This implements a minimal kernel debug agent (MINKDA) and a user-side agent (D_EXC). Source code for these tools is available at these locations:
Creating Code 128A In Java
Using Barcode encoder for Java Control to generate, create ANSI/AIM Code 128 image in Java applications.
\base\e32utils\d_exc\d_exc.cpp \base\e32utils\d_exc\minkda.cpp
Printing Barcode In .NET
Using Barcode encoder for ASP.NET Control to generate, create barcode image in ASP.NET applications.
14.2.4.1 Analyzing post-mortem dump
Code 128 Code Set C Recognizer In VS .NET
Using Barcode recognizer for Visual Studio .NET Control to read, scan read, scan image in .NET applications.
To save ROM, the Symbian OS build tools strip symbolic debug information from all executables before they reach the mobile phone. This means that the post-mortem tools on the target have very little contextual information to annotate the crash dump. This can be a particular problem when attempting to read stack traces. To solve this, Symbian provides tools for the host that match up addresses found in the post-mortem dump and the symbolic debug information on the host. MAKSYM is a command-line tool that cross-references the log le generated when building a ROM image with the verbose linker output that contains the executable symbols. The output is a text le that lists the address of every global and exported function in the ROM. This le can be used to interpret addresses found in post-mortem dumps. MAKSYM symbolic output is essential for diagnosing problems when using the crash logger or crash debugger. Similarly, two other tools PRINTSYM
Generating GS1-128 In C#.NET
Using Barcode generation for VS .NET Control to generate, create USS-128 image in Visual Studio .NET applications.
THE KERNEL DEBUG INTERFACE
Bar Code Printer In VB.NET
Using Barcode creator for .NET Control to generate, create barcode image in .NET applications.
and PRINTSTK use the MAKSYM symbolic output to interpret D_EXC output. More information on using these tools can be found in the Symbian Developer Library.
14.3 The kernel debug interface
Debug tools will use many of the general purpose APIs provided by the kernel. In addition, we provide the kernel debug interface to speci cally support the remaining requirements of all these tools. In this section, I will describe the features of the kernel debug interface, namely: Kernel event noti cation Thread context API Code and data section information Shadowing ROM pages. Other features typically used by debug tools are: Kernel resource tracking (kernel object API) Thread-relative memory read and write. Kernel objects and the kernel object containers are covered in Section 5.1, and I describe thread-relative memory access for the moving and multiple memory models in 7, Memory Models. The kernel debug functionality is optional, since you will not always want to allow intrusive debug tools onto production mobile phones. The DEBUGGER_SUPPORT__ macro enables the kernel features required speci cally for a debugger implementation. You ll nd this de ned (or not) in the variant MMH le. (The project de nition les for the variant are typically named \base\<variant>\variant.mmh. See \base\lubbock\variant.mmh for an example.) You can check at run-time if your build of the kernel includes these features by calling.
TBool DKernelEventHandler::DebugSupportEnabled();
By default, software and ROM images supplied on the Symbian OS DevKits are built with debug support enabled. However, phone manufacturers may choose to switch it off.