|
|
|
|
|
by jcelerier
3 days ago
|
|
> If you crash from an unhandled exception, you don't. .. you absolutely get a stack trace from unhandled exception in c++, that starts where the exception is thrown? At least with clang and GCC, maybe MSVC isn't able to. foo.cpp: #include <stdexcept
void bar() { throw std::runtime_error("boo"); }
void foo() { bar(); }
int main() { foo(); }
running: $ g++ foo.cpp -std=c++23 -g
$ ./a.out
terminate called after throwing an instance of 'std::runtime_error'
what(): boo
$ coredumpctl gdb
...
#7 0x00005555555551bb in bar () at foo.cpp:3
#8 0x00005555555551da in foo () at foo.cpp:4
#9 0x00005555555551e6 in main () at foo.cpp:5
it's a basic example, but it's how I've always done all my debugging in C++ since forever |
|