• Sign In
 
  • MSDN Blogs
  • Microsoft Blog Images
  • More ...
Common Tasks
  • Blog Home
  • Email Blog Author
  • RSS for comments
  • RSS for posts
Search
  • Advanced search options...
Tags
  • .NET Framewor
  • .NET Framework
  • Ajax/Javascript
  • ASP.NET
  • CLR
  • Cool stuff
  • DataAccess
  • Debugging/Windbg
  • Hotfix/Service Pack
  • IDEVDataCollector
  • IIS
  • Internet Explorer
  • Italian techs
  • LogParser
  • OT
  • Personal
  • Productivity
  • Random
  • Scripting/ASP
  • Security
  • Technology
  • Tools
  • Troubleshooting
  • Vista/Longhorn
  • Visual Studio
Archives
Archives
  • November 2010 (1)
  • October 2010 (1)
  • July 2010 (2)
  • April 2010 (1)
  • March 2010 (2)
  • February 2010 (2)
  • January 2010 (1)
  • October 2009 (2)
  • September 2009 (2)
  • August 2009 (1)
  • July 2009 (5)
  • June 2009 (1)
  • May 2009 (1)
  • April 2009 (3)
  • March 2009 (3)
  • February 2009 (5)
  • January 2009 (3)
  • December 2008 (5)
  • November 2008 (3)
  • October 2008 (2)
  • September 2008 (3)
  • August 2008 (3)
  • July 2008 (3)
  • June 2008 (5)
  • May 2008 (4)
  • April 2008 (8)
  • March 2008 (4)
  • February 2008 (5)
  • January 2008 (2)
  • December 2007 (4)
  • November 2007 (6)
  • October 2007 (6)
  • September 2007 (8)
  • August 2007 (6)
  • July 2007 (7)
  • June 2007 (10)
  • May 2007 (9)
  • April 2007 (12)
  • March 2007 (8)
  • February 2007 (5)
  • January 2007 (3)
  • December 2006 (1)
  • November 2006 (4)
  • October 2006 (2)
  • September 2006 (9)
  • August 2006 (2)
  • July 2006 (1)

New to debugging? How it all begun (and how could begin for you, too...)

MSDN Blogs > Never doubt thy debugger > New to debugging? How it all begun (and how could begin for you, too...)

New to debugging? How it all begun (and how could begin for you, too...)

Carlo Cardella
11 Sep 2007 4:27 PM
  • Comments 6

When I joint Microsoft and the EMEA Internet Dev Support Team in late 2004, I soon realized that I had to build a new skillset to have a future in my new role; before that I was a kind of "self made" developer, in the sense that almost everything I learnt I did in "the hard way", buying and readings my own books, building a lot of samples, testing, making a lot of mistakes etc... I've not had a real mentor, I simply tried to learn from my own experiences, testing things "in real life" and watching the results. And for me in that period the word "debugging" meant only the Visual Studio debugger, run the application and inspect my code hunting for bugs; I never thought to WinDbg, memory dumps and deep system internals (well, to he honest I knew something about memory dumps, but I thought it was too hard for me and never really tried to get my hands dirty with that stuff).

Then I join Microsoft and the iDev team, and my horizons expanded. Not too much time had to pass before I realized the kind of cases we were managing required some different (and deeper) skills/knowledge, and more and more often I had to seek assistance from my colleagues with this new stuff. That's how thing goes at the beginning in a new role, but I like to "walk with my own legs" (if you understand what I mean) so I started searching for manuals, how to etc..., and guess what? I found a lot of information but not really organized so that a newby like me could start learning the subject... and the more I was asking advices about training and books, the more I was getting replies like "that's a matter of experience, you need to jump on it and start digging!".

To make a long story short, I've finally accepted the advice and made some kind of cut and paste of the information I needed to start. Here and in upcoming posts I'll try to write down what I learnt so far; of course I've not the nerve to believe this will be a definitive guide to debugging (later on this post I'll mention some docs and blogs which deals with advanced topics), but I'll be happy if I'll save you some time especially at the beginning when you're trying to figure out how this new thing works, and someone will find this useful and intriguing enough to start digging into this interesting (and sometimes surprising) world. smile_regular

The tool case

We have to start somewhere, so like an apprentice carpenter the first thing to do is to know our tool kit and which is the right one for the task at hand.

Debugging tools for Windows

