Tuesday, April 12, 2011

Setting up WinDbg and Using Symbols

Once you have collected a dump file, to analyse it you need to use a tool called WinDbg. In this post I am going to explain how to set up WinDbg so it's ready to debug a memory dump taken from a Dynamics AX process. If you're not sure how to create a dump file, just take a look at the post below, scroll down to the subtitle "What do I need to create a Crash Dump?" and you'll find what you need there:
Getting WinDbg set up is a fairly straightforward task, just download and install the Windows debugging tools from the link below. You might need to install both the 32bit and 64 bit versions – if you are looking at dump files from a 32bit operating system then use the 32bit tools, and if it’s from a 64bit operating system use the 64 bit tools.

If you’re not sure which OS a particular dump file came from (and it's always good to check just to be sure) then when you open a dump file, with either version of WinDbg it will tell you which operating system it was taken from, here’s an example, with the important part highlighted in yellow:
Microsoft (R) Windows Debugger Version 6.11.0001.404 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.
Loading Dump File [C:\Temp\Ax32Serv.exe.4408.dmp] 
User Mini Dump File with Full Memory: Only application data is available
WARNING: Whitespace at end of path element 
Executable search path is: 
Windows 7 Version 7600 UP Free x64
Product: Server, suite: Enterprise TerminalServer SingleUserTS
Machine Name:
Debug session time: Thu Dec 30 11:26:55.000 2010 (GMT+0)
System Uptime: 0 days 23:42:28.537
Process Uptime: 0 days 0:21:20.000