我使用-g
和-O0
编译了可执行文件,但在使用gdb运行时出现了std::bad_function_call
的错误,但是gdb没有显示其在应用程序中的来源。另外,该应用程序有两个线程,并且最可能的异常不是来自主线程。
造成这种不完整回溯的原因是什么?
terminate called after throwing an instance of 'std::bad_function_call'
what(): bad_function_call
[New Thread 0x7fffdd5dd700 (LWP 6955)]
[New Thread 0x7fffe6487700 (LWP 6953)]
Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffdd5dd700 (LWP 6955)]
0x00007ffff3818267 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
55 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
#0 0x00007ffff3818267 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
#1 0x00007ffff3819eca in __GI_abort () at abort.c:89
#2 0x00007ffff412c06d in __gnu_cxx::__verbose_terminate_handler() ()
from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff4129ee6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff4129f31 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff4185ec1 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007ffff4e716aa in start_thread (arg=0x7fffdd5dd700) at pthread_create.c:333
#7 0x00007ffff38e9eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
(gdb) q
GCC版本为4.9.2
GDB版本为7.9
catch
时才会执行展开,否则,在原始上下文中将调用terminate
。 - Employed Russian