History log of /external/libcxx/src/debug.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
51d64bbc8c962b973f66c1d8f0d10ec96119c4c6 28-Dec-2016 Eric Fiselier <eric@efcs.ca> Fix debug mode build w/o exceptions

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp
01eb99ac7bb111520d011748fb9fff176d2e64d7 28-Dec-2016 Eric Fiselier <eric@efcs.ca> Implement a throwing version of _LIBCPP_ASSERT.

This patch implements changes to allow _LIBCPP_ASSERT to throw on failure
instead of aborting. The main changes needed to do this are:

1. Change _LIBCPP_ASSERT to call a handler via a replacable function pointer
instead of calling abort directly. Additionally this patch implements two
handler functions, one which aborts and another that throws an exception.

2. Add _NOEXCEPT_DEBUG macro for disabling noexcept spec on function which
contain _LIBCPP_ASSERT. This is required in order to prevent assertion
failures throwing through a noexcept function. This macro has no effect
unless _LIBCPP_DEBUG_USE_EXCEPTIONS is defined.

Having a non-aborting _LIBCPP_ASSERT is very important to allow sane testing of
debug mode. Currently we can only have one test case per file, since the test
case will cause the program to abort. Testing debug mode this way would require
thousands of test files, most of which would be 95% boiler plate. I don't think
this is a feasible strategy. Fortunately using a throwing debug handler solves
these issues.

Additionally this patch rewrites the documentation for debug mode.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290651 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp
14c09a2413ed5cc4914d1690f5dbfb9420a45b3c 25-Aug-2016 Marshall Clow <mclow.lists@gmail.com> Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled. Reviewed as: https://reviews.llvm.org/D23855.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279744 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp
537876b98e3cc290c43843f76979f4cee8d4a35b 19-Mar-2015 Eric Fiselier <eric@efcs.ca> Fix use after free and calls to operator comma in debug mode

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232703 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp
8d86b2e6867297fb2109824c67c50de67f3a31f2 05-Sep-2014 Jonathan Roelofs <jonathan@codesourcery.com> Allow libc++ to be built on systems without POSIX threads

If you're crazy enough to want this sort of thing, then add
-D_LIBCPP_HAS_NO_THREADS to your CXXFLAGS and
--param=additiona_features=libcpp-has-no-threads to your lit commnad line.

http://reviews.llvm.org/D3969


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp
5e57142c5902c3f73a6fdcb8cab55e88ffb43a56 23-Aug-2013 Howard Hinnant <hhinnant@apple.com> Rename _LIBCPP_DEBUG2 to _LIBCPP_DEBUG.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189140 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp
499cea12bb2b1c440f28274227d9fd98cd1c609e 23-Aug-2013 Howard Hinnant <hhinnant@apple.com> Debug mode for string. This commit also marks the first time libc++ debug-mode has found a bug (found one in regex). Had to play with extern templates a bit to get this to work since string is heavily used within libc++.dylib.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp
8b00e6c96091c828b40ac410b6f123c7429a653d 02-Aug-2013 Howard Hinnant <hhinnant@apple.com> Ok, 3 major changes for debug mode in one commit:

1. I had been detecting and trapping iterator == and \!= among iterators
in different containers as an error. But the trapping itself is actually
an error.

Consider:

#include <iostream>
#include <vector>
#include <algorithm>

template <class C>
void
display(const C& c)
{
std::cout << "{";
bool first = true;
for (const auto& x : c)
{
if (\!first)
std::cout << ", ";
first = false;
std::cout << x;
}
std::cout << "}\n";
}

int
main()
{
typedef std::vector<int> V;
V v1 = {1, 3, 5};
V v2 = {2, 4, 6};
display(v1);
display(v2);
V::iterator i = std::find(v1.begin(), v1.end(), 1);
V::iterator j = std::find(v2.begin(), v2.end(), 2);
if (*i == *j)
i = j; // perfectly legal
// ...
if (i \!= j) // the only way to check
v2.push_back(*i);
display(v1);
display(v2);
}

It is legal to assign an iterator from one container to another of the
same type. This is required to work. One might want to test whether or
not such an assignment had been made. The way one performs such a check
is using the iterator's ==, \!= operator. This is a logical and necessary
function and does not constitute an error.

2. I had a header circular dependence bug when _LIBCPP_DEBUG2 is defined.
This caused a problem in several of the libc++ tests.
Fixed.

3. There is a serious problem when _LIBCPP_DEBUG2=1 at the moment in that
std::basic_string is inoperable. std::basic_string uses __wrap_iterator
to implement its iterators. __wrap_iterator has been rigged up in debug
mode to support vector. But string hasn't been rigged up yet. This means
that one gets false positives when using std::string in debug mode. I've
upped std::string's priority in www/debug_mode.html.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187636 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp
912438c272dcf15aef344b5437287bbf90dd99aa 27-Apr-2013 Joerg Sonnenberger <joerg@bec.de> Use static_cast.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp
6dcaf3ee1a1d97ce320d87df842848c5846c2564 05-Apr-2013 Howard Hinnant <hhinnant@apple.com> Fix bug in __libcpp_db::__iterator_copy. Add debug test for swaping lists.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp
83eade6abb414e0e814977921bcb6e46853cae03 07-Mar-2013 Howard Hinnant <hhinnant@apple.com> No functionality change at this time. I've split _LIBCPP_VISIBLE up into two flags: _LIBCPP_TYPE_VIS and _LIBCPP_FUNC_VIS. This is in preparation for taking advantage of clang's new __type_visibility__ attribute.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@176593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp
c6e54b964f22f489309e4e98554ddd7a42ccd291 27-Dec-2012 Howard Hinnant <hhinnant@apple.com> Saleem Abdulrasool: This just rounds up a few compile warnings emitted by GCC (4.7.2).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@171165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp
3882d397c4ad38506d1fe21e5ee3d1d9c82091e4 25-Aug-2012 Howard Hinnant <hhinnant@apple.com> Wrap throw in _LIBCPP_NO_EXCEPTIONS in debug.cpp. Calls abort if can't throw an exception. Fixes http://llvm.org/bugs/show_bug.cgi?id=13082.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@162613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp
ec3773c2dadbeadfc5def927116c2ee9d9c53066 01-Dec-2011 Howard Hinnant <hhinnant@apple.com> Quash a whole bunch of warnings

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp
1c3ec6d480ae2443d7fb25089a137b4a8d9d43cc 28-Sep-2011 Howard Hinnant <hhinnant@apple.com> Another installment on debug mode. This addresses list. However this should be considered a temporary state. The API of the debug database and how vector and list use it, is unsatisfactory at the moment. It is both inefficient and overly verbose. I wanted to get this functionality checked in though. In the next day or so I'll refactor what is there in an attempt to streamline things.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@140660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp
7608b4aac2bcdaa948387355a2248884758482ea 16-Sep-2011 Howard Hinnant <hhinnant@apple.com> Doug Gregor pointed out some problems with debug mode enabled in one TU and not another. This patch helps detect those situations and offers improved error messages to help get debug mode enabled in more TU's when it is absolutely necessary to do so. Thanks Doug.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@139933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp
abe2628b43f13fd81fb90b43dc14472f88b927cc 16-Sep-2011 Howard Hinnant <hhinnant@apple.com> Create multilevel debug mode

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@139913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp
7a563db09ab5bec75c9f132958cc269032eb2862 14-Sep-2011 Howard Hinnant <hhinnant@apple.com> Initial checkin for debug mode (version 2)

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@139711 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/src/debug.cpp