https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59170

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jan Kratochvil from comment #8)
> (In reply to Jonathan Wakely from comment #7)
> > But most code isn't compiled with debug mode enabled.
> 
> IMO all code for debugging with pretty printers is compiled with debug mode
> enabled.

That's absolutely not true. Most developers don't even know the debug mode
exists.

Most C++ code being debugged with GDB is compiled with -O0 -g or with -Og -g,
but not debug mode. In that scenario the pretty printers will be enabled, but
won't be able to detect invalid iterators.

I don't know what "code for debugging with pretty printers" means. Users don't
do anything special for debugging with pretty printers, they just use GDB and
the printers are automatically active. And they automatically dereference
iterators, with unpleasant results.

Reply via email to