How to debug a program that ends with an unhandled exception?

I am programming in C ++ on a Linux platform.

My program completes this (unhandled) exception:

"end call after calling instance" long "Canceled

The code that throws the exception is inside the try-catch block, then why should this happen? An exception is thrown when returning from a function.

I am used to programming in C and have very little experience in C ++ (which is the main problem). I do not know how to debug this problem. I do not expect a solution, but a direction / pointer to debug this problem.

Thanks in advance.

+3
source share
5 answers

, ,

catch(long)

catch(...)
+1

gdb ( -g) , :

(gdb) catch throw

. :

, (, long). , grepping around .

+8

? , - , , .

gcc, main():

#ifdef __GNUC__
    std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
#endif // ifdef __GNUC__

( . http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt02ch06s02.html)
.

+5

- ... , , - ,

throw 42;

. , .

?

+1

set_terminate GDB

set_terminate():

- bt GDB, backtrace

+1

Source: https://habr.com/ru/post/1723756/


All Articles