Jim Cant <[email protected]> writes:
> The script gets passed the PID of the failed process and I can get all
> the process information using Win32::Process::Info.  Question 1: How
> to generate the dump? Is there a module that will do this?

I don't know if there's a module but if there's not an easy Perl way into
whatever system call does dumps perhaps you could have your script run
windbg or one of the other debuggers from Debugging Tools for Windows to
do it.

I didn't test this, but I'm thinking of a command like 
windbg -p <procid> -c ".dump <dump.file>".

There are other kinds of -p flags, e.g. this one looks maybe useful in
your case:

"-pe (Windows XP and later, user mode only) Indicates that the target
application is already being debugged. See Re-attaching to the Target
Application for details. "

I wonder though if you'll have a problem where windbg displaces perl as
the attached debugger.

It might be worth looking at ADPlus's source to see if it's doing
anything similar. IIRC, it's a vbscript front end to cdb (another
windows debugger -- or a simpler another front end to what windbg
uses?). I used it once or twice because it seemed to be more predictable
in being able to get a dump created when I give instructions to other
people to do it. For some reason this has been a big problem for me,
being able to give simple instructions to people to get dumps for me
across various versions of windows -- I can't remember the
details. Maybe your registry setting approach doesn't suffer these
problems, like trying to tell people what to do with drwatson or warning
them to pull a file from a certain directory before clicking a certain
button in a certain Windows Error Reporting dialog. Ugh, I'm getting a
headache just thinking about this.

The help file distributed with Deb. Tools for Win. will have more info
on windbg, ADPlus, etc. Also, the book _Advanced Windows Debugging_ by
Heardt and Pravat is quite helpful.

- Mike

_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to