OpenBSD is introducing some neat ways of marking sensitive memory so you don't accidentally expose data in a core dump: https://undeadly.org/cgi?action=article;sid=20190605110020
"Significant effort has been put into making optimization output agnostic of the -gsetting (so you can rebuild binary with debug info after your program core dumped and use it to debug the core dump)"
Impressive gcc features discussed in