views:

156

answers:

4

Hello

I'm doing batch-testing on our win32 c++ programs. Some of them crash. What's the best way to catch those crash from the command line and report it?

thanks

edit: answer:

1) you can't catch another process's exception from batch / command line

2) example to do it right in c#:

http://stackoverflow.com/questions/673036/how-to-handle-a-crash-in-a-process-launched-via-system-diagnostics-process

A: 

Maybe checking their return value in your script ? Of course, they have to adhere to a standard (for instance, in a unix-like os 0 = success, all else = error).

EDIT: also look here

nc3b
I can't because: 1) Visual Studio just-in-time debugger catches the crash and 2) my program doest return normally so i can't change the error code ( and i don't want to add a minidump catch )
benoitj
A: 

there are two ways to catch, 1. Have a monitoring exe running as service or process. 2. Or implement crash class in windows may be usefull

OliveOne
Thanks. I don't want to add a minidump to my exes(2), so i guess i go for solution (1) and make a small launcher.exe
benoitj
About solution (1)Do you have more info about capturing exception/crash from another process ?
benoitj
A: 

from my own edit ;)

1) you can't catch another process's exception from batch / command line

2) example to do it right in c#:

http://stackoverflow.com/questions/673036/how-to-handle-a-crash-in-a-process-launched-via-system-diagnostics-process

benoitj
+1  A: 

There is a way of catching exceptions and crashes from the command line: use ADPlus in crash mode and it will sit in the background listening for unhandled exceptions.

See also http://stackoverflow.com/questions/2694701/win32-is-there-a-difference-between-dr-watsons-full-mini-dumps-and-writing-my/2694863#2694863

the_mandrill