summaryrefslogtreecommitdiff
path: root/libstdc++-v3/src/debug.cc
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-04 00:09:22 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-04 00:09:22 +0000
commit430c0e5ee45c6156a69e3659a6501ca3169472e5 (patch)
tree8ff9db26af07bc74278effa0664ea1f0734438bf /libstdc++-v3/src/debug.cc
parent4e1f92f7988dd2601c86d61914d9c512f25d9503 (diff)
downloadgcc-430c0e5ee45c6156a69e3659a6501ca3169472e5.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126287 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/src/debug.cc')
-rw-r--r--libstdc++-v3/src/debug.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/libstdc++-v3/src/debug.cc b/libstdc++-v3/src/debug.cc
index 4129f686667..0391368a131 100644
--- a/libstdc++-v3/src/debug.cc
+++ b/libstdc++-v3/src/debug.cc
@@ -36,6 +36,7 @@
#include <cstring>
#include <cctype>
#include <cstdio>
+#include <cstdlib>
using namespace std;
@@ -496,7 +497,8 @@ namespace __gnu_debug
_M_column += strlen(__buf);
}
- _M_wordwrap = true;
+ if (_M_max_length)
+ _M_wordwrap = true;
_M_print_word("error: ");
// Print the error message
@@ -671,6 +673,19 @@ namespace __gnu_debug
}
}
+ 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