[libcxx] r178288 - I believe debug mode for vector<T> (T != bool) is complete. If anyone sees anything more they would like to see on it, please let me know. Debug mode is activated by compiling with -D_LIBCPP_DEBUG2=1. Eventually _LIBCPP_DEBUG2 will be renamed to just _LIBCPP_DEBUG.

Howard Hinnant hhinnant at apple.com
Fri Mar 29 10:46:23 PDT 2013


On Mar 29, 2013, at 12:56 PM, Sean Silva <silvas at purdue.edu> wrote:

> 
> On Thu, Mar 28, 2013 at 9:22 PM, Howard Hinnant <hhinnant at apple.com> wrote:
> On Mar 28, 2013, at 8:49 PM, Sean Silva <silvas at purdue.edu> wrote:
> 
> > Could you maybe give a bit of information about what this "debug mode" is? Is it a "checked STL" type thing? That would be fantastic to have.
> 
> Yes.  The bulk of it is run time checks on vector and its iterators (hopefully to spread to more parts of libc++ soon).
> 
> It would be nice if you mentioned this briefly on <http://libcxx.llvm.org/debug_mode.html>. 

I agree we need debug mode documentation.  Contributions welcome.  Right now I'm just rushing to get the functionality in as my time is quite limited.

> 
> 
> Also, this requires building specifically against the debug version, right? (I presume that having the iterator track its container breaks the ABI somehow). 

src/debug.cpp does need to be included in the build.  The intent is include this source in both debug and release builds, and that it only be a minor size penalty in the dylib, with no run time hit when debug mode is not activated.

The intent is also that activating debug mode does not change the ABI.  However this intent is not well tested at this point.

Howard




More information about the cfe-commits mailing list