#defineing _GLIBCXX_DEBUGforces GCC to catch a large class of C ++ runtime errors, for example, accessing STLs outside boundaries, invalid iterators, etc.
Unfortunately, when an error occurs, the printed message is not very useful. I know how to print a backtrace with a function, __FILE__and __LINE__with a macro.
Is there an easy way to convince GCC to do this, or to specify a function / macro to call if errors actually _GLIBCXX_DEBUGcatch that happen ?
source
share