PR libstdc++/31518
* include/debug/formatter.h (_Error_formatter::_M_get_max_length): New.
(_Error_formatter::_Error_formatter): Use it.
* src/debug.cc: Define.
(_Error_formatter::_M_error): Tweak.
* configure.ac: Adjust version to 6:10:0.
* config/abi/pre/gnu.ver: Export _Error_formatter::_M_get_max_length
at GLIBCXX_3.4.10.
* testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.10.
* docs/html/debug.html: Document.
* configure: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126287
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-07-03 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/31518
+ * include/debug/formatter.h (_Error_formatter::_M_get_max_length): New.
+ (_Error_formatter::_Error_formatter): Use it.
+ * src/debug.cc: Define.
+ (_Error_formatter::_M_error): Tweak.
+ * configure.ac: Adjust version to 6:10:0.
+ * config/abi/pre/gnu.ver: Export _Error_formatter::_M_get_max_length
+ at GLIBCXX_3.4.10.
+ * testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.10.
+ * docs/html/debug.html: Document.
+ * configure: Regenerate.
+
2007-07-02 Douglas Gregor <doug.gregor@gmail.com>
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc:
std::__num_base::_S_atoms_out;
std::__moneypunct_cache*;
std::__numpunct_cache*;
- std::__timepunct_cache*;
- __gnu_debug::_Error_formatter*
+ std::__timepunct_cache*
+# __gnu_debug::_Error_formatter*
};
# Names not in an 'extern' block are mangled names.
_ZNK11__gnu_debug19_Safe_iterator_base11_M_singularEv;
_ZNK11__gnu_debug19_Safe_iterator_base14_M_can_compareERKS0_;
+ # __gnu_debug::_Error_formatter
+ _ZNK11__gnu_debug16_Error_formatter10_M_message*;
+ _ZNK11__gnu_debug16_Error_formatter10_Parameter*;
+ _ZNK11__gnu_debug16_Error_formatter13_M_print_word*;
+ _ZNK11__gnu_debug16_Error_formatter15_M_print_string*;
+ _ZNK11__gnu_debug16_Error_formatter8_M_error*;
+
# std::string
_ZNSsC*;
_ZNSsD*;
} GLIBCXX_3.4.8;
+GLIBCXX_3.4.10 {
+
+ _ZNK11__gnu_debug16_Error_formatter17_M_get_max_lengthEv;
+
+} GLIBCXX_3.4.9;
+
# Symbols in the support library (libsupc++) have their own tag.
CXXABI_1.3 {
### am handles this now? ORIGINAL_LD_FOR_MULTILIBS=$LD
# For libtool versioning info, format is CURRENT:REVISION:AGE
-libtool_VERSION=6:9:0
+libtool_VERSION=6:10:0
# Find the rest of the source tree framework.
### am handles this now? ORIGINAL_LD_FOR_MULTILIBS=$LD
# For libtool versioning info, format is CURRENT:REVISION:AGE
-libtool_VERSION=6:9:0
+libtool_VERSION=6:10:0
AC_SUBST(libtool_VERSION)
# Find the rest of the source tree framework.
instantiation of a container is passed between the two translation
units.</p>
+<p>By default, error messages are formatted to fit on lines of about
+ 78 characters. The environment variable
+ <code>GLIBCXX_DEBUG_MESSAGE_LENGTH</code> can be used to request a
+ different length.</p>
+
<p>For information about the design of the libstdc++ debug mode,
please see the <a href="debug_mode.html">libstdc++ debug mode design
document</a>.</p>
// Debug-mode error formatting implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
_Error_formatter(const char* __file, size_t __line)
: _M_file(__file), _M_line(__line), _M_num_parameters(0), _M_text(0),
_M_max_length(78), _M_column(1), _M_first_line(true), _M_wordwrap(false)
- { }
+ { _M_get_max_length(); }
template<typename _Tp>
void
void
_M_print_string(const char* __string) const;
+ void
+ _M_get_max_length() const;
+
enum { __max_parameters = 9 };
const char* _M_file;
#include <cstring>
#include <cctype>
#include <cstdio>
+#include <cstdlib>
using namespace std;
_M_column += strlen(__buf);
}
- _M_wordwrap = true;
+ if (_M_max_length)
+ _M_wordwrap = true;
_M_print_word("error: ");
// Print the error message
}
}
+ void
+ _Error_formatter::_M_get_max_length() const
+ {
+ const char* __nptr = std::getenv("GLIBCXX_DEBUG_MESSAGE_LENGTH");
+ if (__nptr)
+ {
+ char* __endptr;
+ const unsigned long __ret = std::strtoul(__nptr, &__endptr, 0);
+ if (*__nptr != '\0' && *__endptr == '\0')
+ _M_max_length = __ret;
+ }
+ }
+
// Instantiations.
template
void
known_versions.push_back("GLIBCXX_3.4.7");
known_versions.push_back("GLIBCXX_3.4.8");
known_versions.push_back("GLIBCXX_3.4.9");
+ known_versions.push_back("GLIBCXX_3.4.10");
known_versions.push_back("GLIBCXX_LDBL_3.4");
known_versions.push_back("GLIBCXX_LDBL_3.4.7");
known_versions.push_back("CXXABI_1.3");