Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Detection of fa...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 7 Topic 9828 of 9983
Post > Topic >>

Detection of fatal errors

by sebastian <Sebastian.Piec@[EMAIL PROTECTED] > Jul 24, 2008 at 01:27 PM

Hi,

Is there any way to perform an action before program's exit, when it
encounter some kind of fatal error?
Namely I'd like to detect a fatal error and dump buffer with logs to a
file in situations like below:

---- example 1 ----
int *a = 0;
*a = 21;

---- example 1 ----
MyClass *a;
a->someFunction();


I've tried many things:
(1)
try {

} catch( ... ) {
   dumpBuffer();
}


(2)
std::set_unexpected( dumpBuffer );
std::set_terminate( dumpBuffer );

(3)
atexit( dumpBuffer );  // this is bypassed anyhow...

None of them works.
My platform is Windows XP, program is written using Qt 4.4.0, compiler
is gcc (Mingw) 3.4.5.

Cheers,
Sebastian


-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 7 Posts in Topic:
Detection of fatal errors
sebastian <Sebastian.P  2008-07-24 13:27:11 
Re: Detection of fatal errors
JoshuaMaurice@[EMAIL PROT  2008-07-24 16:10:29 
Re: Detection of fatal errors
Alex Shulgin <alex.shu  2008-07-25 12:03:26 
Re: Detection of fatal errors
=?UTF-8?B?15DXqNeZ16DXk9e  2008-07-27 15:41:34 
Re: Detection of fatal errors
Jiang <goo.mail01@[EMA  2008-07-27 15:58:17 
Re: Detection of fatal errors
JoshuaMaurice@[EMAIL PROT  2008-07-27 21:48:21 
Re: Detection of fatal errors
Pete Becker <pete@[EMA  2008-07-27 21:49:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Sep 6 15:42:06 CDT 2008.