You can always tune it one way or another with the optimization level (-O0, -Og, -O3, ...) But I agree. That doesn't really help when you need to debug release binaries, which are understandably at maximum optimization levels.
gcc is actually pretty good at preserving debuggability through optimizations. clang? Not so much.
gcc is actually pretty good at preserving debuggability through optimizations. clang? Not so much.