|
From: Carlo W. <li...@us...> - 2002-01-20 23:31:30
|
CVSROOT : /cvsroot/libcw
Module : src
Commit time: 2002-00-20 23:31:28 UTC
Modified files:
libcwd/debug.cc libcwd/include/libcw/private_TSD.h
Log message:
Work in progress.
---------------------- diff included ----------------------
Index: src/libcwd/debug.cc
diff -u src/libcwd/debug.cc:1.56 src/libcwd/debug.cc:1.57
--- src/libcwd/debug.cc:1.56 Sun Jan 20 08:25:11 2002
+++ src/libcwd/debug.cc Sun Jan 20 15:31:18 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.56 2002/01/20 16:25:11 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.57 2002/01/20 23:31:18 libcw Exp $
//
// Copyright (C) 2000 - 2001, by
//
@@ -957,6 +957,8 @@
debug_tsd_st::~debug_tsd_st()
{
+ if (!tsd_initialized) // Don't de-initialize when it wasn't initialized.
+ return;
// Sanity checks:
if (continued_stack.size())
DoutFatal( dc::core|cerr_cf, "Destructing debug_tsd_st with a non-empty continued_stack (missing dc::finish?)" );
@@ -1320,15 +1322,20 @@
void assert_fail(char const* expr, char const* file, int line, char const* function)
{
-#ifdef DEBUGDEBUGMALLOC
+#ifdef DEBUGDEBUG
LIBCWD_TSD_DECLARATION
- if (__libcwd_tsd.recursive)
+ if (__libcwd_tsd.recursive_assert
+#ifdef DEBUGDEBUGMALLOC
+ || __libcwd_tsd.recursive
+#endif
+ )
{
set_alloc_checking_off(LIBCWD_TSD);
FATALDEBUGDEBUG_CERR(file << ':' << line << ": " << function << ": Assertion `" << expr << "' failed.\n");
set_alloc_checking_on(LIBCWD_TSD);
core_dump();
}
+ __libcwd_tsd.recursive_assert = true;
#endif
DoutFatal(dc::core, file << ':' << line << ": " << function << ": Assertion `" << expr << "' failed.\n");
}
Index: src/libcwd/include/libcw/private_TSD.h
diff -u src/libcwd/include/libcw/private_TSD.h:1.5 src/libcwd/include/libcw/private_TSD.h:1.6
--- src/libcwd/include/libcw/private_TSD.h:1.5 Fri Jan 18 21:08:54 2002
+++ src/libcwd/include/libcw/private_TSD.h Sun Jan 20 15:31:18 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_TSD.h,v 1.5 2002/01/19 05:08:54 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_TSD.h,v 1.6 2002/01/20 23:31:18 libcw Exp $
//
// Copyright (C) 2001, by
//
@@ -71,13 +71,16 @@
int internal;
int library_call;
#ifdef DEBUGDEBUGMALLOC
- int recursive; // Used for sanity double checks (also used in debug.cc now).
int marker;
+ int recursive; // Used for sanity double checks in debugmalloc.cc.
#endif
#endif // DEBUGMALLOC
- bool recursive_fatal;
+ bool recursive_fatal; // Detect loop involving dc::fatal or dc::core.
+#ifdef DEBUGDEBUG
+ bool recursive_assert; // Detect loop involving LIBCWD_ASSERT.
+#endif
#ifdef LIBCWD_THREAD_SAFE // Directly contained in debug_ct when not threaded.
- debug_tsd_st do_array[16];
+ debug_tsd_st do_array[16]; // Thread Specific Data of Debug Objects.
#endif
int off_cnt_array[256];
TSD_st(void) { std::memset(this, 0, sizeof(struct TSD_st)); }
----------------------- End of diff -----------------------
|