(download) This is the foundation of managed and unmanaged debugging; of course you can find a lot of different debuggers out there on the Internet, but WinDbg is one of the most powerful you can find, flexible and extendible (through a sort of plugins/extensions you can develop with the SDK) which allows you to debug you managed and native code, and also the Windows kernel. Or you can attach it to a process to debug live. The setup package will install  a number of useful tools like adplus (a .vbs script which takes some arguments to capture a memory dump you can then analyze offline with WinDbg), gflags and many others.

DebugDiag

(download) This has originally been developed by the IIS Escalation Engineers team and has a marked shape for IIS debugging (even if it can be also used to dump other processes); it has also a couple of built-in scripts useful to automatically analyze a crash or memory leak dumps and have a nicely formatted report which can give you an idea of what's happening. To be honest I prefer to use adplus, but I find DebugDiag quite useful in some specific scenarios, particularly when we have an unmanaged memory leak: this is because DebugDiag uses a dll called LeakTrack which gets injected into the target process (usually w3wp.exe) to track memory allocations, and it can greatly help the automatic analysis to show where the memory is going, who is allocating it etc... This is not enough to resolve the problem, but it's a quick way to find some good clues and steer your next steps in the right direction.

Reflector

(download) This is the tool to disassemble managed code, with an interesting list of add-ins to expand it's capabilities; very handy to have a look at the source code of managed components extracted from a dump

LogParser

(download) I discovered this tool only recently and I'm still playing with it to explore all of its capabilities (see my previous posts here and here); anyway it's very powerful and as the name implies can be used to analyze log files and other inputs (File System, Event Logs, IIS logs, CSV and many more) with a Sql-like query syntax and can output the result in as many formats

Sysinternals tools

There are a lot of them, but what I use most are Process Explorer, Process Monitor and the PSTools.

Of course there are many more tools I use in my daily job, but the above list should be enough for most occasions (and for at least half of them you'll just need WinDbg with a good extension).

Some good docs

As you can guess, the right tools are like a gun without bullets, if you don't know how to use them and most important how to understand and interpret the output they give; moreover, the more you know the platform (and with the term platform here I mean both the .NET world and the underlying OS where it runs) the more you'll be able to understand the values you'll get, spot possible incongruities and imagine understand why in the given scenario things are going wrong.

Unfortunately I can't point you to the internal documentation I'm lucky enough to have access to, but you must definitely have a look at the following:

  • Tess' blog
  • Doug's blog
  • Roberto's blog
  • Nicolas' blog
  • Johan's blog
  • Maoni's blog
  • Advanced .NET debugging
  • Production debugging for .NET Framework applications
  • Windows Internals (a must have for every serious developer)

I think that's enough for this first post, just a short introduction of what I'll try to explain in the upcoming weeks; by the way, if you have any topic about managed debugging you'd like me to discuss, feel free to drop me an email of leave a comment. If we can add some interactivity to this thing, we'll hopefully have something useful for everyone interested.

Carlo


Quote of the Day:
Imagination is everything. It is the preview of life's coming attractions.
--Albert Einstein
  • 6 Comments
Debugging/Windbg
Leave a Comment
  • Please add 5 and 6 and type the answer here:
  • Post
Comments
  • MSDN Blog Postings » Something you need to know before start debugging
    14 Sep 2007 1:20 PM

    PingBack from http://msdnrss.thecoderblogs.com/2007/09/14/something-you-need-to-know-before-start-debugging/

  • Thomas Kohler's Blog
    17 Sep 2007 5:02 AM

    Eplains tools and first steps to core debugging.http://blogs.msdn.com/carloc/archive/2007/09/11/new-to-debugging-how-it-all-begun-and-how-could-begin-for-you-too.aspx ...

  • Jigar Mehta
    13 Oct 2007 10:08 AM

    Thanks a lot for sharing the debugging resources. Few of the blogs you have listed have really good information which I was not aware of.

    I am a regular reader of your blog now :)

  • Sanjay
    27 Mar 2008 8:04 PM

    I was dying to find for such information since long...

    It will be great if you could add some videos too.

  • Carlo Cardella
    31 Mar 2008 1:44 AM

    Thanks Sanjay, will try to get organized for the videos :-)

  • Adventures in IIS, Commerce and whatever else comes into my head.
    23 Jul 2008 6:32 AM

    I've just finished writing up an e-mail for some new people in my team about starting Debugging and the

Page 1 of 1 (6 items)
  • © 2012 Microsoft Corporation.
  • Terms of Use
  • Trademarks
  • Privacy Statement
  • Report Abuse
  • 5.6.402.223