Rob Blackwell home projects resumé archive

Advanced Debugging on Windows Azure with ADPlus

27 October 2010

Let's say you have a C++ program that works locally, but doesn't work in Windows Azure compute - How do you go about debugging it?

The Windows Azure Diagnostics crash dump feature only works if the worker role itself dies, not if a spawned process dies.

Fortunately, ADPlus is now XCOPY deployable, so we can use it with Azure.

Let's assume that you are using AzureRunMe and the WindowsTelnetDameon to get onto Azure. (See my earlier blog posts ).

You need to have a 64 bit dev machine. Download and install the Debugging Tools for Windows (x64) which is part of the Windows 7 SDK.

Then ZIP up the "C:\Program Files\Debugging Tools for Windows (x64)" directory and upload it blob store. Configure AzureRunMe to load the zip package.

I have a very simple C program, FailTest.exe that divides by zero:

   #include "stdafx.h"

   int _tmain(int argc, _TCHAR* argv[])
   {

    printf("Hello world");
    int x = 10;
    int y = 0;
    printf ("Answer %d", x / y);
    return 0;
}

Okay, so then Telnet onto Azure and

  > adplus -crash -o . -sc FailTest.exe

This generates you a crash dump. You can drag it back to your dev machine by copying it to a cloud drive and downloading the VHD file.

You are then free to use crash dump analysers like WinDbg or VS2010 to see what's really going on!

My thanks to Neil Kidd for suggesting this.

If we can help with your Azure migration project, please contact us.

*The opinions expressed on this site are my own and do not necessarily represent those of Two10degrees or Active Web Solutions Ltd.