Hacker News new | ask | show | jobs
by dhagz 1754 days ago
Yep - my biggest gripe is seeing errors with no context around them - either a stack trace or...well...the context.Context.
1 comments

I've just started writing C++ for work, and I have to say, I miss stack traces so much. Even with Go errors the wrapping usually made it easy enough, but with how long it takes to get gdb to launch from core dumps (~1m30 on our binaries at work), I really do miss that extra context.
100% Shameless plug. Stack capture and pretty printer for C++: https://github.com/bombela/backward-cpp
This looks super neat. Thanks!
It is not particularly hard to log stack traces in C++, for example from an abort signal handler or attaching them to exceptions.

There is no standard solution though, so you have to rely on 3rd party libraries or use platform specific solutions.

why not just enable them ? there are plenty of minimally invasive and permissively licensed options... that's like -Werror=return-stack-address it's an entire no-brainer
Well, namely it's not my decision to enable them for the entire codebase :) but I may very well try to talk some people into enabling this on debug builds.