summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-31 18:31:55 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-31 18:31:55 +0000
commit1b62e105b34ccbdbb38708cef131d63e572d3534 (patch)
tree07fb37b8945139d4509207d3e5627f874b25c841 /libstdc++-v3
parent5eeb9cf74f18206542bc125a867ec0e018c9b74c (diff)
downloadgcc-1b62e105b34ccbdbb38708cef131d63e572d3534.tar.gz
2005-05-31 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/20534 (contd) * include/debug/macros.h: Add _GLIBCXX_DEBUG_ABORT, using __gnu_debug::__fancy_abort. * src/debug.cc: Define the latter. * include/debug/debug.h: Use _GLIBCXX_DEBUG_ABORT instead of assert. * config/linker-map.gnu (__gnu_debug::__fancy_abort): Add. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100405 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog10
-rw-r--r--libstdc++-v3/config/linker-map.gnu1
-rw-r--r--libstdc++-v3/include/debug/debug.h9
-rw-r--r--libstdc++-v3/include/debug/macros.h12
-rw-r--r--libstdc++-v3/src/debug.cc9
5 files changed, 33 insertions, 8 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 31357005d89..4660ce9693e 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,13 @@
+2005-05-31 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/20534 (contd)
+ * include/debug/macros.h: Add _GLIBCXX_DEBUG_ABORT, using
+ __gnu_debug::__fancy_abort.
+ * src/debug.cc: Define the latter.
+ * include/debug/debug.h: Use _GLIBCXX_DEBUG_ABORT instead of
+ assert.
+ * config/linker-map.gnu (__gnu_debug::__fancy_abort): Add.
+
2005-05-30 Paolo Carlini <pcarlini@suse.de>
* include/std/std_complex.h (log(const complex<_Tp>&)): When
diff --git a/libstdc++-v3/config/linker-map.gnu b/libstdc++-v3/config/linker-map.gnu
index 769e5fe96a6..a9d20abe21e 100644
--- a/libstdc++-v3/config/linker-map.gnu
+++ b/libstdc++-v3/config/linker-map.gnu
@@ -310,6 +310,7 @@ GLIBCXX_3.4.5 {
_ZNSt8ios_base17_M_call_callbacksENS_5eventE;
_ZNSt8ios_base20_M_dispose_callbacksEv;
_ZNSt6locale5facet13_S_get_c_nameEv;
+ _ZN11__gnu_debug13__fancy_abortEPKciS1_S1_;
} GLIBCXX_3.4.4;
diff --git a/libstdc++-v3/include/debug/debug.h b/libstdc++-v3/include/debug/debug.h
index b4ffb6f62a8..7cd08cdeca0 100644
--- a/libstdc++-v3/include/debug/debug.h
+++ b/libstdc++-v3/include/debug/debug.h
@@ -41,15 +41,10 @@
#ifdef _GLIBCXX_DEBUG
# include <debug/macros.h>
-
-// The debug mode requires assert functionality, but keep this include
-// conditionalized, so that non-debug use doesn't mandate exposure to the
-// assert macro.
-# include <cassert>
-# define _GLIBCXX_DEBUG_ASSERT(_Condition) assert(_Condition)
+# define _GLIBCXX_DEBUG_ASSERT(_Condition) _GLIBCXX_DEBUG_ABORT(_Condition)
# ifdef _GLIBCXX_DEBUG_PEDANTIC
-# define _GLIBCXX_DEBUG_PEDASSERT(_Condition) assert(_Condition)
+# define _GLIBCXX_DEBUG_PEDASSERT(_Condition) _GLIBCXX_DEBUG_ABORT(_Condition)
# else
# define _GLIBCXX_DEBUG_PEDASSERT(_Condition)
# endif
diff --git a/libstdc++-v3/include/debug/macros.h b/libstdc++-v3/include/debug/macros.h
index c89ff9e84e4..3fe60c9df9a 100644
--- a/libstdc++-v3/include/debug/macros.h
+++ b/libstdc++-v3/include/debug/macros.h
@@ -40,7 +40,17 @@
* the user error and where the error is reported.
*
*/
-#define _GLIBCXX_DEBUG_VERIFY(_Condition,_ErrorMessage) \
+namespace __gnu_debug
+{ void __fancy_abort(const char*, int, const char*, const char*); }
+#define _GLIBCXX_DEBUG_ABORT(_Condition) \
+ do { \
+ if (! (_Condition)) \
+ ::__gnu_debug::__fancy_abort(__FILE__, __LINE__, \
+ __PRETTY_FUNCTION__, \
+ #_Condition); \
+ } while (false)
+
+#define _GLIBCXX_DEBUG_VERIFY(_Condition,_ErrorMessage) \
do { \
if (! (_Condition)) \
::__gnu_debug::_Error_formatter::_M_at(__FILE__, __LINE__) \
diff --git a/libstdc++-v3/src/debug.cc b/libstdc++-v3/src/debug.cc
index 3375adf1f47..621a1c96727 100644
--- a/libstdc++-v3/src/debug.cc
+++ b/libstdc++-v3/src/debug.cc
@@ -48,6 +48,15 @@ namespace __gnu_internal
namespace __gnu_debug
{
+ void
+ __fancy_abort(const char* __file, int __line, const char* __function,
+ const char* __condition)
+ {
+ printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line,
+ __function, __condition);
+ abort();
+ }
+
const char* _S_debug_messages[] =
{
"function requires a valid iterator range [%1.name;, %2.name;)",