3 ms·
there are arguments against it but I frankly like it being this explicit as a newbie in Go. So you are not alone :)
by codegeek 5y ago
there are arguments against it but I frankly like it being this explicit as a newbie in Go. So you are not alone :)
- throwaway894345 5y agoI’ve been writing Go for a decade and I’ve liked it from the beginning, but stack trace support is welcome.
- dhagz 5y agoYep - my biggest gripe is seeing errors with no context around them - either a stack trace or...well...the context.Context.
- ollien 5y agoI'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.
- bombela 5y ago100% Shameless plug. Stack capture and pretty printer for C++: https://github.com/bombela/backward-cpp https://github.com/bombela/backward-cpp
- ollien 5y agoThis looks super neat. Thanks!
- jcelerier 5y agowhy 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
- ollien 5y agoWell, 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.
- gpderetta 5y agoIt 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.