Works like a champ! That is exactly what David Crayford (thank you, David!) 
suggested off-line. I followed the spirit of this, but did things somewhat 
differently. In my new handler, I

- Put out a diagnostic message
- Call CEE3DMP
- Call my existing clean-up-and-terminate routine.

The dump is somewhat overkill but it includes a trace, I already had a routine 
to call it with my desired parameters, and our documentation already has 
customer instructions for dealing with it. ctrace() is not as customizable as 
the dump. The dump (in my test) is only 7300 lines so it is not burdensome.

I did not see any need to throw the exception. About all my catch() routine 
does anyway is call the dump and terminate routines.

Thanks everyone for your help.

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Carl Kugler
Sent: Friday, January 23, 2015 9:53 AM
To: [email protected]
Subject: Re: In C++ any way to get traceback info in a catch()?

How about using set_new_handler() in your main() to register a new_handler() 
that does a ctrace() followed by a throw(std::bad_alloc)?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to