Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#327542 - 13/11/2009 18:21 Rubbing the lamp: Set WinDbg to automatically do !analyze -v?
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
I've got remote serial-port kernel debugging set up to watch for debug breaks on a laptop. The laptop repros a bug that causes it to break into the kernel debugger in the middle of the night when I'm gone.

Normally, I'd type "!analyze -v" into the debugger command window to find out what the cause of the break was and have it pull up the source code. The problem is, by the time I've arrived in the A.M., the laptop has powered itself down; its processor thermal manager doesn't like it spinning in a tiny loop waiting for the kernel debugger to do something. After the laptop has done this, the commands in the kernel debugger no longer work.

So I need to get WinDbg to automatically do an !analyze -v as soon as the laptop hits the debug break. Anyone have any ideas about how I could elegantly go about this?

Does not work:
- Typing the command ahead of time and just waiting for it to spill out of the keyboard buffer when the break is hit. Doesn't work because the keystrokes are ignored until after the break is hit.

Can do but inelegant:
- Write a complex VBscript or Perl program to wait for the WinDbg window to show the break, then Sendkeys.
- Wait all night.

Any other ideas?
_________________________
Tony Fabris

Top
#327546 - 13/11/2009 19:37 Re: Rubbing the lamp: Set WinDbg to automatically do !analyze -v? [Re: tfabris]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
The traditional answer would probably be to use expect, but I'm not sure how the Windows kernel debugger works. If it's more GUI-y, maybe AutoIt?
_________________________
Bitt Faulk

Top
#327547 - 13/11/2009 20:18 Re: Rubbing the lamp: Set WinDbg to automatically do !analyze -v? [Re: wfaulk]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
Trying AutoIt...

It's impressed me within 10 seconds of my installing it: It knows its audience. One of the very first things I needed to do was find out window info for the window I wanted to ghost keystrokes to, and one of the items on its Start menu was a window identifier tool. Very nice.
_________________________
Tony Fabris

Top
#327548 - 13/11/2009 20:33 Re: Rubbing the lamp: Set WinDbg to automatically do !analyze -v? [Re: tfabris]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
AutoIt is awesome. I've used it for some pretty creative stuff. I really wish it existed for Mac OS in fact. It would be a lot easier (for me) to use rather than cobling things together with Automator and AppleScript (the most awkward language ever created, IMO - useless for non-progrmmaer types and programmer types alike, bravo!).
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#327549 - 13/11/2009 20:54 Re: Rubbing the lamp: Set WinDbg to automatically do !analyze -v? [Re: hybrid8]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
AppScript: Apple Events for Python, Ruby, and Objective-C.
_________________________
Bitt Faulk

Top
#327551 - 13/11/2009 21:06 Re: Rubbing the lamp: Set WinDbg to automatically do !analyze -v? [Re: hybrid8]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
AutoIt works great for what I needed to do. Thanks for that tip.

It looks like most of what I could do with AutoIt is the same as what I'd accomplish with VB, it just makes a lot of the stuff easy. I can do with a 10-line AutoIt script what would take about 100 lines in VB.
_________________________
Tony Fabris

Top
#327554 - 14/11/2009 05:43 Re: Rubbing the lamp: Set WinDbg to automatically do !analyze -v? [Re: tfabris]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5683
Loc: London, UK
Originally Posted By: tfabris
Any other ideas?


Adplus.vbs (in the same directory as WinDbg) shows you how to script CDB (which is the command-line version of WinDbg); you should be able to figure something out from that.
_________________________
-- roger

Top