What happens is as follows:
I use the gdb editor.
I run the code there until the exception is thrown. Since it is not 
caught inside the code, the code stops and I use gdb command "up" and 
"print" for debugging.
Usually my stack depth is less than 10, so this is easy.

Now, when your handler is called the depth has been increased up to 100 
levels and somehow I got into destructors of my objects. Doing "up" 
command many times I was able to get to my exception throwing place, so 
I could debug, but this was inconvenient.
May be there is a problem in my code, I do not know.
Michael.
On 08/26/2015 06:09 PM, John Peterson wrote:
>
>
> On Wed, Aug 26, 2015 at 3:12 PM, Michael Povolotskyi 
> <mpovo...@purdue.edu <mailto:mpovo...@purdue.edu>> wrote:
>
>     The problem is that the handler of yours causes execution of some
>     class destructors of my code, which  I do not want to happen. This
>     happens if I build my code in DEBUG mode when I do not want any
>     exception catching.
>
>
> The libmesh terminate handler being called (or not) is independent of 
> whether or not stack unwinding is done (see, e.g. 
> http://stackoverflow.com/questions/8311457/are-destructors-called-after-a-throw-in-c),
>  
> and the terminate handler itself calls no destructors.
>
> Furthermore, if you are already in the terminate handler, the code is 
> dying -- there should be no standard way of recovering from that -- 
> and therefore I don't see why it matters whether some destructors are 
> called or not?
>
> Maybe you can tell me a little bit more about your particular 
> situation...we added the exception stuff to make error handling in 
> higher level apps *easier*, so it's a little troubling if you have to 
> turn it off to handle application-level errors...
>
> -- 
> John

-- 
Michael Povolotskyi, PhD
Research Assistant Professor
Network for Computational Nanotechnology
Hall for Discover and Learning Research, Room 441
West Lafayette, IN 47907
Phone (765) 4949396

------------------------------------------------------------------------------
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to