Discussion:
How to auto-create CDB crash dumps
(too old to reply)
Ron James
2004-03-03 23:06:06 UTC
Permalink
I'm trying to use CDB in place of Dr Watson to silently create a crash dump when an Application crashes. I've put the following in the AeDebug Registry key and CDB starts when my application crashes

c:\debuggers\cdb.exe -p %ld -e %ld -g -

I then try the following, and this works :-( - i.e. CDB quits immediately!

c:\debuggers\cdb.exe -p %ld -e %ld -g -c "q

But the following doesn't work. Everyone has write access to c:\crashes.

c:\debuggers\cdb.exe -p %ld -e %ld -g -c ".dump /o /ma c:\crashes\user.dmp

Any suggestions?
Thank
unknown
2004-03-04 01:14:11 UTC
Permalink
What OS? This seems to work for me on W2K3. I think AeDebug has
some limit on the command line length, and it varies with the OS version.

One workaround is to use the $< command to specify a text file that
will contain the actual .dump comand.

You can also create a .cmd file that will launch the debugger and use
that file in AeDebug. I tried it and it seems to work but it probably
depends on the curious fact that cmd.exe specifies bInheritHandles=TRUE
when it starts cdb (if it didn't, -e parameter wouldn't be a valid handle
in the cdb process). I don't know if it's safe to assume that this always
true.

// AeDebug\Debugger value
c:\dbg.cmd %ld %ld

// c:\dbg.cmd file
c:\debuggers\cdb.exe -p %1 -e %2 -g -c ".dump /o /ma c:\crashes\user.dmp; q"
Post by Ron James
I'm trying to use CDB in place of Dr Watson to silently create a crash
dump when an Application crashes. I've put the following in the AeDebug
Registry key and CDB starts when my application crashes.
Post by Ron James
c:\debuggers\cdb.exe -p %ld -e %ld -g -c
I then try the following, and this works :-( - i.e. CDB quits
immediately!)
Post by Ron James
c:\debuggers\cdb.exe -p %ld -e %ld -g -c "q"
But the following doesn't work. Everyone has write access to c:\crashes.
c:\debuggers\cdb.exe -p %ld -e %ld -g -c ".dump /o /ma
c:\crashes\user.dmp"
Post by Ron James
Any suggestions?
Thanks
Ron James
2004-03-04 19:21:07 UTC
Permalink
Pavel

You're right - it's the command line length limit. I was lying in my post - sorry. My executable was actually in the default installation location - "C:\Program Files\Debugging Tools for Windows", and this caused me to hit the AeDebug length limit

Many thanks for you help


----- Pavel Lebedinsky wrote: ----

What OS? This seems to work for me on W2K3. I think AeDebug ha
some limit on the command line length, and it varies with the OS version

One workaround is to use the $< command to specify a text file tha
will contain the actual .dump comand

You can also create a .cmd file that will launch the debugger and us
that file in AeDebug. I tried it and it seems to work but it probabl
depends on the curious fact that cmd.exe specifies bInheritHandles=TRU
when it starts cdb (if it didn't, -e parameter wouldn't be a valid handl
in the cdb process). I don't know if it's safe to assume that this alway
true

// AeDebug\Debugger valu
c:\dbg.cmd %ld %l

// c:\dbg.cmd fil
c:\debuggers\cdb.exe -p %1 -e %2 -g -c ".dump /o /ma c:\crashes\user.dmp; q
Post by Ron James
I'm trying to use CDB in place of Dr Watson to silently create a cras
dump when an Application crashes. I've put the following in the AeDebu
Registry key and CDB starts when my application crashes
Post by Ron James
Post by Ron James
c:\debuggers\cdb.exe -p %ld -e %ld -g -
I then try the following, and this works :-( - i.e. CDB quit
immediately!
Post by Ron James
Post by Ron James
c:\debuggers\cdb.exe -p %ld -e %ld -g -c "q
But the following doesn't work. Everyone has write access to c:\crashes
c:\debuggers\cdb.exe -p %ld -e %ld -g -c ".dump /o /m
c:\crashes\user.dmp
Post by Ron James
Post by Ron James
Any suggestions
Thank
Loading...