1

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#:

How to handle a crash in a process launched via System.Diagnostics.Process?

Community
  • 1
  • 1
benoitj
  • 419
  • 3
  • 13

3 Answers3

1

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 Win32: Is there a difference between Dr. Watson's full/mini dumps and writing my own?

Community
  • 1
  • 1
the_mandrill
  • 29,792
  • 6
  • 64
  • 93
0

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

Community
  • 1
  • 1
nc3b
  • 15,562
  • 5
  • 51
  • 63
  • 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 Apr 23 '10 at 10:33
0

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
  • 238
  • 1
  • 6
  • 23
  • 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 Apr 23 '10 at 12:04
  • About solution (1)Do you have more info about capturing exception/crash from another process ? – benoitj Apr 23 '10 at 12:35