News for hackers. Stuff that matters.
Re:You’re better off using Exceptions by renox on Monday February 03, 2020 @05:14PM (#22229880)
> But C++ does not provide a stack trace

Which makes exception in C++ a very, very bad idea!

My reaction to 'the test fails because map::at threw an exception': stupid STL!!

A core dump would be so much easier to analyze.. Gdb's 'catch thow' is wonderful (well, it is after I fixed the part of our codebase which use exceptions as a control flow mechanism)

Re:You’re better off using Exceptions by nemetroid on Monday February 03, 2020 @06:13PM (#22230428)
> My reaction to 'the test fails because map::at threw an exception': stupid STL!!

> A core dump would be so much easier to analyze..

Uncaught exceptions call terminate(), which by default calls abort(), which generates a core dump. So if you want a core dump, just avoid catching the exception.

Re:You’re better off using Exceptions by renox on Tuesday February 04, 2020 @04:57AM (#22233946)
Except that I didn't put all these "catch".. But you're right, that's what should be done (or at least, rethrowing the exception from the catch block).
Re:You’re better off using Exceptions by AstralStorm on Tuesday February 04, 2020 @11:57AM (#22237897)
C++ can have a stack trace, there are enough libraries providing this functionality and even compiler extensions. Say, libunwind, though you will have to demangle names. And a debugger will see the stack as it is.

Also works in C.