by otabdeveloper4 · 2y ago · 0 comments
Of course sometimes all you have is a stack trace from a release build, and then you need to debug that. But if you can, debug the debug build, it's much easier.
Legacy cargo-cult holdover from the 1980's. No real reason for it today.
> also a program without optimizations behaves the same as with optimizations
Not when you want to debug it.
It's bizarre that you don't realize everyone works this way.
Not when you want to debug it.
I think you're mistaking debug information not lining up with your program for different behavior, but these are not the same thing.
Crashes in production happen with optimized builds. You need to be able to inspect the core and figure out what happened from there, as usually you can't reproduce the scenario.