-fno-eliminate-unused-debug-symbols
-fno-eliminate-unused-debug-types
https://gcc.gnu.org/onlinedocs/libstdc++/manual/debug.html https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html
this post seems way more hardcore and beyond my experience though.