X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=libstdc%2B%2B-v3%2Fdoc%2Fhtml%2Fmanual%2Fdebug_mode.html;fp=libstdc%2B%2B-v3%2Fdoc%2Fhtml%2Fmanual%2Fdebug_mode.html;h=e83c51e742e5eca7932ef671336d7053376fb290;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=0000000000000000000000000000000000000000;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/libstdc++-v3/doc/html/manual/debug_mode.html b/libstdc++-v3/doc/html/manual/debug_mode.html new file mode 100644 index 00000000..e83c51e7 --- /dev/null +++ b/libstdc++-v3/doc/html/manual/debug_mode.html @@ -0,0 +1,37 @@ + + +Chapter 30. Debug Mode

Chapter 30. Debug Mode

Table of Contents

Intro
Semantics
Using
Using the Debug Mode
Using a Specific Debug Container
Design
Goals
Methods
Other Implementations

Intro

+ By default, libstdc++ is built with efficiency in mind, and + therefore performs little or no error checking that is not + required by the C++ standard. This means that programs that + incorrectly use the C++ standard library will exhibit behavior + that is not portable and may not even be predictable, because they + tread into implementation-specific or undefined behavior. To + detect some of these errors before they can become problematic, + libstdc++ offers a debug mode that provides additional checking of + library facilities, and will report errors in the use of libstdc++ + as soon as they can be detected by emitting a description of the + problem to standard error and aborting the program. This debug + mode is available with GCC 3.4.0 and later versions. +

+ The libstdc++ debug mode performs checking for many areas of the + C++ standard, but the focus is on checking interactions among + standard iterators, containers, and algorithms, including: +

  • Safe iterators: Iterators keep track of the + container whose elements they reference, so errors such as + incrementing a past-the-end iterator or dereferencing an iterator + that points to a container that has been destructed are diagnosed + immediately.

  • Algorithm preconditions: Algorithms attempt to + validate their input parameters to detect errors as early as + possible. For instance, the set_intersection + algorithm requires that its iterator + parameters first1 and last1 form a valid + iterator range, and that the sequence + [first1, last1) is sorted according to + the same predicate that was passed + to set_intersection; the libstdc++ debug mode will + detect an error if the sequence is not sorted or was sorted by a + different predicate.