This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Begin work on "debug mode" for libstdc++
- From: Doug Gregor <dgregor at apple dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Mon, 9 Jun 2003 16:04:40 -0700
- Subject: Begin work on "debug mode" for libstdc++
Hello,
I've begun work on a "debug mode" for libstdc++. The implementation
will perform additional run-time checks to diagnose misuses of the
standard library, such as an attempt to dereference a past-the-end
iterator or insert into a container with an iterator from another
container.
The main feature of such an implementation is the addition of safe
iterators to the library. Safe iterators keep track of the container
they reference and their relationship with the container. Additionally,
the implementation will contain annotations for standard library
algorithms that verify the correctness of their arguments. The primary
goal is to catch errors in the use of the library at the earliest point
possible, before the errors result in memory corruption that makes
debugging particularly nasty.
Other standard libraries already have debug modes, including the
Metrowerks standard library and STLport (see
http://www.stlport.org/doc/debug_mode.html). The libstdc++
implementation will likely perform checks similar to those in existing
implementations. If you are interested in a particular class of
run-time checks not covered, please contact me.
This work is supported by Apple, and will be primarily done in-house.
We do intend to contribute this work back to the FSF sources as soon as
it is feasible. The timeframe for this project is approximately two
months.
Thank you,
Doug Gregor
dgregor@apple.com