Begin work on "debug mode" for libstdc++
Doug Gregor
dgregor@apple.com
Mon Jun 9 23:05:00 GMT 2003
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
More information about the Libstdc++
mailing list