Debugging tricks

John Eldridge has posted some debugging tricks on his blog, and that has inspired me to write up some of my own.  I’ll start working on that…  In the meantime I wanted to share a link to his tips:

John has way more ninja debugging skillz than me, but I’ve picked up a few in my time at MSFT.  I’ll talk about how to resolve symbols manually using .map and .cod files, debugger extensions, and some ways to debug on a standalone device when a debugger’s not an option.


Comments (3)

  1. Dast says:

    I would really like to hear about debugging without KITL or active sync. I end up doing that a lot these days because the CE image we get to support our board doesn’t support KITL (we’ve bugged the vendor) and active sync seems to go wacky sometimes.

    What other options are there?

  2. Sue Loh says:

    Sorry Dast, I’m planning on getting there, but haven’t written it up yet. Here’s a preview of what I have planned. It is all building to what you were asking about.

    1. VM layout for debugging (done already)

    2. Resolving symbols manually, ADDR->SYM (done already)

    3. Figuring out where a symbol lives in memory, SYM->ADDR (partly written but not posted yet)

    4. Debugger extension basics

    5. Probably some ToolHelp stuff, I’d like to show how to dump all the processes, modules, threads & threadstacks.

    6-ish. Combine all these good things to debug at run-time. When you know where a symbol is in memory, say the location of your global pointer to the head of your linked list, then you can build your debugger extension code to operate at run-time instead of debug-time. Now you have a program you can run, that will walk RAM and tell you what’s going on with your program.

    If you already know what you’re doing pretty well, this might give you enough hints that you can get started yourself. Otherwise I’ll eventually get to it. It helps when people like you write back because I know someone is actually reading this. It was a little discouraging to post some blog entries I was pretty happy with, and get responses only to my dumb "looking for a hex reader" post. 😉

    Good luck,


  3. Dast says:

    Well, I for one am now a subscriber to your RSS feed. I’ll be coming back to read any of these topics that you might post on.

    I would think the reason that people respond more to the question than the in-depth technical article is that you seem to do a good job knocking it out. All you can say at that point is "wow, that was really great," which is not a terribly insightful comment.