Thread: [libcw-cvs] [CVS] Module src (Page 7)
Abandoned project
Status: Beta
Brought to you by:
libcw
|
From: Carlo W. <li...@us...> - 2002-02-19 03:12:58
|
CVSROOT : /cvsroot/libcw
Module : src
Commit time: 2002-01-19 03:12:57 UTC
Modified files:
libcwd/documentation/environment.dox
Log message:
Forgot to remove ALWAYS_ in documentation :/
---------------------- diff included ----------------------
Index: src/libcwd/documentation/environment.dox
diff -u src/libcwd/documentation/environment.dox:1.1 src/libcwd/documentation/environment.dox:1.2
--- src/libcwd/documentation/environment.dox:1.1 Sat Feb 9 18:42:16 2002
+++ src/libcwd/documentation/environment.dox Mon Feb 18 19:12:47 2002
@@ -9,7 +9,7 @@
<dl compact>
<dt>LIBCWD_NO_STARTUP_MSGS<dd>Don't print anything before main().
-<dt>LIBCWD_ALWAYS_PRINT_LOADING<dd>Print messages about loading
+<dt>LIBCWD_PRINT_LOADING<dd>Print messages about loading
the shared libraries, even when this is done before libcw_do
is turned on (except when LIBCWD_NO_STARTUP_MSGS is defined).
</dl>
----------------------- End of diff -----------------------
|
|
From: Carlo W. <li...@us...> - 2002-02-19 03:18:42
|
CVSROOT : /cvsroot/libcw
Module : src
Commit time: 2002-01-19 03:18:40 UTC
Modified files:
libcwd/INSTALL libcwd/configure.in
libcwd/documentation/doxygen.config
Log message:
Bumped version number.
---------------------- diff included ----------------------
Index: src/libcwd/INSTALL
diff -u src/libcwd/INSTALL:1.25 src/libcwd/INSTALL:1.26
--- src/libcwd/INSTALL:1.25 Thu Feb 14 21:36:09 2002
+++ src/libcwd/INSTALL Mon Feb 18 19:18:30 2002
@@ -55,7 +55,7 @@
Don't delete those libraries if you have them though
since existing binaries might need to link with them.
-libcwd-0.99.17 was tested with gcc-2.95.x, gcc-2.96-98 (RedHat)
+libcwd-0.99.18 was tested with gcc-2.95.x, gcc-2.96-98 (RedHat)
and gcc-3.0.x.
Packages needed to run the testsuite
@@ -178,10 +178,10 @@
Finally, you can also build libcwd in a different directory than the source
tree is in:
-tar xzf libcwd-0.99.17.tar.gz
+tar xzf libcwd-0.99.18.tar.gz
mkdir libcwd-objdir
cd libcwd-objdir
-../libcwd-0.99.17/configure --prefix=/usr
+../libcwd-0.99.18/configure --prefix=/usr
make
su
make install
Index: src/libcwd/configure.in
diff -u src/libcwd/configure.in:1.105 src/libcwd/configure.in:1.106
--- src/libcwd/configure.in:1.105 Thu Feb 14 21:36:09 2002
+++ src/libcwd/configure.in Mon Feb 18 19:18:30 2002
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-AC_REVISION($Revision: 1.105 $)dnl
+AC_REVISION($Revision: 1.106 $)dnl
dnl General intialization of `autoconf' varaibles.
dnl Ensure that the directory specified with --srcdir was correct
@@ -22,7 +22,7 @@
dnl INTERFACE_AGE : Increment if interfaces have been added; or set to 0 when interfaces have been removed.
INTERFACE_VERSION=99 dnl 0.99 actually
-INTERFACE_VERSION_REVISION=17
+INTERFACE_VERSION_REVISION=18
INTERFACE_AGE=99 dnl 0.99 actually
VERSION_MAJOR=`expr $INTERFACE_VERSION - $INTERFACE_AGE`
Index: src/libcwd/documentation/doxygen.config
diff -u src/libcwd/documentation/doxygen.config:1.4 src/libcwd/documentation/doxygen.config:1.5
--- src/libcwd/documentation/doxygen.config:1.4 Thu Feb 14 21:36:09 2002
+++ src/libcwd/documentation/doxygen.config Mon Feb 18 19:18:30 2002
@@ -4,7 +4,7 @@
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = libcwd
-PROJECT_NUMBER = "libcwd 0.99.17"
+PROJECT_NUMBER = "libcwd 0.99.18"
OUTPUT_DIRECTORY =
OUTPUT_LANGUAGE = English
EXTRACT_ALL = NO
----------------------- End of diff -----------------------
|
|
From: Carlo W. <li...@us...> - 2002-02-20 03:56:04
|
CVSROOT : /cvsroot/libcw
Module : src
Commit time: 2002-01-20 03:56:02 UTC
Modified files:
libcwd/NEWS libcwd/bfd.cc libcwd/debugmalloc.cc
libcwd/include/libcw/bfd.h libcwd/include/libcw/debug.h
libcwd/include/libcw/debug_config.ho.in
libcwd/include/libcw/debugmalloc.h
libcwd/include/libcw/macro_AllocTag.h
libcwd/include/libcw/macro_Libcwd_macros.h
libcwd/include/libcw/private_allocator.h
Log message:
Renamed macros to LIBCWD_*.
---------------------- diff included ----------------------
Index: src/libcwd/NEWS
diff -u src/libcwd/NEWS:1.73 src/libcwd/NEWS:1.74
--- src/libcwd/NEWS:1.73 Sun Feb 17 22:08:05 2002
+++ src/libcwd/NEWS Tue Feb 19 19:55:51 2002
@@ -1,3 +1,5 @@
+libcwd-0.99.18
+
libcwd-0.99.17
A tutorial on debugging threaded applications was added.
Index: src/libcwd/bfd.cc
diff -u src/libcwd/bfd.cc:1.104 src/libcwd/bfd.cc:1.105
--- src/libcwd/bfd.cc:1.104 Sun Feb 17 17:24:46 2002
+++ src/libcwd/bfd.cc Tue Feb 19 19:55:51 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.104 2002/02/18 01:24:46 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.105 2002/02/20 03:55:51 libcw Exp $
//
// Copyright (C) 2000 - 2002, by
//
@@ -49,7 +49,7 @@
#endif
#include "cwd_debug.h"
#include "ios_base_Init.h"
-#ifdef CWDEBUG_DLOPEN_DEFINED
+#ifdef LIBCWD_DLOPEN_DEFINED
#undef dlopen
#undef dlclose
#endif
@@ -1429,7 +1429,7 @@
} // namespace debug
} // namespace libcw
-#ifdef CWDEBUG_DLOPEN_DEFINED
+#ifdef LIBCWD_DLOPEN_DEFINED
using namespace libcw::debug;
struct dlloaded_st {
@@ -1527,6 +1527,6 @@
}
} // extern "C"
-#endif // CWDEBUG_DLOPEN_DEFINED
+#endif // LIBCWD_DLOPEN_DEFINED
#endif // !DEBUGUSEBFD
Index: src/libcwd/debugmalloc.cc
diff -u src/libcwd/debugmalloc.cc:1.84 src/libcwd/debugmalloc.cc:1.85
--- src/libcwd/debugmalloc.cc:1.84 Sun Feb 17 17:24:46 2002
+++ src/libcwd/debugmalloc.cc Tue Feb 19 19:55:51 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.84 2002/02/18 01:24:46 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.85 2002/02/20 03:55:51 libcw Exp $
//
// Copyright (C) 2000 - 2002, by
//
@@ -186,7 +186,7 @@
#define ACQUIRE_WRITE2READ_LOCK
#endif // !LIBCWD_THREAD_SAFE
-#ifdef DEBUGMALLOCEXTERNALCLINKAGE
+#ifdef LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC
#define __libcwd_malloc malloc
#define __libcwd_calloc calloc
#define __libcwd_realloc realloc
@@ -398,7 +398,7 @@
// _private_::
void set_alloc_checking_off(LIBCWD_TSD_PARAM)
{
- DEBUGDEBUGMALLOC_CERR( "set_alloc_checking_off called from " << __builtin_return_address(0) << ": internal == " << __libcwd_tsd.internal << "; setting it to " << __libcwd_tsd.internal + 1 << '.' );
+ LIBCWD_DEBUGM_CERR( "set_alloc_checking_off called from " << __builtin_return_address(0) << ": internal == " << __libcwd_tsd.internal << "; setting it to " << __libcwd_tsd.internal + 1 << '.' );
++__libcwd_tsd.internal;
}
@@ -407,7 +407,7 @@
{
if (__libcwd_tsd.internal == 0)
DoutFatal( dc::core, "Calling `set_alloc_checking_on' while ALREADY on." );
- DEBUGDEBUGMALLOC_CERR( "set_alloc_checking_on from " << __builtin_return_address(0) << ": internal == " << __libcwd_tsd.internal << "; setting it to " << __libcwd_tsd.internal - 1 << '.' );
+ LIBCWD_DEBUGM_CERR( "set_alloc_checking_on from " << __builtin_return_address(0) << ": internal == " << __libcwd_tsd.internal << "; setting it to " << __libcwd_tsd.internal - 1 << '.' );
--__libcwd_tsd.internal;
}
#endif
@@ -998,7 +998,7 @@
dm_alloc_ct* ap = a_alloc_node.get();
#ifdef DEBUGDEBUGMALLOC
if (ap)
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: memblk_info_ct::erase for " << ap->start() );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: memblk_info_ct::erase for " << ap->start() );
#endif
if (ap && ap->next_list())
{
@@ -1262,11 +1262,11 @@
// We can't use `assert' here, because that can call malloc.
if (__libcwd_tsd.inside_malloc_or_free > __libcwd_tsd.library_call && !__libcwd_tsd.internal)
{
- DEBUGDEBUGMALLOC_CERR("DEBUGDEBUGMALLOC: debugmalloc.cc:" << __LINE__ - 2 << ": " << __PRETTY_FUNCTION__ << ": Assertion `__libcwd_tsd.inside_malloc_or_free <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed.");
+ LIBCWD_DEBUGM_CERR("DEBUGDEBUGMALLOC: debugmalloc.cc:" << __LINE__ - 2 << ": " << __PRETTY_FUNCTION__ << ": Assertion `__libcwd_tsd.inside_malloc_or_free <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed.");
core_dump();
}
#endif
-#if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(DEBUGMALLOCEXTERNALCLINKAGE)
+#if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC)
LIBCWD_ASSERT( _private_::WST_ios_base_initialized || __libcwd_tsd.internal );
#endif
if (__libcwd_tsd.internal)
@@ -1274,15 +1274,15 @@
#if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT)
if (from == from_delete)
{
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal `delete(" << ptr << ")' [" << ++__libcwd_tsd.marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal `delete(" << ptr << ")' [" << ++__libcwd_tsd.marker << ']' );
}
else if (from == from_delete_array)
{
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal `delete[](" << ptr << ")' [" << ++__libcwd_tsd.marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal `delete[](" << ptr << ")' [" << ++__libcwd_tsd.marker << ']' );
}
else
{
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal `free(" << ptr << ")' [" << ++__libcwd_tsd.marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal `free(" << ptr << ")' [" << ++__libcwd_tsd.marker << ']' );
}
#endif // DEBUGDEBUGMALLOC
#ifdef DEBUGMAGICMALLOC
@@ -2027,7 +2027,7 @@
#endif // DEBUGDEBUGMALLOC
-#ifndef DEBUGMALLOCEXTERNALCLINKAGE
+#ifndef LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC
// If we cannot call the libc malloc functions directly, then we cannot declare
// a malloc function with external linkage but instead have to use a macro `malloc'
@@ -2099,7 +2099,7 @@
#endif
--__libcwd_tsd.inside_malloc_or_free;
}
-#endif // !DEBUGMALLOCEXTERNALCLINKAGE
+#endif // !LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC
} // namespace debug
} // namespace libcw
@@ -2146,12 +2146,12 @@
int saved_marker = ++__libcwd_tsd.marker;
#endif
#endif
-#if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(DEBUGMALLOCEXTERNALCLINKAGE)
+#if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC)
LIBCWD_ASSERT( _private_::WST_ios_base_initialized || __libcwd_tsd.internal );
#endif
if (__libcwd_tsd.internal)
{
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Entering `__libcwd_malloc(" << size << ")' [" << saved_marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Entering `__libcwd_malloc(" << size << ")' [" << saved_marker << ']' );
#if !defined(DEBUGDEBUGMALLOC) && !defined(DEBUGMAGICMALLOC)
return __libc_malloc(size);
@@ -2159,7 +2159,7 @@
#ifndef DEBUGMAGICMALLOC
void* ptr = __libc_malloc(size);
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_malloc': " << ptr << " [" << saved_marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_malloc': " << ptr << " [" << saved_marker << ']' );
return ptr;
#else // DEBUGMAGICMALLOC
void* ptr = __libc_malloc(SIZE_PLUS_TWELVE(size));
@@ -2168,7 +2168,7 @@
((size_t*)ptr)[0] = INTERNAL_MAGIC_MALLOC_BEGIN;
((size_t*)ptr)[1] = size;
((size_t*)(static_cast<char*>(ptr) + SIZE_PLUS_TWELVE(size)))[-1] = INTERNAL_MAGIC_MALLOC_END;
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_malloc': " << static_cast<size_t*>(ptr) + 2 << " [" << saved_marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_malloc': " << static_cast<size_t*>(ptr) + 2 << " [" << saved_marker << ']' );
return static_cast<size_t*>(ptr) + 2;
#endif // DEBUGMAGICMALLOC
@@ -2201,19 +2201,19 @@
// We can't use `assert' here, because that can call malloc.
if (__libcwd_tsd.inside_malloc_or_free > __libcwd_tsd.library_call && !__libcwd_tsd.internal)
{
- DEBUGDEBUGMALLOC_CERR("DEBUGDEBUGMALLOC: debugmalloc.cc:" << __LINE__ - 2 << ": " << __PRETTY_FUNCTION__ << ": Assertion `__libcwd_tsd.inside_malloc_or_free <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed.");
+ LIBCWD_DEBUGM_CERR("DEBUGDEBUGMALLOC: debugmalloc.cc:" << __LINE__ - 2 << ": " << __PRETTY_FUNCTION__ << ": Assertion `__libcwd_tsd.inside_malloc_or_free <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed.");
core_dump();
}
#ifdef DEBUGDEBUGOUTPUT
int saved_marker = ++__libcwd_tsd.marker;
#endif
#endif
-#if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(DEBUGMALLOCEXTERNALCLINKAGE)
+#if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC)
LIBCWD_ASSERT( _private_::WST_ios_base_initialized || __libcwd_tsd.internal );
#endif
if (__libcwd_tsd.internal)
{
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Entering `__libcwd_calloc(" << nmemb << ", " << size << ")' [" << saved_marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Entering `__libcwd_calloc(" << nmemb << ", " << size << ")' [" << saved_marker << ']' );
#if !defined(DEBUGDEBUGMALLOC) && !defined(DEBUGMAGICMALLOC)
return __libc_calloc(nmemb, size);
@@ -2221,7 +2221,7 @@
#ifndef DEBUGMAGICMALLOC
void* ptr = __libc_calloc(nmemb, size);
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_calloc': " << ptr << " [" << saved_marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_calloc': " << ptr << " [" << saved_marker << ']' );
return ptr;
#else // DEBUGMAGICMALLOC
void* ptr = __libc_malloc(SIZE_PLUS_TWELVE(nmemb * size));
@@ -2231,7 +2231,7 @@
((size_t*)ptr)[0] = INTERNAL_MAGIC_MALLOC_BEGIN;
((size_t*)ptr)[1] = nmemb * size;
((size_t*)(static_cast<char*>(ptr) + SIZE_PLUS_TWELVE(nmemb * size)))[-1] = INTERNAL_MAGIC_MALLOC_END;
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_calloc': " << static_cast<size_t*>(ptr) + 2 << " [" << saved_marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_calloc': " << static_cast<size_t*>(ptr) + 2 << " [" << saved_marker << ']' );
return static_cast<size_t*>(ptr) + 2;
#endif // DEBUGMAGICMALLOC
@@ -2274,19 +2274,19 @@
// We can't use `assert' here, because that can call malloc.
if (__libcwd_tsd.inside_malloc_or_free > __libcwd_tsd.library_call && !__libcwd_tsd.internal)
{
- DEBUGDEBUGMALLOC_CERR("DEBUGDEBUGMALLOC: debugmalloc.cc:" << __LINE__ - 2 << ": " << __PRETTY_FUNCTION__ << ": Assertion `__libcwd_tsd.inside_malloc_or_free <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed.");
+ LIBCWD_DEBUGM_CERR("DEBUGDEBUGMALLOC: debugmalloc.cc:" << __LINE__ - 2 << ": " << __PRETTY_FUNCTION__ << ": Assertion `__libcwd_tsd.inside_malloc_or_free <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed.");
core_dump();
}
#ifdef DEBUGDEBUGOUTPUT
int saved_marker = ++__libcwd_tsd.marker;
#endif
#endif
-#if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(DEBUGMALLOCEXTERNALCLINKAGE)
+#if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC)
LIBCWD_ASSERT( _private_::WST_ios_base_initialized || __libcwd_tsd.internal );
#endif
if (__libcwd_tsd.internal)
{
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Entering `__libcwd_realloc(" << ptr << ", " << size << ")' [" << saved_marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Entering `__libcwd_realloc(" << ptr << ", " << size << ")' [" << saved_marker << ']' );
#if !defined(DEBUGDEBUGMALLOC) && !defined(DEBUGMAGICMALLOC)
return __libc_realloc(ptr, size);
@@ -2294,7 +2294,7 @@
#ifndef DEBUGMAGICMALLOC
void* ptr1 = __libc_realloc(ptr, size);
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_realloc': " << ptr1 << " [" << saved_marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_realloc': " << ptr1 << " [" << saved_marker << ']' );
return ptr1;
#else // DEBUGMAGICMALLOC
void* ptr1;
@@ -2307,7 +2307,7 @@
if (size == 0)
{
__libc_free(ptr);
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_realloc': NULL [" << saved_marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_realloc': NULL [" << saved_marker << ']' );
return NULL;
}
ptr1 = __libc_realloc(ptr, SIZE_PLUS_TWELVE(size));
@@ -2317,7 +2317,7 @@
((size_t*)ptr1)[0] = INTERNAL_MAGIC_MALLOC_BEGIN;
((size_t*)ptr1)[1] = size;
((size_t*)(static_cast<char*>(ptr1) + SIZE_PLUS_TWELVE(size)))[-1] = INTERNAL_MAGIC_MALLOC_END;
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_realloc': " << static_cast<size_t*>(ptr1) + 2 << " [" << saved_marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_realloc': " << static_cast<size_t*>(ptr1) + 2 << " [" << saved_marker << ']' );
return static_cast<size_t*>(ptr1) + 2;
#endif // DEBUGMAGICMALLOC
@@ -2486,7 +2486,7 @@
// We can't use `assert' here, because that can call malloc.
if (__libcwd_tsd.inside_malloc_or_free > __libcwd_tsd.library_call && !__libcwd_tsd.internal)
{
- DEBUGDEBUGMALLOC_CERR("DEBUGDEBUGMALLOC: debugmalloc.cc:" << __LINE__ - 2 << ": " << __PRETTY_FUNCTION__ << ": Assertion `__libcwd_tsd.inside_malloc_or_free <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed.");
+ LIBCWD_DEBUGM_CERR("DEBUGDEBUGMALLOC: debugmalloc.cc:" << __LINE__ - 2 << ": " << __PRETTY_FUNCTION__ << ": Assertion `__libcwd_tsd.inside_malloc_or_free <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed.");
core_dump();
}
#ifdef DEBUGDEBUGOUTPUT
@@ -2495,7 +2495,7 @@
#endif
if (__libcwd_tsd.internal)
{
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Entering `operator new', size = " << size << " [" << saved_marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Entering `operator new', size = " << size << " [" << saved_marker << ']' );
#if !defined(DEBUGDEBUGMALLOC) && !defined(DEBUGMAGICMALLOC)
return __libc_malloc(size);
@@ -2505,7 +2505,7 @@
void* ptr = __libc_malloc(size);
if (!ptr)
DoutFatalInternal( dc::core, "Out of memory in `operator new'" );
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `operator new': " << ptr << " [" << saved_marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `operator new': " << ptr << " [" << saved_marker << ']' );
return ptr;
#else // DEBUGMAGICMALLOC
void* ptr = __libc_malloc(SIZE_PLUS_TWELVE(size));
@@ -2514,7 +2514,7 @@
((size_t*)ptr)[0] = INTERNAL_MAGIC_NEW_BEGIN;
((size_t*)ptr)[1] = size;
((size_t*)(static_cast<char*>(ptr) + SIZE_PLUS_TWELVE(size)))[-1] = INTERNAL_MAGIC_NEW_END;
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `operator new': " << static_cast<size_t*>(ptr) + 2 << " [" << saved_marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `operator new': " << static_cast<size_t*>(ptr) + 2 << " [" << saved_marker << ']' );
return static_cast<size_t*>(ptr) + 2;
#endif // DEBUGMAGICMALLOC
@@ -2549,7 +2549,7 @@
// We can't use `assert' here, because that can call malloc.
if (__libcwd_tsd.inside_malloc_or_free > __libcwd_tsd.library_call && !__libcwd_tsd.internal)
{
- DEBUGDEBUGMALLOC_CERR("DEBUGDEBUGMALLOC: debugmalloc.cc:" << __LINE__ - 2 << ": " << __PRETTY_FUNCTION__ << ": Assertion `__libcwd_tsd.inside_malloc_or_free <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed.");
+ LIBCWD_DEBUGM_CERR("DEBUGDEBUGMALLOC: debugmalloc.cc:" << __LINE__ - 2 << ": " << __PRETTY_FUNCTION__ << ": Assertion `__libcwd_tsd.inside_malloc_or_free <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed.");
core_dump();
}
#ifdef DEBUGDEBUGOUTPUT
@@ -2558,7 +2558,7 @@
#endif
if (__libcwd_tsd.internal)
{
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Entering `operator new[]', size = " << size << " [" << saved_marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Entering `operator new[]', size = " << size << " [" << saved_marker << ']' );
#if !defined(DEBUGDEBUGMALLOC) && !defined(DEBUGMAGICMALLOC)
return __libc_malloc(size);
@@ -2568,7 +2568,7 @@
void* ptr = __libc_malloc(size);
if (!ptr)
DoutFatalInternal( dc::core, "Out of memory in `operator new[]'" );
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `operator new[]': " << ptr << " [" << saved_marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `operator new[]': " << ptr << " [" << saved_marker << ']' );
return ptr;
#else // DEBUGMAGICMALLOC
void* ptr = __libc_malloc(SIZE_PLUS_TWELVE(size));
@@ -2577,7 +2577,7 @@
((size_t*)ptr)[0] = INTERNAL_MAGIC_NEW_ARRAY_BEGIN;
((size_t*)ptr)[1] = size;
((size_t*)(static_cast<char*>(ptr) + SIZE_PLUS_TWELVE(size)))[-1] = INTERNAL_MAGIC_NEW_ARRAY_END;
- DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `operator new[]': " << static_cast<size_t*>(ptr) + 2 << " [" << saved_marker << ']' );
+ LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `operator new[]': " << static_cast<size_t*>(ptr) + 2 << " [" << saved_marker << ']' );
return static_cast<size_t*>(ptr) + 2;
#endif // DEBUGMAGICMALLOC
@@ -2617,11 +2617,11 @@
// We can't use `assert' here, because that can call malloc.
if (__libcwd_tsd.inside_malloc_or_free > __libcwd_tsd.library_call && !__libcwd_tsd.internal)
{
- DEBUGDEBUGMALLOC_CERR("DEBUGDEBUGMALLOC: debugmalloc.cc:" << __LINE__ - 2 << ": " << __PRETTY_FUNCTION__ << ": Assertion `__libcwd_tsd.inside_malloc_or_free <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed.");
+ LIBCWD_DEBUGM_CERR("DEBUGDEBUGMALLOC: debugmalloc.cc:" << __LINE__ - 2 << ": " << __PRETTY_FUNCTION__ << ": Assertion `__libcwd_tsd.inside_malloc_or_free <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed.");
core_dump();
}
#endif
-#if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(DEBUGMALLOCEXTERNALCLINKAGE)
+#if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC)
LIBCWD_ASSERT( _private_::WST_ios_base_initialized || __libcwd_tsd.internal );
#endif
internal_free(ptr, from_delete LIBCWD_COMMA_TSD);
@@ -2634,11 +2634,11 @@
// We can't use `assert' here, because that can call malloc.
if (__libcwd_tsd.inside_malloc_or_free > __libcwd_tsd.library_call && !__libcwd_tsd.internal)
{
- DEBUGDEBUGMALLOC_CERR("DEBUGDEBUGMALLOC: debugmalloc.cc:" << __LINE__ - 2 << ": " << __PRETTY_FUNCTION__ << ": Assertion `__libcwd_tsd.inside_malloc_or_free <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed.");
+ LIBCWD_DEBUGM_CERR("DEBUGDEBUGMALLOC: debugmalloc.cc:" << __LINE__ - 2 << ": " << __PRETTY_FUNCTION__ << ": Assertion `__libcwd_tsd.inside_malloc_or_free <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed.");
core_dump();
}
#endif
-#if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(DEBUGMALLOCEXTERNALCLINKAGE)
+#if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC)
LIBCWD_ASSERT( _private_::WST_ios_base_initialized || __libcwd_tsd.internal );
#endif
internal_free(ptr, from_delete_array LIBCWD_COMMA_TSD); // Note that the standard demands that we call free(), and not delete().
Index: src/libcwd/include/libcw/bfd.h
diff -u src/libcwd/include/libcw/bfd.h:1.23 src/libcwd/include/libcw/bfd.h:1.24
--- src/libcwd/include/libcw/bfd.h:1.23 Sun Feb 17 17:24:47 2002
+++ src/libcwd/include/libcw/bfd.h Tue Feb 19 19:55:52 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/bfd.h,v 1.23 2002/02/18 01:24:47 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/bfd.h,v 1.24 2002/02/20 03:55:52 libcw Exp $
//
// Copyright (C) 2000 - 2002, by
//
@@ -28,13 +28,13 @@
#include <libcw/pc_mangled_function_name.h>
#endif
-#ifdef CWDEBUG_DLOPEN_DEFINED
+#ifdef LIBCWD_DLOPEN_DEFINED
#include <dlfcn.h>
#define dlopen __libcwd_dlopen
#define dlclose __libcwd_dlclose
extern "C" void* dlopen(char const*, int);
extern "C" int dlclose(void*);
-#endif // CWDEBUG_DLOPEN_DEFINED
+#endif // LIBCWD_DLOPEN_DEFINED
// Include the inline functions.
#ifndef LIBCW_CLASS_LOCATION_INL
Index: src/libcwd/include/libcw/debug.h
diff -u src/libcwd/include/libcw/debug.h:1.43 src/libcwd/include/libcw/debug.h:1.44
--- src/libcwd/include/libcw/debug.h:1.43 Sun Feb 17 17:24:47 2002
+++ src/libcwd/include/libcw/debug.h Tue Feb 19 19:55:52 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debug.h,v 1.43 2002/02/18 01:24:47 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debug.h,v 1.44 2002/02/20 03:55:52 libcw Exp $
//
// Copyright (C) 2000 - 2002, by
//
@@ -80,7 +80,7 @@
extern channel_ct system;
extern channel_ct warning;
#ifdef DEBUGMALLOC
-#ifdef DEBUGMALLOCEXTERNALCLINKAGE
+#ifdef LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC
extern channel_ct malloc;
#else
extern channel_ct __libcwd_malloc;
Index: src/libcwd/include/libcw/debug_config.ho.in
diff -u src/libcwd/include/libcw/debug_config.ho.in:1.20 src/libcwd/include/libcw/debug_config.ho.in:1.21
--- src/libcwd/include/libcw/debug_config.ho.in:1.20 Sun Feb 17 17:24:47 2002
+++ src/libcwd/include/libcw/debug_config.ho.in Tue Feb 19 19:55:52 2002
@@ -1,5 +1,5 @@
// @configure_input@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debug_config.ho.in,v 1.20 2002/02/18 01:24:47 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debug_config.ho.in,v 1.21 2002/02/20 03:55:52 libcw Exp $
//
// Copyright (C) 2000 - 2002, by
//
@@ -270,12 +270,12 @@
#@CW_CONFIG_HAVE___LIBC_MALLOC@ LIBCWD_HAVE___LIBC_MALLOC
#@CW_CONFIG_HAVE__LIBC_MALLOC@ LIBCWD_HAVE__LIBC_MALLOC
#if defined(LIBCWD_HAVE___LIBC_MALLOC) || defined(LIBCWD_HAVE__LIBC_MALLOC)
-#define DEBUGMALLOCEXTERNALCLINKAGE
+#define LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC
#endif
#endif
#ifdef DEBUGUSEBFD
-#@CW_CONFIG_HAVE_DLOPEN@ CWDEBUG_DLOPEN_DEFINED
+#@CW_CONFIG_HAVE_DLOPEN@ LIBCWD_DLOPEN_DEFINED
#endif
#@CW_CONFIG_THREAD_SAFE@ LIBCWD_THREAD_SAFE
Index: src/libcwd/include/libcw/debugmalloc.h
diff -u src/libcwd/include/libcw/debugmalloc.h:1.30 src/libcwd/include/libcw/debugmalloc.h:1.31
--- src/libcwd/include/libcw/debugmalloc.h:1.30 Sun Feb 17 17:24:47 2002
+++ src/libcwd/include/libcw/debugmalloc.h Tue Feb 19 19:55:52 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debugmalloc.h,v 1.30 2002/02/18 01:24:47 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debugmalloc.h,v 1.31 2002/02/20 03:55:52 libcw Exp $
//
// Copyright (C) 2000 - 2002, by
//
@@ -113,9 +113,9 @@
#endif // !DEBUGMALLOC
#ifdef DEBUGDEBUGMALLOC
-#define DEBUGDEBUGMALLOC_CERR(x) DEBUGDEBUG_CERR(x)
+#define LIBCWD_DEBUGM_CERR(x) DEBUGDEBUG_CERR(x)
#else
-#define DEBUGDEBUGMALLOC_CERR(x)
+#define LIBCWD_DEBUGM_CERR(x)
#endif
namespace libcw {
@@ -133,7 +133,7 @@
#ifndef DEBUGMALLOC_INTERNAL
#ifdef DEBUGMALLOC
-#ifndef DEBUGMALLOCEXTERNALCLINKAGE
+#ifndef LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC
// Ugh, use kludge.
#include <cstdlib> // Make sure the prototypes for malloc et al are declared
// before defining the macros!
@@ -145,7 +145,7 @@
// Use external linkage to catch ALL calls to all malloc/calloc/realloc/free functions,
// also those that are done in libc, or any other shared library that might be linked.
-// [ Note: if DEBUGMALLOCEXTERNALCLINKAGE wasn't defined, then these are the prototypes
+// [ Note: if LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC wasn't defined, then these are the prototypes
// for __libcwd_malloc et al of course. We still use external "C" linkage in that case
// in order to avoid a collision with possibily later included prototypes for malloc. ]
#if __GNUC__ == 2 && __GNUC_MINOR__ < 96
@@ -159,7 +159,7 @@
#endif
extern "C" void free(void* ptr) throw();
-#ifndef DEBUGMALLOCEXTERNALCLINKAGE
+#ifndef LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC
// Use same kludge for other libc functions that return malloc-ed pointers.
#define strdup __libcwd_strdup
#ifdef HAVE_WMEMCPY
@@ -200,7 +200,7 @@
return p;
}
#endif // HAVE_WMEMCPY
-#endif // !DEBUGMALLOCEXTERNALCLINKAGE
+#endif // !LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC
#endif // DEBUGMALLOC
#endif // !DEBUG_INTERNAL
Index: src/libcwd/include/libcw/macro_AllocTag.h
diff -u src/libcwd/include/libcw/macro_AllocTag.h:1.8 src/libcwd/include/libcw/macro_AllocTag.h:1.9
--- src/libcwd/include/libcw/macro_AllocTag.h:1.8 Sun Feb 17 17:24:47 2002
+++ src/libcwd/include/libcw/macro_AllocTag.h Tue Feb 19 19:55:52 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/macro_AllocTag.h,v 1.8 2002/02/18 01:24:47 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/macro_AllocTag.h,v 1.9 2002/02/20 03:55:52 libcw Exp $
//
// Copyright (C) 2000 - 2002, by
//
@@ -57,7 +57,7 @@
extern void set_alloc_label(void const* ptr, type_info_ct const& ti, lockable_auto_ptr<char, true> description);
// For dynamic descriptions
// allocated with new[]
-#ifndef DEBUGMALLOCEXTERNALCLINKAGE
+#ifndef LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC
extern void register_external_allocation(void const* ptr, size_t size);
#endif
@@ -210,7 +210,7 @@
*/
#define NEW(x) __libcwd_allocCatcher(new x)
-#ifndef DEBUGMALLOCEXTERNALCLINKAGE
+#ifndef LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC
/**
* \brief Register an externally allocated memory block at position \a ptr with size \a size.
*/
@@ -229,7 +229,7 @@
#define AllocTag1(p)
#define AllocTag2(p, desc)
#define NEW(x) new x
-#ifndef DEBUGMALLOCEXTERNALCLINKAGE
+#ifndef LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC
#define RegisterExternalAlloc(p, s)
#endif
Index: src/libcwd/include/libcw/macro_Libcwd_macros.h
diff -u src/libcwd/include/libcw/macro_Libcwd_macros.h:1.6 src/libcwd/include/libcw/macro_Libcwd_macros.h:1.7
--- src/libcwd/include/libcw/macro_Libcwd_macros.h:1.6 Sun Feb 10 19:00:24 2002
+++ src/libcwd/include/libcw/macro_Libcwd_macros.h Tue Feb 19 19:55:52 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/macro_Libcwd_macros.h,v 1.6 2002/02/11 03:00:24 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/macro_Libcwd_macros.h,v 1.7 2002/02/20 03:55:52 libcw Exp $
//
// Copyright (C) 2000 - 2002, by
//
@@ -52,17 +52,17 @@
//
// This is debugging libcwd itself.
-#ifndef DEBUGDEBUGLIBCWDOUTMARKER
+#ifndef LIBCWD_LibcwDoutScopeBegin_MARKER
#ifdef DEBUGDEBUGOUTPUT
extern "C" ssize_t write(int fd, const void *buf, size_t count) throw();
#define LIBCWD_STR1(x) #x
#define LIBCWD_STR2(x) LIBCWD_STR1(x)
#define LIBCWD_STR3 "LibcwDout at " __FILE__ ":" LIBCWD_STR2(__LINE__) "\n"
-#define DEBUGDEBUGLIBCWDOUTMARKER LibcwDebugThreads( ++__libcwd_tsd.internal_debugging_code ); ::write(2, LIBCWD_STR3, sizeof(LIBCWD_STR3) - 1); LibcwDebugThreads( --__libcwd_tsd.internal_debugging_code );
+#define LIBCWD_LibcwDoutScopeBegin_MARKER LibcwDebugThreads( ++__libcwd_tsd.internal_debugging_code ); ::write(2, LIBCWD_STR3, sizeof(LIBCWD_STR3) - 1); LibcwDebugThreads( --__libcwd_tsd.internal_debugging_code );
#else // !DEBUGDEBUGOUTPUT
-#define DEBUGDEBUGLIBCWDOUTMARKER
+#define LIBCWD_LibcwDoutScopeBegin_MARKER
#endif // !DEBUGDEBUGOUTPUT
-#endif // !DEBUGDEBUGLIBCWDOUTMARKER
+#endif // !LIBCWD_LibcwDoutScopeBegin_MARKER
/**
* \brief General debug output macro.
@@ -81,7 +81,7 @@
do \
{ \
LIBCWD_TSD_DECLARATION \
- DEBUGDEBUGLIBCWDOUTMARKER \
+ LIBCWD_LibcwDoutScopeBegin_MARKER \
if (LIBCWD_DO_TSD_MEMBER_OFF(debug_obj) < 0) \
{ \
using namespace ::libcw::debug; \
@@ -111,14 +111,14 @@
//
// This is debugging libcwd itself.
-#ifndef DEBUGDEBUGLIBCWDOUTFATALMARKER
+#ifndef LIBCWD_LibcwDoutFatalScopeBegin_MARKER
#ifdef DEBUGDEBUGOUTPUT
#define LIBCWD_STR4 "LibcwDoutFatal at " __FILE__ ":" LIBCWD_STR2(__LINE__) "\n"
-#define DEBUGDEBUGLIBCWDOUTFATALMARKER LibcwDebugThreads( ++__libcwd_tsd.internal_debugging_code ); ::write(2, LIBCWD_STR4, sizeof(LIBCWD_STR4) - 1); LibcwDebugThreads( --__libcwd_tsd.internal_debugging_code );
+#define LIBCWD_LibcwDoutFatalScopeBegin_MARKER LibcwDebugThreads( ++__libcwd_tsd.internal_debugging_code ); ::write(2, LIBCWD_STR4, sizeof(LIBCWD_STR4) - 1); LibcwDebugThreads( --__libcwd_tsd.internal_debugging_code );
#else
-#define DEBUGDEBUGLIBCWDOUTFATALMARKER
+#define LIBCWD_LibcwDoutFatalScopeBegin_MARKER
#endif
-#endif // !DEBUGDEBUGLIBCWDOUTFATALMARKER
+#endif // !LIBCWD_LibcwDoutFatalScopeBegin_MARKER
/**
* \brief General fatal debug output macro.
@@ -137,7 +137,7 @@
do \
{ \
LIBCWD_TSD_DECLARATION \
- DEBUGDEBUGLIBCWDOUTFATALMARKER \
+ LIBCWD_LibcwDoutFatalScopeBegin_MARKER \
using namespace ::libcw::debug; \
::libcw::debug::channel_set_bootstrap_st __libcwd_channel_set(LIBCWD_DO_TSD(debug_obj) LIBCWD_COMMA_TSD); \
{ \
Index: src/libcwd/include/libcw/private_allocator.h
diff -u src/libcwd/include/libcw/private_allocator.h:1.5 src/libcwd/include/libcw/private_allocator.h:1.6
--- src/libcwd/include/libcw/private_allocator.h:1.5 Sun Feb 17 17:24:47 2002
+++ src/libcwd/include/libcw/private_allocator.h Tue Feb 19 19:55:52 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private...
[truncated message content] |
|
From: Carlo W. <li...@us...> - 2002-02-21 02:05:46
|
CVSROOT : /cvsroot/libcw
Module : src
Commit time: 2002-01-21 02:05:42 UTC
Modified files:
libcwd/NEWS libcwd/bfd.cc libcwd/configure.in libcwd/debug.cc
libcwd/debugmalloc.cc libcwd/demangle3.cc libcwd/elf32.cc
libcwd/threading.cc libcwd/wrapcnclpnts.cc
libcwd/documentation/allocated_memory_overview.dox
libcwd/documentation/magic.dox
libcwd/documentation/memory_leak_checking.dox
libcwd/documentation/doxygen-examples/markers.cc
libcwd/documentation/tutorial/tut6.m4
libcwd/documentation/tutorial/tut7.in
libcwd/include/private_debug_stack.inl libcwd/include/raw_write.h
libcwd/include/raw_write.inl libcwd/include/libcw/class_alloc.h
libcwd/include/libcw/class_channel_set.h
libcwd/include/libcw/class_debug.h
libcwd/include/libcw/class_debug.inl
libcwd/include/libcw/class_location.inl
libcwd/include/libcw/debug.h
libcwd/include/libcw/debug_config.ho.in
libcwd/include/libcw/debugmalloc.h
libcwd/include/libcw/enum_memblk_types.h
libcwd/include/libcw/macro_AllocTag.h
libcwd/include/libcw/macro_ForAllDebugChannels.h
libcwd/include/libcw/macro_ForAllDebugObjects.h
libcwd/include/libcw/macro_Libcwd_macros.h
libcwd/include/libcw/private_allocator.h
libcwd/include/libcw/private_set_alloc_checking.h
libcwd/include/libcw/private_struct_TSD.h
libcwd/include/libcw/private_threading.h
libcwd/include/libcw/struct_debug_tsd.h libcwd/tests/allocator.cc
libcwd/tests/dout_alloc.cc libcwd/tests/hello_world.cc
libcwd/tests/syslog.cc libcwd/tests/threads.cc
libcwd/tests/threads3.cc libcwd/tests/threads4.cc
libcwd/testsuite/libcwd.nodebug/nodebug.cc
libcwd/testsuite/libcwd.tst/alloctag.cc
libcwd/testsuite/libcwd.tst/bfd.cc
libcwd/testsuite/libcwd.tst/continued.cc
libcwd/testsuite/libcwd.tst/dc.cc
libcwd/testsuite/libcwd.tst/dlopen.cc
libcwd/testsuite/libcwd.tst/do.cc
libcwd/testsuite/libcwd.tst/flush.cc
libcwd/testsuite/libcwd.tst/leak.cc
libcwd/testsuite/libcwd.tst/lockable_auto_ptr.cc
libcwd/testsuite/libcwd.tst/magic.cc
libcwd/testsuite/libcwd.tst/marker.cc
libcwd/testsuite/libcwd.tst/test_delete.cc
libcwd/utils/exec_prog.cc
Removed files:
libcwd/example-project/macrotest.cc
Log message:
Renamed all configuration macros and defined them to 0 or 1.
---------------------- diff included ----------------------
Index: src/libcwd/NEWS
diff -u src/libcwd/NEWS:1.74 src/libcwd/NEWS:1.75
--- src/libcwd/NEWS:1.74 Tue Feb 19 19:55:51 2002
+++ src/libcwd/NEWS Wed Feb 20 18:05:30 2002
@@ -1,5 +1,70 @@
libcwd-0.99.18
+ API changes:
+
+ All macros related to the configure options used have been
+ renamed and are no longer either defined or undefined, but
+ rather defined to 1 or 0 respectively. The advantage of
+ that is that it allows the compiler to warn you when you
+ made a typo in a macro name.
+ This means that you will have to use #if macro_name
+ instead of #ifdef macro_name of course.
+ The names have changed as follows:
+ Locations:
+ DEBUGUSEBFD --> CWDEBUG_LOCATION
+ Memory allocation debugging:
+ DEBUGMALLOC --> CWDEBUG_ALLOC
+ DEBUGMAGICMALLOC --> CWDEBUG_MAGIC
+ DEBUGMARKER --> CWDEBUG_MARKER
+ Debugging libcwd itself:
+ DEBUGDEBUG --> CWDEBUG_DEBUG
+ DEBUGDEBUGOUTPUT --> CWDEBUG_DEBUGOUTPUT
+ DEBUGDEBUGMALLOC --> CWDEBUG_DEBUGM
+ DEBUGDEBUGTHREADS --> CWDEBUG_DEBUGT
+ The rationaly is that for a configure option
+ --enable-libcwd-xxx, the macro name is now CWDEBUG_XXX.
+ You are advised to automate the replacements of the
+ macros (use find and grep and reg.exp replaces);
+ The following substitutions are suggested (only
+ given for one of the macros):
+ :%s/defined(DEBUGDEBUG)/CWDEBUG_DEBUG/g
+ :%s/#ifdef DEBUGDEBUG /#if CWDEBUG_DEBUG /
+ :%s/#ifdef DEBUGDEBUG$/#if CWDEBUG_DEBUG/
+ :%s/#ifndef DEBUGDEBUG /#if !CWDEBUG_DEBUG /
+ :%s/#ifndef DEBUGDEBUG$/#if !CWDEBUG_DEBUG /
+ :%s%// DEBUGDEBUG$%// CWDEBUG_DEBUG%
+ :%s%// !DEBUGDEBUG$%// !CWDEBUG_DEBUG%
+ After that you still have to check if other instances
+ are left.
+
+ MACRO OVERVIEW:
+ Most macros now either start with LIBCWD_, LIBCW_, CWDEBUG_
+ or Libcw. The macros that start with LIBCW should not
+ be used. The macros that start with CWDEBUG_ are either
+ 0 or 1 and should be used as #if CWDEBUG_XXX ...
+ CWDEBUG itself is still defined or undefined and should
+ be used as #ifdef CWDEBUG ...
+ The macros that start with Libcw are the more general
+ cases of Dout, DoutFatal and Debug (they are LibcwDebug,
+ LibcwDebugThreads, LibcwDout, LibcwDoutFatal, LibcwDoutFatalScopeBegin,
+ LibcwDoutFatalScopeEnd, LibcwDoutFatalStream, LibcwDoutScopeBegin,
+ LibcwDoutScopeEnd and LibcwDoutStream). You are allowed to
+ use those to customize things.
+ The macros that do not start with one of those four prefixes
+ are part of the libcwd API (and should also be defined in
+ your custom debug.h):
+ Debug, Dout, DoutFatal
+ : see documentation/html/debug_8h.html
+ DEBUGCHANNELS : see documentation/html/group__chapter__custom__debug__h.html
+ ForAllDebugChannels and ForAllDebugObjects
+ : see documentation/html/group__group__special.html
+ AllocTag, AllocTag1, AllocTag2, AllocTag_dynamic_description and NEW
+ : see documentation/html/group__group__annotation.html
+ When you don't have __libc_malloc (glibc *does* have that):
+ malloc, calloc, realloc, free, strdup, wcsdup and RegisterExternalAlloc.
+ These are always defined because there is no accessible __libc_dlopen :/.
+ dlclose, dlopen : In order to catch those when used.
+
libcwd-0.99.17
A tutorial on debugging threaded applications was added.
Index: src/libcwd/bfd.cc
diff -u src/libcwd/bfd.cc:1.105 src/libcwd/bfd.cc:1.106
--- src/libcwd/bfd.cc:1.105 Tue Feb 19 19:55:51 2002
+++ src/libcwd/bfd.cc Wed Feb 20 18:05:30 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.105 2002/02/20 03:55:51 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.106 2002/02/21 02:05:30 libcw Exp $
//
// Copyright (C) 2000 - 2002, by
//
@@ -11,10 +11,10 @@
// packaging of this file.
//
-#undef DEBUGDEBUGBFD // Define to add debug code for this file.
+#undef LIBCWD_DEBUGBFD // Define to add debug code for this file.
#include <libcw/debug_config.h>
-#ifdef DEBUGUSEBFD
+#if CWDEBUG_LOCATION
#include "sys.h"
#include <unistd.h>
@@ -44,7 +44,7 @@
#endif
#include <cstdio> // Needed for vsnprintf.
#include <algorithm>
-#ifdef DEBUGDEBUGBFD
+#ifdef LIBCWD_DEBUGBFD
#include <iomanip>
#endif
#include "cwd_debug.h"
@@ -54,16 +54,16 @@
#undef dlclose
#endif
#include "exec_prog.h"
-#ifdef DEBUGUSEGNULIBBFD
+#if CWDEBUG_LIBBFD
#if defined(BFD64) && !BFD_HOST_64BIT_LONG && defined(__GLIBCPP__) && !defined(_GLIBCPP_USE_LONG_LONG)
// libbfd is compiled with 64bit support on a 32bit host, but libstdc++ is not compiled with support
// for `long long'. If you run into this error (and you insist on use libbfd) then either recompile
// libstdc++ with support for `long long' or recompile libbfd without 64bit support.
#error "Incompatible libbfd and libstdc++ (see comments in source code)."
#endif
-#else // !DEBUGUSEGNULIBBFD
+#else // !CWDEBUG_LIBBFD
#include "elf32.h"
-#endif // !DEBUGUSEGNULIBBFD
+#endif // !CWDEBUG_LIBBFD
#ifdef LIBCWD_THREAD_SAFE
using libcw::debug::_private_::rwlock_tct;
@@ -121,7 +121,7 @@
// Local stuff
namespace cwbfd {
-#ifndef DEBUGUSEGNULIBBFD
+#if !CWDEBUG_LIBBFD
//----------------------------------------------------------------------------------------
// Interface Adaptor
@@ -151,7 +151,7 @@
//----------------------------------------------------------------------------------------
-#endif // !DEBUGUSEGNULIBBFD
+#endif // !CWDEBUG_LIBBFD
// cwbfd::
void error_handler(char const* format, ...)
@@ -355,7 +355,7 @@
// cwbfd::
object_file_ct::object_file_ct(char const* filename, void* base) : lbase(base)
{
-#ifdef DEBUGDEBUGMALLOC
+#if CWDEBUG_DEBUGM
{
LIBCWD_TSD_DECLARATION
LIBCWD_ASSERT( __libcwd_tsd.internal );
@@ -363,7 +363,7 @@
#endif
abfd = bfd_openr(filename, NULL);
-#ifdef DEBUGUSEGNULIBBFD
+#if CWDEBUG_LIBBFD
if (!abfd)
DoutFatal(dc::bfd, "bfd_openr: " << bfd_errmsg(bfd_get_error()));
abfd->cacheable = bfd_tttrue;
@@ -375,13 +375,13 @@
if (bfd_check_format(abfd, bfd_archive))
{
bfd_close(abfd);
-#ifdef DEBUGUSEGNULIBBFD
+#if CWDEBUG_LIBBFD
DoutFatal(dc::bfd, filename << ": can not get addresses from archive: " << bfd_errmsg(bfd_get_error()));
#else
DoutFatal(dc::bfd, filename << ": can not get addresses from archive.");
#endif
}
-#ifdef DEBUGUSEGNULIBBFD
+#if CWDEBUG_LIBBFD
char** matching;
if (!bfd_check_format_matches(abfd, bfd_object, &matching))
{
@@ -404,7 +404,7 @@
}
long storage_needed = bfd_get_symtab_upper_bound (abfd);
-#ifdef DEBUGUSEGNULIBBFD
+#if CWDEBUG_LIBBFD
if (storage_needed < 0)
DoutFatal(dc::bfd, "bfd_get_symtab_upper_bound: " << bfd_errmsg(bfd_get_error()));
#else
@@ -420,14 +420,14 @@
symbol_table = (asymbol**) malloc(storage_needed);
number_of_symbols = bfd_canonicalize_symtab(abfd, symbol_table);
-#ifdef DEBUGUSEGNULIBBFD
+#if CWDEBUG_LIBBFD
if (number_of_symbols < 0)
DoutFatal(dc::bfd, "bfd_canonicalize_symtab: " << bfd_errmsg(bfd_get_error()));
#endif
if (number_of_symbols > 0)
{
-#ifndef DEBUGUSEGNULIBBFD
+#if !CWDEBUG_LIBBFD
size_t s_end_vma = abfd->M_s_end_vma;
#else
size_t s_end_vma = 0;
@@ -458,7 +458,7 @@
else
++s;
}
-#endif // DEBUGUSEGNULIBBFD
+#endif // CWDEBUG_LIBBFD
if (!s_end_vma && number_of_symbols > 0)
Dout(dc::warning, "Cannot find symbol _end");
@@ -609,7 +609,7 @@
// cwbfd::
object_file_ct::~object_file_ct()
{
-#if defined(LIBCWD_THREAD_SAFE) && defined(DEBUGDEBUG)
+#if defined(LIBCWD_THREAD_SAFE) && CWDEBUG_DEBUG
LIBCWD_ASSERT( _private_::is_locked(object_files_instance) );
#endif
object_files_ct::iterator iter(find(NEEDS_WRITE_LOCK_object_files().begin(), NEEDS_WRITE_LOCK_object_files().end(), this));
@@ -878,7 +878,7 @@
return 0;
}
-#ifdef DEBUGDEBUGBFD
+#ifdef LIBCWD_DEBUGBFD
// cwbfd::
void dump_object_file_symbols(object_file_ct const* object_file)
{
@@ -918,7 +918,7 @@
if (object_file->get_number_of_symbols() > 0)
{
Dout(dc::finish, "done (" << std::dec << object_file->get_number_of_symbols() << " symbols)");
-#ifdef DEBUGDEBUGBFD
+#ifdef LIBCWD_DEBUGBFD
dump_object_file_symbols(object_file);
#endif
}
@@ -945,14 +945,14 @@
// MT: We assume this is called before reaching main().
// Therefore, no synchronisation is required.
-#if defined(DEBUGDEBUG) && defined(LIBCWD_THREAD_SAFE)
+#if CWDEBUG_DEBUG && defined(LIBCWD_THREAD_SAFE)
if (_private_::WST_multi_threaded)
core_dump();
#endif
LIBCWD_TSD_DECLARATION
-#if defined(DEBUGDEBUG) && defined(DEBUGMALLOC)
+#if CWDEBUG_DEBUG && CWDEBUG_ALLOC
LIBCWD_ASSERT( !__libcwd_tsd.internal );
#endif
@@ -960,7 +960,7 @@
// Start INTERNAL!
set_alloc_checking_off(LIBCWD_TSD);
-#ifdef DEBUGMALLOC
+#if CWDEBUG_ALLOC
// Initialize the malloc library if not done yet.
init_debugmalloc();
#endif
@@ -978,7 +978,7 @@
// write lock because this function is Single Threaded.
new (&NEEDS_WRITE_LOCK_object_files()) object_files_ct;
-#ifdef DEBUGUSEGNULIBBFD
+#if CWDEBUG_LIBBFD
bfd_init();
#endif
@@ -993,11 +993,11 @@
{
LIBCWD_TSD_DECLARATION
set_alloc_checking_off(LIBCWD_TSD);
-#if defined(DEBUGDEBUG) && defined(LIBCWD_THREAD_SAFE)
+#if CWDEBUG_DEBUG && defined(LIBCWD_THREAD_SAFE)
_private_::WST_multi_threaded = false; // `fullpath' is static and will only be destroyed from exit().
#endif
delete value;
-#if defined(DEBUGDEBUG) && defined(LIBCWD_THREAD_SAFE)
+#if CWDEBUG_DEBUG && defined(LIBCWD_THREAD_SAFE)
_private_::WST_multi_threaded = true; // Make sure we catch other global strings (in order to avoid a static destructor ordering fiasco).
#endif
set_alloc_checking_on(LIBCWD_TSD);
@@ -1007,7 +1007,7 @@
ST_get_full_path_to_executable(*fullpath.value);
*fullpath.value += '\0'; // Make string null terminated so we can use data().
-#ifdef DEBUGUSEGNULIBBFD
+#if CWDEBUG_LIBBFD
bfd_set_error_program_name(fullpath.value->data() + fullpath.value->find_last_of('/') + 1);
bfd_set_error_handler(error_handler);
#endif
@@ -1064,7 +1064,7 @@
WST_initialized = true; // MT: Safe, this function is Single Threaded.
-#ifdef DEBUGDEBUGBFD
+#ifdef LIBCWD_DEBUGBFD
LIBCWD_DEFER_CANCEL
BFD_ACQUIRE_READ_LOCK
// Dump all symbols
@@ -1249,7 +1249,7 @@
LIBCWD_ASSERT( object_file->get_bfd() == abfd );
LIBCWD_DEFER_CANCEL
set_alloc_checking_off(LIBCWD_TSD);
-#ifdef DEBUGUSEGNULIBBFD
+#if CWDEBUG_LIBBFD
bfd_find_nearest_line(abfd, const_cast<asection*>(sect), const_cast<asymbol**>(object_file->get_symbol_table()),
(char*)addr - (char*)object_file->get_lbase() - sect->vma, &file, &M_func, &M_line);
#else
@@ -1529,4 +1529,4 @@
#endif // LIBCWD_DLOPEN_DEFINED
-#endif // !DEBUGUSEBFD
+#endif // !CWDEBUG_LOCATION
Index: src/libcwd/configure.in
diff -u src/libcwd/configure.in:1.106 src/libcwd/configure.in:1.107
--- src/libcwd/configure.in:1.106 Mon Feb 18 19:18:30 2002
+++ src/libcwd/configure.in Wed Feb 20 18:05:31 2002
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-AC_REVISION($Revision: 1.106 $)dnl
+AC_REVISION($Revision: 1.107 $)dnl
dnl General intialization of `autoconf' varaibles.
dnl Ensure that the directory specified with --srcdir was correct
@@ -200,24 +200,24 @@
AC_SUBST([CXXCPP_FINGER_PRINT])
dnl Configuration defines of debug_config.h
-AC_SUBST(CW_CONFIG_DEBUGMALLOC)
-CW_CONFIG_DEBUGMALLOC=undef
-AC_SUBST(CW_CONFIG_DEBUGMAGICMALLOC)
-CW_CONFIG_DEBUGMAGICMALLOC=undef
-AC_SUBST(CW_CONFIG_DEBUGUSEBFD)
-CW_CONFIG_DEBUGUSEBFD=undef
-AC_SUBST(CW_CONFIG_DEBUGUSEGNULIBBFD)
-CW_CONFIG_DEBUGUSEGNULIBBFD=undef
-AC_SUBST(CW_CONFIG_DEBUGDEBUG)
-CW_CONFIG_DEBUGDEBUG=undef
-AC_SUBST(CW_CONFIG_DEBUGDEBUGOUTPUT)
-CW_CONFIG_DEBUGDEBUGOUTPUT=undef
-AC_SUBST(CW_CONFIG_DEBUGDEBUGMALLOC)
-CW_CONFIG_DEBUGDEBUGMALLOC=undef
-AC_SUBST(CW_CONFIG_DEBUGDEBUGTHREADS)
-CW_CONFIG_DEBUGDEBUGTHREADS=undef
-AC_SUBST(CW_CONFIG_DEBUGMARKER)
-CW_CONFIG_DEBUGMARKER=undef
+AC_SUBST(CW_CONFIG_ALLOC)
+CW_CONFIG_ALLOC=0
+AC_SUBST(CW_CONFIG_MAGIC)
+CW_CONFIG_MAGIC=0
+AC_SUBST(CW_CONFIG_LOCATION)
+CW_CONFIG_LOCATION=0
+AC_SUBST(CW_CONFIG_LIBBFD)
+CW_CONFIG_LIBBFD=0
+AC_SUBST(CW_CONFIG_DEBUG)
+CW_CONFIG_DEBUG=0
+AC_SUBST(CW_CONFIG_DEBUGOUTPUT)
+CW_CONFIG_DEBUGOUTPUT=0
+AC_SUBST(CW_CONFIG_DEBUGM)
+CW_CONFIG_DEBUGM=0
+AC_SUBST(CW_CONFIG_DEBUGT)
+CW_CONFIG_DEBUGT=0
+AC_SUBST(CW_CONFIG_MARKER)
+CW_CONFIG_MARKER=0
AC_SUBST(CW_CONFIG_HAVE___LIBC_MALLOC)
CW_CONFIG_HAVE___LIBC_MALLOC=undef
AC_SUBST(CW_CONFIG_HAVE__LIBC_MALLOC)
@@ -231,11 +231,11 @@
AC_SUBST(libcwd_config_threading)
if test "$libcwd_config_alloc" = yes; then
- CW_CONFIG_DEBUGMALLOC=define
+ CW_CONFIG_ALLOC=1
fi
if test "$libcwd_config_magic" = yes; then
- CW_CONFIG_DEBUGMAGICMALLOC=define
+ CW_CONFIG_MAGIC=1
fi
dnl Set language requirements for the tests below.
@@ -250,7 +250,7 @@
[AC_CHECK_LIB(dl, dlopen, [LIBS="-ldl $LIBS"; AC_DEFINE_UNQUOTED(HAVE_DLOPEN)
CW_CONFIG_HAVE_DLOPEN=define])])
-CW_CONFIG_DEBUGUSEBFD=define
+CW_CONFIG_LOCATION=1
fi
@@ -310,7 +310,7 @@
dnl If we succeeded so far, then enable DEBUGUSEGNULIBBFD
if test "$ac_cv_lib_bfd_bfd_set_start_address" != "no" -o "set+$cw_cv_lib_bfd_bfd_set_start_address_with_intl" = "set+yes"; then
AC_CHECK_HEADER(bfd.h,
- [CW_CONFIG_DEBUGUSEGNULIBBFD=define
+ [CW_CONFIG_LIBBFD=1
AC_MSG_WARN([
* You used --enable-libcwd-libbfd: The license of libbfd (GPL) forbids to link
@@ -392,23 +392,23 @@
CW_SYS_BUILTIN_RETURN_ADDRESS_OFFSET
if test "$libcwd_config_debug" = yes; then
- CW_CONFIG_DEBUGDEBUG=define
+ CW_CONFIG_DEBUG=1
fi
if test "$libcwd_config_debug_output" = yes; then
- CW_CONFIG_DEBUGDEBUGOUTPUT=define
+ CW_CONFIG_DEBUGOUTPUT=1
fi
if test "$libcwd_config_debugm" = yes; then
- CW_CONFIG_DEBUGDEBUGMALLOC=define
+ CW_CONFIG_DEBUGM=1
fi
if test "$libcwd_config_debugt" = yes; then
- CW_CONFIG_DEBUGDEBUGTHREADS=define
+ CW_CONFIG_DEBUGT=1
fi
if test "$libcwd_config_marker" = yes; then
- CW_CONFIG_DEBUGMARKER=define
+ CW_CONFIG_MARKER=1
fi
dnl Checks for header files.
Index: src/libcwd/debug.cc
diff -u src/libcwd/debug.cc:1.74 src/libcwd/debug.cc:1.75
--- src/libcwd/debug.cc:1.74 Sun Feb 17 22:08:05 2002
+++ src/libcwd/debug.cc Wed Feb 20 18:05:31 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.74 2002/02/18 06:08:05 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.75 2002/02/21 02:05:31 libcw Exp $
//
// Copyright (C) 2000 - 2002, by
//
@@ -14,12 +14,12 @@
#include "sys.h"
#include <libcw/debug_config.h>
-#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && defined(DEBUGMALLOC)
+#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && CWDEBUG_ALLOC
// This has to be very early (must not have been included elsewhere already).
#define private public // Ugly, I know.
#include <bits/stl_alloc.h>
#undef private
-#endif // (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && defined(DEBUGMALLOC)
+#endif // (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && CWDEBUG_ALLOC
#include <errno.h>
#include <iostream>
@@ -69,7 +69,7 @@
namespace _private_ {
-#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && defined(DEBUGMALLOC)
+#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && CWDEBUG_ALLOC
// The following tries to take the "node allocator" lock -- the lock of the
// default allocator for threaded applications. The parameter is the value to
// return when no lock exist. This should probably be implemented as a macro
@@ -96,7 +96,7 @@
#endif
__gthread_mutex_unlock(&std::__default_alloc_template<true, 0>::_S_node_allocator_lock._M_lock);
}
-#endif // (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && defined(DEBUGMALLOC)
+#endif // (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && CWDEBUG_ALLOC
} // namespace _private_
@@ -114,19 +114,19 @@
public:
#ifdef LIBCWD_THREAD_SAFE
void writeto(std::ostream* os, _private_::lock_interface_base_ct* mutex LIBCWD_COMMA_TSD_PARAM, debug_ct&
-#ifdef DEBUGMALLOC
+#if CWDEBUG_ALLOC
debug_object
#endif
)
#else
void writeto(std::ostream* os LIBCWD_COMMA_TSD_PARAM, debug_ct&
-#ifdef DEBUGMALLOC
+#if CWDEBUG_ALLOC
debug_object
#endif
)
#endif // LIBCWD_THREAD_SAFE
{
-#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && defined(DEBUGMALLOC)
+#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && CWDEBUG_ALLOC
typedef debug_message_st* msgbuf_t;
msgbuf_t msgbuf;
// Queue the message when the default (STL) allocator is locked and it could be that we
@@ -155,12 +155,12 @@
msgbuf = (msgbuf_t)malloc(curlen + extra_size);
free_msgbuf = true;
}
-#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && defined(DEBUGMALLOC)
+#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && CWDEBUG_ALLOC
rdbuf()->sgetn(msgbuf->buf, curlen);
#else
rdbuf()->sgetn(msgbuf, curlen);
#endif
-#ifdef DEBUGMALLOC
+#if CWDEBUG_ALLOC
// Writing to the final std::ostream (ie std::cerr) must be non-internal!
// LIBCWD_DISABLE_CANCEL/LIBCWD_ENABLE_CANCEL must be done non-internal too.
int saved_internal = __libcwd_tsd.internal;
@@ -183,7 +183,7 @@
}
}
#endif // !LIBCWD_THREAD_SAFE
-#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && defined(DEBUGMALLOC)
+#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && CWDEBUG_ALLOC
if (queue_msg) // Inside a call to malloc and possibly owning lock of std::__default_alloc_template<true, 0>?
{
// We don't write debug output to the final ostream when inside malloc and std::__default_alloc_template<true, 0> is locked.
@@ -219,15 +219,15 @@
// Then write the new message.
os->write(msgbuf->buf, curlen);
}
-#else // !(defined(DEBUGMALLOC) && defined(LIBCWD_THREAD_SAFE))
+#else // !(CWDEBUG_ALLOC && defined(LIBCWD_THREAD_SAFE))
os->write(msgbuf, curlen);
-#endif // !DEBUGMALLOC
+#endif // !CWDEBUG_ALLOC
#ifdef LIBCWD_THREAD_SAFE
if (mutex)
mutex->unlock();
LIBCWD_ENABLE_CANCEL
#endif // !LIBCWD_THREAD_SAFE
-#ifdef DEBUGMALLOC
+#if CWDEBUG_ALLOC
--LIBCWD_DO_TSD_MEMBER_OFF(libcw_do);
--__libcwd_tsd.library_call;
__libcwd_tsd.internal = saved_internal;
@@ -379,7 +379,7 @@
}
}
-#ifdef DEBUGUSEBFD
+#if CWDEBUG_LOCATION
namespace cwbfd { extern bool ST_init(void); }
#endif
@@ -389,7 +389,7 @@
if (ST_already_called)
return;
ST_already_called = true;
-#ifdef DEBUGMALLOC
+#if CWDEBUG_ALLOC
init_debugmalloc();
#endif
#ifdef LIBCWD_THREAD_SAFE
@@ -406,7 +406,7 @@
channels::dc::malloc.NS_initialize("MALLOC");
channels::dc::continued.NS_initialize(continued_maskbit);
channels::dc::finish.NS_initialize(finish_maskbit);
-#ifdef DEBUGUSEBFD
+#if CWDEBUG_LOCATION
channels::dc::bfd.NS_initialize("BFD");
#endif
// What the heck, initialize all other debug channels too
@@ -446,10 +446,10 @@
}
#endif
-#ifdef DEBUGUSEBFD
+#if CWDEBUG_LOCATION
cwbfd::ST_init(); // Initialize BFD code.
#endif
-#if defined(DEBUGDEBUG) && !defined(DEBUGDEBUGOUTPUT)
+#if CWDEBUG_DEBUG && !CWDEBUG_DEBUGOUTPUT
// Force allocation of a __cxa_eh_globals struct in libsupc++.
(void)std::uncaught_exception();
#endif
@@ -509,7 +509,7 @@
if (!WNS_debug_objects) // MT: `WNS_debug_objects' is only false when this object is still Non_Shared.
{
DEBUGDEBUG_CERR( "_debug_objects == NULL; initializing it" );
-#ifdef DEBUGMALLOC
+#if CWDEBUG_ALLOC
// It is possible that malloc is not initialized yet.
init_debugmalloc();
#endif
@@ -534,7 +534,7 @@
if (!WNS_debug_objects) // MT: `WNS_debug_objects' is only false when this object is still Non_Shared.
{
DEBUGDEBUG_CERR( "_debug_objects == NULL; initializing it" );
-#ifdef DEBUGMALLOC
+#if CWDEBUG_ALLOC
// It is possible that malloc is not initialized yet.
init_debugmalloc();
#endif
@@ -563,7 +563,7 @@
} // namespace _private_
-#ifdef DEBUGDEBUG
+#if CWDEBUG_DEBUG
static long WST_debug_object_init_magic = 0;
static void init_debug_object_init_magic(void)
@@ -765,7 +765,7 @@
void debug_tsd_st::start(debug_ct& debug_object, channel_set_data_st& channel_set LIBCWD_COMMA_TSD_PARAM)
{
-#ifdef DEBUGDEBUG
+#if CWDEBUG_DEBUG
#ifdef LIBCWD_THREAD_SAFE
// Initialisation of the TSD part should be done from LIBCWD_TSD_DECLARATION inside Dout et al.
LIBCWD_ASSERT( tsd_initialized );
@@ -803,7 +803,7 @@
debug_object.M_mutex->unlock();
#endif
char const* channame = (channel_set.mask & finish_maskbit) ? "finish" : "continued";
-#ifdef DEBUGUSEBFD
+#if CWDEBUG_LOCATION
DoutFatal(dc::core, "Using `dc::" << channame << "' in " <<
debug::location_ct((char*)__builtin_return_address(0) + builtin_return_address_offset) <<
" without (first using) a matching `continued_cf'.");
@@ -812,7 +812,7 @@
"' without (first using) a matching `continued_cf'.");
#endif
}
-#ifdef DEBUGDEBUG
+#if CWDEBUG_DEBUG
// MT: current != _private_::WST_dummy_laf, otherwise we didn't pass the previous if.
LIBCWD_ASSERT( current != reinterpret_cast<laf_ct*>(_private_::WST_dummy_laf) );
#endif
@@ -829,7 +829,7 @@
// Is this an interrupting debug output (in the middle of a continued debug output)?
if ((current->mask & continued_cf_maskbit) && unfinished_expected)
{
-#ifdef DEBUGDEBUG
+#if CWDEBUG_DEBUG
// MT: if current == _private_::WST_dummy_laf then
// (current->mask & continued_cf_maskbit) is false and this if is skipped.
LIBCWD_ASSERT( current != reinterpret_cast<laf_ct*>(_private_::WST_dummy_laf) );
@@ -889,7 +889,7 @@
write_whitespace_to(*current_oss, margin.size());
else
current_oss->write(margin.c_str(), margin.size());
-#ifndef DEBUGDEBUGOUTPUT
+#if !CWDEBUG_DEBUGOUTPUT
if (!(channel_set.mask & nolabel_cf))
#endif
{
@@ -918,7 +918,7 @@
void debug_tsd_st::finish(debug_ct& debug_object, channel_set_data_st& channel_set LIBCWD_COMMA_TSD_PARAM)
{
-#ifdef DEBUGDEBUG
+#if CWDEBUG_DEBUG
LIBCWD_ASSERT( current != reinterpret_cast<laf_ct*>(_private_::WST_dummy_laf) );
#endif
std::ostream* target_os = (current->mask & cerr_cf) ? &std::cerr : debug_object.real_os;
@@ -1028,7 +1028,7 @@
{
current = reinterpret_cast<laf_ct*>(_private_::WST_dummy_laf); // Used (MT: read-only!) in next debug_ct::start().
DEBUGDEBUG_CERR( "current = " << (void*)current );
-#ifdef DEBUGDEBUG
+#if CWDEBUG_DEBUG
current_oss = NULL;
DEBUGDEBUG_CERR( "current_oss = " << (void*)current_oss );
#endif
@@ -1066,7 +1066,7 @@
M_mutex = NULL;
#endif
-#ifdef DEBUGDEBUG
+#if CWDEBUG_DEBUG
if (!WST_debug_object_init_magic)
init_debug_object_init_magic();
init_magic = WST_debug_object_init_magic;
@@ -1092,7 +1092,7 @@
new (_private_::WST_dummy_laf) laf_ct(0, channels::dc::debug.get_label(), 0); // Leaks 24 bytes of memory
#ifdef LIBCWD_THREAD_SAFE
WNS_index = S_index_count++;
-#ifdef DEBUGDEBUGTHREADS
+#if CWDEBUG_DEBUGT
LIBCWD_ASSERT( pthread_self() == PTHREAD_THREADS_MAX ); // Only the initial thread should be initializing debug_ct objects.
#endif
LIBCWD_ASSERT( __libcwd_tsd.do_array[WNS_index] == NULL );
@@ -1101,7 +1101,7 @@
tsd.init();
set_alloc_checking_on(LIBCWD_TSD);
-#ifdef DEBUGDEBUGOUTPUT
+#if CWDEBUG_DEBUGOUTPUT
LIBCWD_TSD_MEMBER_OFF = -1; // Print as much debug output as possible right away.
#else
LIBCWD_TSD_MEMBER_OFF = 0; // Don't print debug output till the REAL initialization of the debug system
@@ -1119,7 +1119,7 @@
void debug_tsd_st::init(void)
{
-#ifdef DEBUGDEBUGMALLOC
+#if CWDEBUG_DEBUGM
LIBCWD_TSD_DECLARATION
LIBCWD_ASSERT( __libcwd_tsd.internal );
#endif
@@ -1130,7 +1130,7 @@
// current.mask needs to be 0 to avoid a crash in start():
current = reinterpret_cast<laf_ct*>(_private_::WST_dummy_laf);
DEBUGDEBUG_CERR( "current = " << (void*)current );
-#ifdef DEBUGDEBUG
+#if CWDEBUG_DEBUG
current_oss = NULL;
DEBUGDEBUG_CERR( "current_oss = " << (void*)current_oss );
#endif
@@ -1139,7 +1139,7 @@
margin.NS_internal_init("", 0);
marker.NS_internal_init(": ", 2);
-#ifdef DEBUGDEBUGOUTPUT
+#if CWDEBUG_DEBUGOUTPUT
first_time = true;
#endif
off_count = 0;
@@ -1436,7 +1436,7 @@
continued_channel_set_st& channel_set_st::operator|(continued_cf_nt)
{
-#ifdef DEBUGDEBUG
+#if CWDEBUG_DEBUG
DEBUGDEBUG_CERR( "continued_cf detected" );
if (!do_tsd_ptr || !do_tsd_ptr->tsd_initialized)
{
@@ -1462,7 +1462,7 @@
continued_channel_set_st& channel_set_bootstrap_st::operator|(continued_channel_ct const& cdc)
{
-#ifdef DEBUGDEBUG
+#if CWDEBUG_DEBUG
if ((cdc.get_maskbit() & continued_maskbit))
DEBUGDEBUG_CERR( "dc::continued detected" );
else
@@ -1496,7 +1496,7 @@
channel_set_st& channel_set_bootstrap_st::operator|(fatal_channel_ct const&)
{
-#ifdef DEBUGUSEBFD
+#if CWDEBUG_LOCATION
DoutFatal(dc::fatal, location_ct((char*)__builtin_return_address(0) + libcw::debug::builtin_return_address_offset) <<
" : Don't use Dout together with dc::core or dc::fatal! Use DoutFatal instead.");
#else
@@ -1507,7 +1507,7 @@
channel_set_st& channel_set_bootstrap_st::operator&(channel_ct const&)
{
-#ifdef DEBUGUSEBFD
+#if CWDEBUG_LOCATION
DoutFatal(dc::fatal, location_ct((char*)__builtin_return_address(0) + libcw::debug::builtin_return_address_offset) <<
" : Use dc::core or dc::fatal together with DoutFatal.");
#else
@@ -1520,10 +1520,10 @@
void assert_fail(char const* expr, char const* file, int line, char const* function)
{
-#ifdef DEBUGDEBUG
+#if CWDEBUG_DEBUG
LIBCWD_TSD_DECLARATION
if (__libcwd_tsd.recursive_assert
-#ifdef DEBUGDEBUGMALLOC
+#if CWDEBUG_DEBUGM
|| __libcwd_tsd.inside_malloc_or_free
#endif
)
@@ -1534,7 +1534,7 @@
core_dump();
}
__libcwd_tsd.recursive_assert = true;
-#ifdef DEBUGDEBUGTHREADS
+#if CWDEBUG_DEBUGT
__libcwd_tsd.internal_debugging_code = true;
#endif
#endif
@@ -1548,7 +1548,7 @@
NS_init();
LIBCWD_TSD_DECLARATION
state._off = LIBCWD_TSD_MEMBER_OFF;
-#ifdef DEBUGDEBUGOUTPUT
+#if CWDEBUG_DEBUGOUTPUT
state.first_time = LIBCWD_TSD_MEMBER(first_time);
#endif
LIBCWD_TSD_MEMBER_OFF = -1; // Turn object on.
@@ -1557,7 +1557,7 @@
void debug_ct::restore(debug_ct::OnOffState const& state)
{
LIBCWD_TSD_DECLARATION
-#ifdef DEBUGDEBUGOUTPUT
+#if CWDEBUG_DEBUGOUTPUT
if (state.first_time != LIBCWD_TSD_MEMBER(first_time)) // state.first_time && !first_time.
core_dump(); // on() was called without first a call to off().
#endif
Index: src/libcwd/debugmalloc.cc
diff -u src/libcwd/debugmalloc.cc:1.85 src/libcwd/debugmalloc.cc:1.86
--- src/libcwd/debugmalloc.cc:1.85 Tue Feb 19 19:55:51 2002
+++ src/libcwd/debugmalloc.cc Wed Feb 20 18:05:31 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.85 2002/02/20 03:55:51 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.86 2002/02/21 02:05:31 libcw Exp $
//
// Copyright (C) 2000 - 2002, by
//
@@ -119,11 +119,11 @@
// For internal use.
//
-#define DEBUGMALLOC_INTERNAL
+#define LIBCWD_DEBUGMALLOC_INTERNAL
#include "sys.h"
#include <libcw/debug_config.h>
-#if defined(DEBUGMALLOC) || defined(LIBCW_DOXYGEN)
+#if CWDEBUG_ALLOC || defined(LIBCW_DOXYGEN)
#include <cstring>
#include <string>
@@ -246,7 +246,7 @@
} // namespace debug
} // namespace libcw
-#if...
[truncated message content] |
|
From: Carlo W. <li...@us...> - 2002-02-21 18:22:17
|
CVSROOT : /cvsroot/libcw
Module : src
Commit time: 2002-01-21 18:22:11 UTC
Modified files:
libcwd/example-project/README libcwd/example-project/program.cc
Log message:
Update of the example project.
---------------------- diff included ----------------------
Index: src/libcwd/example-project/README
diff -u src/libcwd/example-project/README:1.4 src/libcwd/example-project/README:1.5
--- src/libcwd/example-project/README:1.4 Sun Aug 19 09:53:42 2001
+++ src/libcwd/example-project/README Thu Feb 21 10:22:01 2002
@@ -121,21 +121,6 @@
It did not link with libcwd, nor does libcwd need to be installed.
-There are files that are generated in maintainer-mode (and later put
-into the distribution) ONLY when you issue a `make' and when configured
-with --enable-maintainer-mode. Therefore, the following will not work:
-
- make maintainer-clean
- aclocal
- autoheader
- autoconf
- automake -a
- ./configure
- make
-
-Because now the file `nodebug.h' was never generated.
-
-
We have three different types of makefiles:
1) makefile : The makefile for the master himself in order to
@@ -153,9 +138,7 @@
when the package is configured with
--enable-maintainer-mode.
Note that also Makefile.{am|in} can contain
- maintainer specific rules. In this example
- project `maintMakefile.in' is used to generate
- the file `nodebug.h'.
+ maintainer specific rules.
3) Makefile.am : The makefile that describes how to build the
application.
@@ -184,6 +167,8 @@
./configure
make
-Now this did work (of course), because 'nodebug.h' is part of the
-distribution.
+
+PS If you see a file 'debug.h.maintainer' then you probably checked
+ out this directory from the libcwd CVS repository. That file
+ is not supposed to be a part of your project, just remove it.
Index: src/libcwd/example-project/program.cc
diff -u src/libcwd/example-project/program.cc:1.3 src/libcwd/example-project/program.cc:1.4
--- src/libcwd/example-project/program.cc:1.3 Sat Dec 29 20:17:49 2001
+++ src/libcwd/example-project/program.cc Thu Feb 21 10:22:01 2002
@@ -1,12 +1,25 @@
#include "sys.h"
-#include <iostream>
+#include <iostream> // Needed for std::cout and std::endl
+#ifdef CWDEBUG
+#include <cstdlib> // Needed for getenv
+#endif
#include "debug.h"
int main(void)
{
+ // You want this, unless you mix streams output with C output.
+ // Read http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#8 for an explanation.
+ std::ios::sync_with_stdio(false);
+
+ // This will warn you when you are using header files that do not belong to the
+ // shared libcwd object that you linked with.
Debug( check_configuration() );
+
+ // Turn on the custom channel.
Debug( dc::custom.on() );
- Debug( libcw_do.on() );
+
+ // Only turn on debug output when the environment variable SUPPRESS_DEBUG_OUTPUT is not set.
+ Debug( if (getenv("SUPPRESS_DEBUG_OUTPUT") == NULL) libcw_do.on() );
Dout(dc::custom, "This is debug output, written to a custom channel (see ./debug.h and ./debug.cc)");
----------------------- End of diff -----------------------
|
|
From: Carlo W. <li...@us...> - 2002-02-21 20:17:33
|
CVSROOT : /cvsroot/libcw
Module : src
Commit time: 2002-01-21 20:17:30 UTC
Modified files:
libcwd/documentation/allocated_memory_overview.dox
libcwd/documentation/memory_leak_checking.dox
libcwd/include/libcw/class_location.h libcwd/tests/Makefile.am
Log message:
Several minor fixes.
---------------------- diff included ----------------------
Index: src/libcwd/documentation/allocated_memory_overview.dox
diff -u src/libcwd/documentation/allocated_memory_overview.dox:1.3 src/libcwd/documentation/allocated_memory_overview.dox:1.4
--- src/libcwd/documentation/allocated_memory_overview.dox:1.3 Wed Feb 20 18:05:31 2002
+++ src/libcwd/documentation/allocated_memory_overview.dox Thu Feb 21 12:17:20 2002
@@ -100,7 +100,7 @@
This is the value returned by the allocator (<CODE>malloc</CODE>, <CODE>new</CODE> etc).
Note that, when \ref enable_libcwd_magic "CWDEBUG_MAGIC" is set, a magic number is
put <I>in front of</I> this hexadecimal start address.
-The result is that you can ignore completely whether or not CWDEBUG_MAGIC is 1, in your own program.
+The result is that you can ignore completely whether CWDEBUG_MAGIC is 0 or 1, in your own program.
\subsection AMO_location source file location
Index: src/libcwd/documentation/memory_leak_checking.dox
diff -u src/libcwd/documentation/memory_leak_checking.dox:1.3 src/libcwd/documentation/memory_leak_checking.dox:1.4
--- src/libcwd/documentation/memory_leak_checking.dox:1.3 Wed Feb 20 18:05:31 2002
+++ src/libcwd/documentation/memory_leak_checking.dox Thu Feb 21 12:17:20 2002
@@ -28,7 +28,7 @@
Any allocation done \em after the creation of this marker will be reported as a <B>leak</B> at the moment the \em marker is deleted.
Markers are clearly visibly in the Allocated memory Overview.
-They are labeled MARKER (see also table FIXME).
+They are labeled MARKER (see also the <A HREF="group__group__overview.html#AMO_allocator">allocator type</A> table).
All memory that is allocated after a \em marker, is displayed indented and below that marker in the Allocated memory Overview.
Finally, it is possible to move specific memory blocks outside markers, so they will not cause a memory leak detection.
Index: src/libcwd/include/libcw/class_location.h
diff -u src/libcwd/include/libcw/class_location.h:1.5 src/libcwd/include/libcw/class_location.h:1.6
--- src/libcwd/include/libcw/class_location.h:1.5 Sun Feb 17 17:24:47 2002
+++ src/libcwd/include/libcw/class_location.h Thu Feb 21 12:17:20 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_location.h,v 1.5 2002/02/18 01:24:47 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_location.h,v 1.6 2002/02/21 20:17:20 libcw Exp $
//
// Copyright (C) 2000 - 2002, by
//
@@ -49,7 +49,7 @@
* The normal usage of this class is to print file-name:line-number information as follows:
* \code
* Dout(dc::notice, "Called from " <<
- * location_ct((char*)__builtin_return_address(0) + libcw::builtin_return_address_offset) );
+ * location_ct((char*)__builtin_return_address(0) + libcw::debug::builtin_return_address_offset) );
* \endcode
*/
class location_ct {
Index: src/libcwd/tests/Makefile.am
diff -u src/libcwd/tests/Makefile.am:1.21 src/libcwd/tests/Makefile.am:1.22
--- src/libcwd/tests/Makefile.am:1.21 Sun Feb 17 21:07:22 2002
+++ src/libcwd/tests/Makefile.am Thu Feb 21 12:17:20 2002
@@ -8,6 +8,7 @@
threads3 \
threads4 \
hello_world \
+location \
syslog \
initbug \
dout_alloc \
@@ -19,6 +20,7 @@
CLEANFILES=$(EXTRA_PROGRAMS)
hello_world_SOURCES = hello_world.cc
+location_SOURCES = location.cc
syslog_SOURCES = syslog.cc
initbug_SOURCES = initbug.cc initbug_GlobalObject.cc
dout_alloc_SOURCES = dout_alloc.cc
----------------------- End of diff -----------------------
|
|
From: Carlo W. <li...@us...> - 2002-02-21 20:18:49
|
CVSROOT : /cvsroot/libcw
Module : src
Commit time: 2002-01-21 20:18:47 UTC
Modified files:
libcwd/tests/.cvsignore
Added files:
libcwd/tests/location.cc
Log message:
Just another tiny test.
---------------------- diff included ----------------------
Index: src/libcwd/tests/.cvsignore
diff -u src/libcwd/tests/.cvsignore:1.14 src/libcwd/tests/.cvsignore:1.15
--- src/libcwd/tests/.cvsignore:1.14 Sun Feb 3 19:51:18 2002
+++ src/libcwd/tests/.cvsignore Thu Feb 21 12:18:37 2002
@@ -10,5 +10,6 @@
threads4
stabs
dout_alloc
+location
.deps
.libs
Index: src/libcwd/tests/location.cc
diff -u /dev/null src/libcwd/tests/location.cc:1.1
--- /dev/null Thu Feb 21 12:18:47 2002
+++ src/libcwd/tests/location.cc Thu Feb 21 12:18:37 2002
@@ -0,0 +1,47 @@
+// $Header: /cvsroot/l/li/libcw/src/libcwd/tests/location.cc,v 1.1 2002/02/21 20:18:37 libcw Exp $
+//
+// Copyright (C) 2002, by
+//
+// Carlo Wood, Run on IRC <ca...@al...>
+// RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt
+// Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61
+//
+// This file may be distributed under the terms of the Q Public License
+// version 1.0 as appearing in the file LICENSE.QPL included in the
+// packaging of this file.
+//
+
+#include "sys.h"
+#include <iostream>
+#include "debug.h"
+#include <libcw/demangle.h>
+
+void test(void)
+{
+ libcw::debug::location_ct loc((char*)__builtin_return_address(0) + libcw::debug::builtin_return_address_offset);
+ std::string funcname;
+ libcw::debug::demangle_symbol(loc.mangled_function_name(), funcname);
+ Dout(dc::notice, "Called from " << funcname );
+}
+
+class A {
+ public:
+ A(void);
+};
+
+A::A(void)
+{
+ Dout(dc::notice, "Called from " << location_ct((char*)__builtin_return_address(0) + libcw::debug::builtin_return_address_offset) );
+ test();
+}
+
+int main(void)
+{
+ ForAllDebugChannels( if (!debugChannel.is_on()) debugChannel.on(); );
+ Debug( libcw_do.set_ostream(&std::cout) );
+ Debug( libcw_do.on() );
+
+ delete NEW(A);
+
+ return 0;
+}
----------------------- End of diff -----------------------
|
|
From: Carlo W. <li...@us...> - 2002-02-21 22:53:13
|
CVSROOT : /cvsroot/libcw
Module : src
Commit time: 2002-01-21 22:53:10 UTC
Modified files:
libcwd/documentation/tutorial/tut1.m4
Log message:
Typo.
---------------------- diff included ----------------------
Index: src/libcwd/documentation/tutorial/tut1.m4
diff -u src/libcwd/documentation/tutorial/tut1.m4:1.9 src/libcwd/documentation/tutorial/tut1.m4:1.10
--- src/libcwd/documentation/tutorial/tut1.m4:1.9 Sun Feb 17 16:44:06 2002
+++ src/libcwd/documentation/tutorial/tut1.m4 Thu Feb 21 14:53:00 2002
@@ -76,7 +76,7 @@
</UL></DIV>
<A NAME="turn_on_channel"></A>
-<H3></CODE>Debug( dc::notice.on() );</CODE></H3>
+<H3><CODE>Debug( dc::notice.on() );</CODE></H3>
<P>This turns on the <I><U>D</U>ebug <U>C</U>hannel</I> <CODE><U>dc</U>::notice</CODE>.
Without this line, the code <CODE>Dout(dc::notice, "Hello World")</CODE> would output
----------------------- End of diff -----------------------
|
|
From: Carlo W. <li...@us...> - 2002-02-24 21:55:25
|
CVSROOT : /cvsroot/libcw
Module : src
Commit time: 2002-01-24 21:55:23 UTC
Modified files:
libcwd/documentation/tutorial/tut8.m4
Log message:
Mutex must also be global.
---------------------- diff included ----------------------
Index: src/libcwd/documentation/tutorial/tut8.m4
diff -u src/libcwd/documentation/tutorial/tut8.m4:1.3 src/libcwd/documentation/tutorial/tut8.m4:1.4
--- src/libcwd/documentation/tutorial/tut8.m4:1.3 Sun Feb 17 22:08:06 2002
+++ src/libcwd/documentation/tutorial/tut8.m4 Sun Feb 24 13:55:13 2002
@@ -66,6 +66,10 @@
return (void*)true;
}
+#ifdef CWDEBUG
+pthread_mutex_t cout_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif
+
int main(void)
{
// Don't output a single character at a time (yuk)
@@ -74,9 +78,6 @@
// Do header files and library match?
Debug( check_configuration() );
// Send debug output to std::cout.
-#ifdef CWDEBUG
- pthread_mutex_t cout_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif
Debug( libcw_do.set_ostream(&std::cout, &cout_mutex) );
// Turn debug object on.
Debug( libcw_do.on() );
----------------------- End of diff -----------------------
|
|
From: Carlo W. <li...@us...> - 2002-02-24 22:36:14
|
CVSROOT : /cvsroot/libcw
Module : src
Commit time: 2002-01-24 22:36:13 UTC
Modified files:
libcwd/documentation/symbols_intro.dox
libcwd/include/libcw/debug.h libcwd/include/libcw/demangle.h
Log message:
demangle documentation fixes.
added intro for symbols chapter.
---------------------- diff included ----------------------
Index: src/libcwd/documentation/symbols_intro.dox
diff -u src/libcwd/documentation/symbols_intro.dox:1.2 src/libcwd/documentation/symbols_intro.dox:1.3
--- src/libcwd/documentation/symbols_intro.dox:1.2 Sat Dec 29 20:17:47 2001
+++ src/libcwd/documentation/symbols_intro.dox Sun Feb 24 14:36:02 2002
@@ -6,7 +6,38 @@
\page page_symbols_intro
\ingroup chapter_symbols_intro
-Fix me: add text.
+Libcwd reads the symbol table of the application and of each
+of the linked object files upon initialization.
+It then allows you to translate program counter addresses to
+function names, source file names and line numbers.
+You can also print demangled names of any symbol or type, making
+the debug output better human readable.
+
+<b>Example 1: printing the location that a function was called from:</b>
+
+\code
+#ifdef CWDEBUG
+// Get the location that we were called from.
+libcw::debug::location_ct location((char*)__builtin_return_address(0)
+ + libcw::debug::builtin_return_address_offset);
+// Demangle the function name of the location that we were called from.
+std::string demangled_function_name;
+libcw::debug::demangle_symbol(location.mangled_function_name(), demangled_function_name);
+// Print it.
+Dout(dc::notice, "This function was called from " << demangled_function_name << '(' << location << ')');
+#endif
+\endcode
+
+<b>Example 2: Printing the demangled name of the current (template) function:</b>
+
+\code
+// If we are in template Foo<TYPE>::f()
+Dout(dc::notice, "We are in Foo<" << type_info_of<TYPE>().demangled_name() << ">::f()");
+\endcode
+
+Note that calling \ref demangle_symbol costs cpu every time you call it, but using
+\ref type_info_of<> does not cost any cpu: the demangling is done once, during the
+initialization of libcwd; \ref type_info_of<> merely returns a static pointer.
*/
Index: src/libcwd/include/libcw/debug.h
diff -u src/libcwd/include/libcw/debug.h:1.45 src/libcwd/include/libcw/debug.h:1.46
--- src/libcwd/include/libcw/debug.h:1.45 Wed Feb 20 18:05:31 2002
+++ src/libcwd/include/libcw/debug.h Sun Feb 24 14:36:03 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debug.h,v 1.45 2002/02/21 02:05:31 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debug.h,v 1.46 2002/02/24 22:36:03 libcw Exp $
//
// Copyright (C) 2000 - 2002, by
//
@@ -228,6 +228,7 @@
#include <libcw/macro_ForAllDebugChannels.h>
#include <libcw/macro_ForAllDebugObjects.h>
#include <libcw/private_environ.h>
+#include <libcw/demangle.h>
// Include the inline functions.
#include <libcw/class_channel.inl> // Debug channels.
Index: src/libcwd/include/libcw/demangle.h
diff -u src/libcwd/include/libcw/demangle.h:1.7 src/libcwd/include/libcw/demangle.h:1.8
--- src/libcwd/include/libcw/demangle.h:1.7 Sun Feb 17 17:24:47 2002
+++ src/libcwd/include/libcw/demangle.h Sun Feb 24 14:36:03 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/demangle.h,v 1.7 2002/02/18 01:24:47 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/demangle.h,v 1.8 2002/02/24 22:36:03 libcw Exp $
//
// Copyright (C) 2000 - 2002, by
//
@@ -26,8 +26,13 @@
namespace libcw {
namespace debug {
+/** \addtogroup group_demangle */
+/** \{ */
+
extern void demangle_type(char const* input, std::string& output);
extern void demangle_symbol(char const* input, std::string& output);
+
+/** \} */
} // namespace debug
} // namespace libcw
----------------------- End of diff -----------------------
|
|
From: Carlo W. <li...@us...> - 2002-02-24 22:39:53
|
CVSROOT : /cvsroot/libcw
Module : src
Commit time: 2002-01-24 22:39:51 UTC
Modified files:
libcwd/tests/threads4.cc
Log message:
Also here global.
---------------------- diff included ----------------------
Index: src/libcwd/tests/threads4.cc
diff -u src/libcwd/tests/threads4.cc:1.12 src/libcwd/tests/threads4.cc:1.13
--- src/libcwd/tests/threads4.cc:1.12 Wed Feb 20 18:05:32 2002
+++ src/libcwd/tests/threads4.cc Sun Feb 24 14:39:40 2002
@@ -70,6 +70,8 @@
return (void *)(cnt == loopsize);
}
+pthread_mutex_t cout_mutex = PTHREAD_MUTEX_INITIALIZER;
+
int main(void)
{
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
@@ -77,7 +79,6 @@
#if CWDEBUG_ALLOC
libcw::debug::make_all_allocations_invisible_except(NULL);
#endif
- pthread_mutex_t cout_mutex = PTHREAD_MUTEX_INITIALIZER;
Debug( libcw_do.set_ostream(&std::cout, &cout_mutex) );
Debug( libcw_do.on() );
char margin[32];
----------------------- End of diff -----------------------
|