You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(13) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(60) |
Feb
(54) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
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 ----------------------- |
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 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-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-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 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 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 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 -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM #define DEBUGDEBUG_DoutInternal_MARKER DEBUGDEBUG_CERR( "DoutInternal at " << __FILE__ << ':' << __LINE__ ) #define DEBUGDEBUG_DoutFatalInternal_MARKER DEBUGDEBUG_CERR( "DoutFatalInternal at " << __FILE__ << ':' << __LINE__ ) #define DEBUGDEBUG_ELSE_DoutInternal(data) else DEBUGDEBUG_CERR( "library_call == " << __libcwd_tsd.library_call << "; DoutInternal skipped for: " << data ); @@ -376,7 +376,7 @@ bool inside_ios_base_Init_Init(void) // Single Threaded function. { LIBCWD_TSD_DECLARATION -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM LIBCWD_ASSERT( __libcwd_tsd.internal == 0 ); #endif #ifndef _GLIBCPP_USE_WCHAR_T @@ -394,7 +394,7 @@ } #endif // __GLIBCPP__ -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM // _private_:: void set_alloc_checking_off(LIBCWD_TSD_PARAM) { @@ -438,7 +438,7 @@ from_free, // memblk_type_malloc from_free, // memblk_type_realloc error, // memblk_type_freed -#ifdef DEBUGMARKER +#if CWDEBUG_MARKER from_delete, // memblk_type_marker error, // memblk_type_deleted_marker #endif @@ -475,7 +475,7 @@ case memblk_type_freed: os << "memblk_type_freed"; break; -#ifdef DEBUGMARKER +#if CWDEBUG_MARKER case memblk_type_marker: os << "memblk_type_marker"; break; @@ -515,7 +515,7 @@ case memblk_type_realloc: os.write("realloc ", 10); break; -#ifdef DEBUGMARKER +#if CWDEBUG_MARKER case memblk_type_marker: os.write("(MARKER) ", 10); break; @@ -534,7 +534,7 @@ } } -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM _private_::raw_write_nt const& operator<<(_private_::raw_write_nt const& raw_write, memblk_key_ct const& data) { write(2, "<memblk_key_ct>", 15); @@ -556,7 +556,7 @@ // a list, therefore we have to implement our own list (prev/next pointers). class dm_alloc_ct : public alloc_ct { -#ifdef DEBUGMARKER +#if CWDEBUG_MARKER friend class marker_ct; friend void move_outside(marker_ct* marker, void const* ptr); #endif @@ -586,7 +586,7 @@ ++memblks; } // Constructor: Add `node' at the start of `list' -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM dm_alloc_ct(dm_alloc_ct const& __dummy) : alloc_ct(__dummy) { LIBCWD_TSD_DECLARATION DoutFatalInternal( dc::fatal, "Calling dm_alloc_ct::dm_alloc_ct(dm_alloc_ct const&)" ); } // No copy constructor allowed. #endif @@ -652,7 +652,7 @@ { return a_start > b.end() || (a_start == b.end() && b.size() > 0); } bool operator==(memblk_key_ct b) const { -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM { LIBCWD_TSD_DECLARATION LIBCWD_ASSERT( __libcwd_tsd.internal ); @@ -664,7 +664,7 @@ void printOn(std::ostream& os) const; friend inline std::ostream& operator<<(std::ostream& os, memblk_key_ct const& memblk) { memblk.printOn(os); return os; } friend inline _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, memblk_key_ct const& memblk) { memblk.printOn(os.M_os); return os; } -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM static bool selftest(void); // Returns true is the self test FAILED. #endif @@ -673,7 +673,7 @@ }; class memblk_info_ct { -#ifdef DEBUGMARKER +#if CWDEBUG_MARKER friend class marker_ct; friend void move_outside(marker_ct* marker, void const* ptr); #endif @@ -765,7 +765,7 @@ inline bool dm_alloc_ct::is_deleted(void) const { return (a_memblk_type == memblk_type_deleted || -#ifdef DEBUGMARKER +#if CWDEBUG_MARKER a_memblk_type == memblk_type_deleted_marker || #endif a_memblk_type == memblk_type_freed); @@ -773,7 +773,7 @@ dm_alloc_ct::~dm_alloc_ct() // MT-safe: write lock is set. { -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM { LIBCWD_TSD_DECLARATION LIBCWD_ASSERT( __libcwd_tsd.internal ); @@ -799,7 +799,7 @@ } #if __GNUC__ == 2 && __GNUC_MINOR__ < 96 -#ifdef DEBUGUSEBFD +#if CWDEBUG_LOCATION // Bug work around. inline std::ostream& operator<<(std::ostream& os, smanip<int> const& smanip) { @@ -815,19 +815,19 @@ extern void demangle_symbol(char const* in, _private_::internal_string& out); -#ifdef DEBUGUSEBFD +#if CWDEBUG_LOCATION struct dm_location_ct : public location_ct { void print_on(std::ostream& os) const; friend _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, dm_location_ct const& data); -#ifdef DEBUGDEBUGOUTPUT +#if CWDEBUG_DEBUGOUTPUT friend _private_::raw_write_nt const& operator<<(_private_::raw_write_nt const& os, dm_location_ct const& data); #endif }; -#endif // DEBUGUSEBFD +#endif // CWDEBUG_LOCATION static char const* const twentyfive_spaces_c = " "; -#ifdef DEBUGUSEBFD +#if CWDEBUG_LOCATION _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, dm_location_ct const& data) { size_t len = strlen(data.M_filename); @@ -847,7 +847,7 @@ return os; } -#ifdef DEBUGDEBUGOUTPUT +#if CWDEBUG_DEBUGOUTPUT _private_::raw_write_nt const& operator<<(_private_::raw_write_nt const& raw_write, dm_location_ct const& data) { size_t len = strlen(data.M_filename); @@ -866,15 +866,15 @@ write(2, twentyfive_spaces_c, cnt); return raw_write; } -#endif // DEBUGDEBUGOUTPUT -#endif // DEBUGUSEBFD +#endif // CWDEBUG_DEBUGOUTPUT +#endif // CWDEBUG_LOCATION void dm_alloc_ct::print_description(LIBCWD_TSD_PARAM) const { -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM LIBCWD_ASSERT( !__libcwd_tsd.internal && !__libcwd_tsd.library_call ); #endif -#ifdef DEBUGUSEBFD +#if CWDEBUG_LOCATION if (M_location.is_known()) DoutInternal(dc::continued, *static_cast<dm_location_ct const*>(&M_location)); else if (M_location.mangled_function_name() != unknown_function_c) @@ -893,7 +893,7 @@ DoutInternal( dc::continued, twentyfive_spaces_c ); #endif -#ifdef DEBUGMARKER +#if CWDEBUG_MARKER if (a_memblk_type == memblk_type_marker || a_memblk_type == memblk_type_deleted_marker) DoutInternal( dc::continued, "<marker>;" ); else @@ -992,13 +992,13 @@ void memblk_info_ct::erase(LIBCWD_TSD_PARAM) { -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM LIBCWD_ASSERT( __libcwd_tsd.internal ); #endif dm_alloc_ct* ap = a_alloc_node.get(); -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM if (ap) - LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: memblk_info_ct::erase for " << ap->start() ); + LIBCWD_DEBUGM_CERR( "CWDEBUG_DEBUGM: memblk_info_ct::erase for " << ap->start() ); #endif if (ap && ap->next_list()) { @@ -1017,7 +1017,7 @@ case memblk_type_external: new_flag = memblk_type_freed; break; -#ifdef DEBUGMARKER +#if CWDEBUG_MARKER case memblk_type_marker: new_flag = memblk_type_deleted_marker; break; @@ -1033,7 +1033,7 @@ } -#ifdef DEBUGMAGICMALLOC +#if CWDEBUG_MAGIC size_t const INTERNAL_MAGIC_NEW_BEGIN = 0x7af45b1c; size_t const INTERNAL_MAGIC_NEW_END = 0x3b9f018a; @@ -1137,7 +1137,7 @@ return ") with a corrupt second magic number (buffer overrun?)!"; } -#endif // DEBUGMAGICMALLOC +#endif // CWDEBUG_MAGIC //============================================================================= // @@ -1158,30 +1158,30 @@ #define SIZE_PLUS_FOUR(s) ((s) + sizeof(size_t)) # endif -#ifdef DEBUGUSEBFD -#if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) +#if CWDEBUG_LOCATION +#if CWDEBUG_DEBUGM && CWDEBUG_DEBUGOUTPUT static void* internal_malloc(size_t size, memblk_types_nt flag, void* call_addr LIBCWD_COMMA_TSD_PARAM, int saved_marker) #else static void* internal_malloc(size_t size, memblk_types_nt flag, void* call_addr LIBCWD_COMMA_TSD_PARAM) #endif -#else // !DEBUGUSEBFD -#if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) +#else // !CWDEBUG_LOCATION +#if CWDEBUG_DEBUGM && CWDEBUG_DEBUGOUTPUT static void* internal_malloc(size_t size, memblk_types_nt flag LIBCWD_COMMA_TSD_PARAM, int saved_marker) #else static void* internal_malloc(size_t size, memblk_types_nt flag LIBCWD_COMMA_TSD_PARAM) #endif -#endif // !DEBUGUSEBFD +#endif // !CWDEBUG_LOCATION { if (WST_initialization_state <= 0) // Only true prior to initialization of std::ios_base::Init. { -#ifdef DEBUGDEBUG +#if CWDEBUG_DEBUG bool continued_debug_output = (__libcwd_tsd.library_call == 0 && LIBCWD_DO_TSD_MEMBER_OFF(libcw_do) < 0); #endif init_debugmalloc(); -#ifdef DEBUGDEBUG +#if CWDEBUG_DEBUG // It is possible that libcwd is not initialized at this point, LIBCWD_DO_TSD_MEMBER_OFF(libcw_do) == 0 (turned off) // and thus no unfinished debug output was printed before entering this function. - // Initialization of libcwd with DEBUGDEBUG defined turns on libcwd_do. In order to balance the + // Initialization of libcwd with CWDEBUG_DEBUG set turns on libcwd_do. In order to balance the // continued stack, we print an unfinished debug message here. if (continued_debug_output != (__libcwd_tsd.library_call == 0 && LIBCWD_DO_TSD_MEMBER_OFF(libcw_do) < 0)) DoutInternal( dc_malloc|continued_cf, "internal_malloc(" << size << ", " << flag << ") = " ); @@ -1189,13 +1189,13 @@ } register void* mptr; -#ifndef DEBUGMAGICMALLOC +#if !CWDEBUG_MAGIC if (!(mptr = __libc_malloc(size))) #else if ((mptr = static_cast<char*>(__libc_malloc(SIZE_PLUS_TWELVE(size))) + 2 * sizeof(size_t)) == (void*)(2 * sizeof(size_t))) #endif { -#if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) +#if CWDEBUG_DEBUGM && CWDEBUG_DEBUGOUTPUT DoutInternal( dc::finish, "NULL [" << saved_marker << ']' ); #else DoutInternal( dc::finish, "NULL" ); @@ -1204,7 +1204,7 @@ return NULL; // A fatal error should occur directly after this } -#ifdef DEBUGUSEBFD +#if CWDEBUG_LOCATION if (__libcwd_tsd.library_call++) ++LIBCWD_DO_TSD_MEMBER_OFF(libcw_do); // Otherwise debug output will be generated from bfd.cc (location_ct) location_ct loc(call_addr LIBCWD_COMMA_TSD); @@ -1212,7 +1212,7 @@ --LIBCWD_DO_TSD_MEMBER_OFF(libcw_do); #endif -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM bool error; #endif memblk_info_ct* memblk_info; @@ -1227,7 +1227,7 @@ std::pair<memblk_map_ct::iterator, bool> const& iter(memblk_map_write->insert(memblk_ct(memblk_key_ct(mptr, size), memblk_info_ct(mptr, size, flag)))); memblk_info = &(*iter.first).second; -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM error = !iter.second; #endif RELEASE_WRITE_LOCK @@ -1237,18 +1237,18 @@ LIBCWD_RESTORE_CANCEL -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM // MT-safe: iter points to an element that is garanteed unique to this thread (we just allocated it). if (error) DoutFatalInternal( dc::core, "memblk_map corrupt: Newly allocated block collides with existing memblk!" ); #endif memblk_info->lock(); // Lock ownership (doesn't call malloc). -#ifdef DEBUGUSEBFD +#if CWDEBUG_LOCATION memblk_info->get_alloc_node()->location_reference().move(loc); #endif -#if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) +#if CWDEBUG_DEBUGM && CWDEBUG_DEBUGOUTPUT DoutInternal( dc::finish, (void*)(mptr) << " [" << saved_marker << ']' ); #else DoutInternal( dc::finish, (void*)(mptr) ); @@ -1258,34 +1258,34 @@ static void internal_free(void* ptr, deallocated_from_nt from LIBCWD_COMMA_TSD_PARAM) { -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM // 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) { - 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."); + LIBCWD_DEBUGM_CERR("CWDEBUG_DEBUGM: 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(LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC) +#if CWDEBUG_DEBUGM && 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) { -#if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) +#if CWDEBUG_DEBUGM && CWDEBUG_DEBUGOUTPUT if (from == from_delete) { - LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal `delete(" << ptr << ")' [" << ++__libcwd_tsd.marker << ']' ); + LIBCWD_DEBUGM_CERR( "CWDEBUG_DEBUGM: Internal `delete(" << ptr << ")' [" << ++__libcwd_tsd.marker << ']' ); } else if (from == from_delete_array) { - LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal `delete[](" << ptr << ")' [" << ++__libcwd_tsd.marker << ']' ); + LIBCWD_DEBUGM_CERR( "CWDEBUG_DEBUGM: Internal `delete[](" << ptr << ")' [" << ++__libcwd_tsd.marker << ']' ); } else { - LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal `free(" << ptr << ")' [" << ++__libcwd_tsd.marker << ']' ); + LIBCWD_DEBUGM_CERR( "CWDEBUG_DEBUGM: Internal `free(" << ptr << ")' [" << ++__libcwd_tsd.marker << ']' ); } -#endif // DEBUGDEBUGMALLOC -#ifdef DEBUGMAGICMALLOC +#endif // CWDEBUG_DEBUGM +#if CWDEBUG_MAGIC if (!ptr) return; ptr = static_cast<size_t*>(ptr) - 2; @@ -1312,7 +1312,7 @@ } ((size_t*)ptr)[0] ^= (size_t)-1; ((size_t*)(static_cast<char*>(ptr) + SIZE_PLUS_TWELVE(((size_t*)ptr)[1])))[-1] ^= (size_t)-1; -#endif // DEBUGMAGICMALLOC +#endif // CWDEBUG_MAGIC __libc_free(ptr); return; } // internal @@ -1320,7 +1320,7 @@ ++__libcwd_tsd.inside_malloc_or_free; if (!ptr) { -#if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) +#if CWDEBUG_DEBUGM && CWDEBUG_DEBUGOUTPUT DoutInternal( dc_malloc, "Trying to free NULL - ignored [" << ++__libcwd_tsd.marker << "]." ); #else DoutInternal( dc_malloc, "Trying to free NULL - ignored." ); @@ -1336,7 +1336,7 @@ { RELEASE_READ_LOCK LIBCWD_RESTORE_CANCEL_NO_BRACE -#ifdef DEBUGMAGICMALLOC +#if CWDEBUG_MAGIC if (((size_t*)ptr)[-2] == INTERNAL_MAGIC_NEW_BEGIN || ((size_t*)ptr)[-2] == INTERNAL_MAGIC_NEW_ARRAY_BEGIN || ((size_t*)ptr)[-2] == INTERNAL_MAGIC_MALLOC_BEGIN) @@ -1360,7 +1360,7 @@ << ptr << ((from == from_free) ? ") " : " ") ); if (channels::dc_malloc.is_on()) (*iter).second.print_description(LIBCWD_TSD); -#if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) +#if CWDEBUG_DEBUGM && CWDEBUG_DEBUGOUTPUT DoutInternal( dc::continued, " [" << ++__libcwd_tsd.marker << "] " ); #else DoutInternal( dc::continued, ' ' ); @@ -1403,7 +1403,7 @@ DEBUGDEBUG_CERR( "__libcwd_free: internal == " << __libcwd_tsd.internal << "; setting it to 1." ); __libcwd_tsd.internal = 1; -#ifdef DEBUGMAGICMALLOC +#if CWDEBUG_MAGIC bool has_alloc_node = (*iter).second.has_alloc_node(); // Needed for diagnostic message below. #endif @@ -1421,7 +1421,7 @@ LIBCWD_RESTORE_CANCEL_NO_BRACE -#ifdef DEBUGMAGICMALLOC +#if CWDEBUG_MAGIC if (f == memblk_type_external) __libc_free(ptr); else @@ -1448,9 +1448,9 @@ ((size_t*)(static_cast<char*>(ptr) + SIZE_PLUS_FOUR(((size_t*)ptr)[-1])))[-1] ^= (size_t)-1; __libc_free(static_cast<size_t*>(ptr) - 2); // Free memory block } -#else // !DEBUGMAGICMALLOC +#else // !CWDEBUG_MAGIC __libc_free(ptr); // Free memory block -#endif // !DEBUGMAGICMALLOC +#endif // !CWDEBUG_MAGIC if (visible) DoutInternal( dc::finish, "" ); @@ -1575,8 +1575,8 @@ * \brief List all current allocations to a given %debug object. * \ingroup group_overview * - * With both, \link enable_libcwd_debugm DEBUGMALLOC \endlink and - * \link enable_libcwd_debug DEBUGDEBUG \endlink defined, it is possible + * With both, \link enable_libcwd_debugm CWDEBUG_ALLOC \endlink and + * \link enable_libcwd_debug CWDEBUG_DEBUG \endlink set to 1, it is possible * to write the \ref group_overview "overview of allocated memory" to * a \ref group_debug_object "Debug Object". * The syntax to do this is: @@ -1590,7 +1590,7 @@ */ void list_allocations_on(debug_ct& debug_object) { -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM { LIBCWD_TSD_DECLARATION LIBCWD_ASSERT( !__libcwd_tsd.inside_malloc_or_free && !__libcwd_tsd.internal ); @@ -1651,7 +1651,7 @@ void make_invisible(void const* ptr) { LIBCWD_TSD_DECLARATION -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM LIBCWD_ASSERT( !__libcwd_tsd.internal ); #endif LIBCWD_DEFER_CANCEL @@ -1694,7 +1694,7 @@ void make_all_allocations_invisible_except(void const* ptr) { LIBCWD_TSD_DECLARATION -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM LIBCWD_ASSERT( !__libcwd_tsd.internal ); #endif LIBCWD_DEFER_CANCEL @@ -1736,22 +1736,22 @@ } #undef CALL_ADDRESS -#ifdef DEBUGUSEBFD +#if CWDEBUG_LOCATION #define CALL_ADDRESS , reinterpret_cast<char*>(__builtin_return_address(0)) + builtin_return_address_offset #else #define CALL_ADDRESS #endif #undef SAVEDMARKER -#if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) +#if CWDEBUG_DEBUGM && CWDEBUG_DEBUGOUTPUT #define SAVEDMARKER , saved_marker #else #define SAVEDMARKER #endif -#ifdef DEBUGMARKER +#if CWDEBUG_MARKER void marker_ct::register_marker(char const* label) { -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM LIBCWD_TSD_DECLARATION LIBCWD_ASSERT( !__libcwd_tsd.inside_malloc_or_free && !__libcwd_tsd.internal ); #endif @@ -1773,7 +1773,7 @@ LIBCWD_RESTORE_CANCEL if (error) DoutFatal( dc::core, "Use 'new' for libcw::debug::marker_ct" ); -#if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) +#if CWDEBUG_DEBUGM && CWDEBUG_DEBUGOUTPUT Debug( list_allocations_on(libcw_do) ); #endif } @@ -1783,7 +1783,7 @@ */ marker_ct::~marker_ct(void) { -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM LIBCWD_TSD_DECLARATION LIBCWD_ASSERT( !__libcwd_tsd.inside_malloc_or_free && !__libcwd_tsd.internal ); #endif @@ -1828,7 +1828,7 @@ */ void move_outside(marker_ct* marker, void const* ptr) { -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM LIBCWD_TSD_DECLARATION LIBCWD_ASSERT( !__libcwd_tsd.inside_malloc_or_free && !__libcwd_tsd.internal ); #endif @@ -1895,7 +1895,7 @@ RELEASE_READ_LOCK LIBCWD_RESTORE_CANCEL_NO_BRACE } -#endif // DEBUGMARKER +#endif // CWDEBUG_MARKER /** * \brief Find information about a memory allocation. @@ -1926,7 +1926,7 @@ */ alloc_ct const* find_alloc(void const* ptr) { -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM LIBCWD_TSD_DECLARATION LIBCWD_ASSERT( !__libcwd_tsd.inside_malloc_or_free && !__libcwd_tsd.internal ); #endif @@ -1946,7 +1946,7 @@ // Self tests: // -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM bool memblk_key_ct::selftest(void) { @@ -2025,7 +2025,7 @@ return false; } -#endif // DEBUGDEBUGMALLOC +#endif // CWDEBUG_DEBUGM #ifndef LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC @@ -2045,10 +2045,10 @@ void register_external_allocation(void const* mptr, size_t size) { LIBCWD_TSD_DECLARATION -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM LIBCWD_ASSERT( !__libcwd_tsd.inside_malloc_or_free && !__libcwd_tsd.internal ); #endif -#if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) +#if CWDEBUG_DEBUGM && defined(__GLIBCPP__) LIBCWD_ASSERT( _private_::WST_ios_base_initialized ); #endif if (__libcwd_tsd.internal) @@ -2066,7 +2066,7 @@ __libcwd_tsd.internal = 0; } -#ifdef DEBUGUSEBFD +#if CWDEBUG_LOCATION if (__libcwd_tsd.library_call++) ++LIBCWD_DO_TSD_MEMBER_OFF(libcw_do); // Otherwise debug output will be generated from bfd.cc (location_ct) location_ct loc(reinterpret_cast<char*>(__builtin_return_address(0)) + builtin_return_address_offset LIBCWD_COMMA_TSD); @@ -2094,7 +2094,7 @@ memblk_info_ct& memblk_info((*iter.first).second); memblk_info.lock(); // Lock ownership (doesn't call malloc). -#ifdef DEBUGUSEBFD +#if CWDEBUG_LOCATION memblk_info.get_alloc_node()->location_reference().move(loc); #endif --__libcwd_tsd.inside_malloc_or_free; @@ -2126,7 +2126,7 @@ // malloc(3) and calloc(3) replacements: // -#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && defined(DEBUGDEBUG) +#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && CWDEBUG_DEBUG #define UNLOCK if (locked) _private_::allocator_unlock(); #else #define UNLOCK @@ -2135,54 +2135,54 @@ void* __libcwd_malloc(size_t size) { LIBCWD_TSD_DECLARATION -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM // 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) { - FATALDEBUGDEBUG_CERR("DEBUGDEBUGMALLOC: debugmalloc.cc:" << __LINE__ - 2 << ": " << __PRETTY_FUNCTION__ << ": Assertion `__libcwd_tsd.inside_malloc_or_free <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed."); + FATALDEBUGDEBUG_CERR("CWDEBUG_DEBUGM: 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 +#if CWDEBUG_DEBUGOUTPUT int saved_marker = ++__libcwd_tsd.marker; #endif #endif -#if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC) +#if CWDEBUG_DEBUGM && 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) { - LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Entering `__libcwd_malloc(" << size << ")' [" << saved_marker << ']' ); + LIBCWD_DEBUGM_CERR( "CWDEBUG_DEBUGM: Internal: Entering `__libcwd_malloc(" << size << ")' [" << saved_marker << ']' ); -#if !defined(DEBUGDEBUGMALLOC) && !defined(DEBUGMAGICMALLOC) +#if !CWDEBUG_DEBUGM && !CWDEBUG_MAGIC return __libc_malloc(size); -#else // defined(DEBUGDEBUGMALLOC) || defined(DEBUGMAGICMALLOC) +#else // CWDEBUG_DEBUGM || CWDEBUG_MAGIC -#ifndef DEBUGMAGICMALLOC +#if !CWDEBUG_MAGIC void* ptr = __libc_malloc(size); - LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_malloc': " << ptr << " [" << saved_marker << ']' ); + LIBCWD_DEBUGM_CERR( "CWDEBUG_DEBUGM: Internal: Leaving `__libcwd_malloc': " << ptr << " [" << saved_marker << ']' ); return ptr; -#else // DEBUGMAGICMALLOC +#else // CWDEBUG_MAGIC void* ptr = __libc_malloc(SIZE_PLUS_TWELVE(size)); if (!ptr) return NULL; ((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; - LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_malloc': " << static_cast<size_t*>(ptr) + 2 << " [" << saved_marker << ']' ); + LIBCWD_DEBUGM_CERR( "CWDEBUG_DEBUGM: Internal: Leaving `__libcwd_malloc': " << static_cast<size_t*>(ptr) + 2 << " [" << saved_marker << ']' ); return static_cast<size_t*>(ptr) + 2; -#endif // DEBUGMAGICMALLOC +#endif // CWDEBUG_MAGIC -#endif // defined(DEBUGDEBUGMALLOC) || defined(DEBUGMAGICMALLOC) +#endif // CWDEBUG_DEBUGM || CWDEBUG_MAGIC } // internal ++__libcwd_tsd.inside_malloc_or_free; -#if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) +#if CWDEBUG_DEBUGM && CWDEBUG_DEBUGOUTPUT DoutInternal( dc_malloc|continued_cf, "malloc(" << size << ") = [" << saved_marker << ']' ); #else DoutInternal( dc_malloc|continued_cf, "malloc(" << size << ") = " ); #endif void* ptr = internal_malloc(size, memblk_type_malloc CALL_ADDRESS LIBCWD_COMMA_TSD SAVEDMARKER); -#ifdef DEBUGMAGICMALLOC +#if CWDEBUG_MAGIC if (ptr) { ((size_t*)ptr)[-2] = MAGIC_MALLOC_BEGIN; @@ -2197,33 +2197,33 @@ void* __libcwd_calloc(size_t nmemb, size_t size) { LIBCWD_TSD_DECLARATION -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM // 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) { - 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."); + LIBCWD_DEBUGM_CERR("CWDEBUG_DEBUGM: 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 +#if CWDEBUG_DEBUGOUTPUT int saved_marker = ++__libcwd_tsd.marker; #endif #endif -#if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC) +#if CWDEBUG_DEBUGM && 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) { - LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Entering `__libcwd_calloc(" << nmemb << ", " << size << ")' [" << saved_marker << ']' ); + LIBCWD_DEBUGM_CERR( "CWDEBUG_DEBUGM: Internal: Entering `__libcwd_calloc(" << nmemb << ", " << size << ")' [" << saved_marker << ']' ); -#if !defined(DEBUGDEBUGMALLOC) && !defined(DEBUGMAGICMALLOC) +#if !CWDEBUG_DEBUGM && !CWDEBUG_MAGIC return __libc_calloc(nmemb, size); -#else // defined(DEBUGDEBUGMALLOC) || defined(DEBUGMAGICMALLOC) +#else // CWDEBUG_DEBUGM || CWDEBUG_MAGIC -#ifndef DEBUGMAGICMALLOC +#if !CWDEBUG_MAGIC void* ptr = __libc_calloc(nmemb, size); - LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_calloc': " << ptr << " [" << saved_marker << ']' ); + LIBCWD_DEBUGM_CERR( "CWDEBUG_DEBUGM: Internal: Leaving `__libcwd_calloc': " << ptr << " [" << saved_marker << ']' ); return ptr; -#else // DEBUGMAGICMALLOC +#else // CWDEBUG_MAGIC void* ptr = __libc_malloc(SIZE_PLUS_TWELVE(nmemb * size)); if (!ptr) return NULL; @@ -2231,15 +2231,15 @@ ((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; - LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_calloc': " << static_cast<size_t*>(ptr) + 2 << " [" << saved_marker << ']' ); + LIBCWD_DEBUGM_CERR( "CWDEBUG_DEBUGM: Internal: Leaving `__libcwd_calloc': " << static_cast<size_t*>(ptr) + 2 << " [" << saved_marker << ']' ); return static_cast<size_t*>(ptr) + 2; -#endif // DEBUGMAGICMALLOC +#endif // CWDEBUG_MAGIC -#endif // defined(DEBUGDEBUGMALLOC) || defined(DEBUGMAGICMALLOC) +#endif // CWDEBUG_DEBUGM || CWDEBUG_MAGIC } // internal ++__libcwd_tsd.inside_malloc_or_free; -#if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) +#if CWDEBUG_DEBUGM && CWDEBUG_DEBUGOUTPUT DoutInternal( dc_malloc|continued_cf, "calloc(" << nmemb << ", " << size << ") = [" << saved_marker << ']' ); #else DoutInternal( dc_malloc|continued_cf, "calloc(" << nmemb << ", " << size << ") = " ); @@ -2248,7 +2248,7 @@ size *= nmemb; if ((ptr = internal_malloc(size, memblk_type_malloc CALL_ADDRESS LIBCWD_COMMA_TSD SAVEDMARKER))) memset(ptr, 0, size); -#ifdef DEBUGMAGICMALLOC +#if CWDEBUG_MAGIC if (ptr) { ((size_t*)ptr)[-2] = MAGIC_MALLOC_BEGIN; @@ -2270,33 +2270,33 @@ void* __libcwd_realloc(void* ptr, size_t size) { LIBCWD_TSD_DECLARATION -#ifdef DEBUGDEBUGMALLOC +#if CWDEBUG_DEBUGM // 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) { - 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."); + LIBCWD_DEBUGM_CERR("CWDEBUG_DEBUGM: 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 +#if CWDEBUG_DEBUGOUTPUT int saved_marker = ++__libcwd_tsd.marker; #endif #endif -#if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC) +#if CWDEBUG_DEBUGM && 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) { - LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Entering `__libcwd_realloc(" << ptr << ", " << size << ")' [" << saved_marker << ']' ); + LIBCWD_DEBUGM_CERR( "CWDEBUG_DEBUGM: Internal: Entering `__libcwd_realloc(" << ptr << ", " << size << ")' [" << saved_marker << ']' ); -#if !defined(DEBUGDEBUGMALLOC) && !defined(DEBUGMAGICMALLOC) +#if !CWDEBUG_DEBUGM && !CWDEBUG_MAGIC return __libc_realloc(ptr, size); -#else // defined(DEBUGDEBUGMALLOC) || defined(DEBUGMAGICMALLOC) +#else // CWDEBUG_DEBUGM || CWDEBUG_MAGIC -#ifndef DEBUGMAGICMALLOC +#if !CWDEBUG_MAGIC void* ptr1 = __libc_realloc(ptr, size); - LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_realloc': " << ptr1 << " [" << saved_marker << ']' ); + LIBCWD_DEBUGM_CERR( "CWDEBUG_DEBUGM: Internal: Leaving `__libcwd_realloc': " << ptr1 << " [" << saved_marker << ']' ); return ptr1; -#else // DEBUGMAGICMALLOC +#else // CWDEBUG_MAGIC void* ptr1; if (ptr) { @@ -2307,7 +2307,7 @@ if (size == 0) { __libc_free(ptr); - LIBCWD_DEBUGM_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_realloc': NULL [" << saved_marker << ']' ); + LIBCWD_DEBUGM_CERR( "CWDEBUG_DEBUGM: Internal: Leaving `__libcwd_realloc': NULL [" << saved_marker << ']' ); return NULL; } ptr1 = __libc_realloc(ptr, SIZE_PLUS_TWELVE(size)); @@ -2317,15 +2317,15 @@ ((size_t*)ptr1)[0] = INTERNAL_MAGIC_MALLOC_BEGIN; ((size_t*)ptr1)[1] = size; ((size_t*)(static_cast<char*>(ptr1) + SIZE_PLUS_TWELVE(size... [truncated message content] |
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_allocator.h,v 1.5 2002/02/18 01:24:47 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_allocator.h,v 1.6 2002/02/20 03:55:52 libcw Exp $ // // Copyright (C) 2001 - 2002, by // @@ -227,13 +227,13 @@ #define LIBCWD_DEBUGDEBUG_COMMA(x) #endif -#define DEFAULT_ALLOC_USERSPACE(instance) ::libcw::debug::_private_:: \ +#define LIBCWD_DEFAULT_ALLOC_USERSPACE(instance) ::libcw::debug::_private_:: \ allocator_adaptor<char, \ ::std::alloc, \ false \ LIBCWD_DEBUGDEBUG_COMMA(::libcw::debug::_private_::instance)> -#define DEFAULT_ALLOC_INTERNAL(instance) ::libcw::debug::_private_:: \ +#define LIBCWD_DEFAULT_ALLOC_INTERNAL(instance) ::libcw::debug::_private_:: \ allocator_adaptor<char, \ ::std::__default_alloc_template \ < ::libcw::debug::_private_::instance == \ @@ -249,25 +249,25 @@ // libcwd mutex instance. Using a macro here instead of another template in order not to bloat the // mangling TOO much. #define LIBCWD_NS_INTERNAL_ALLOCATOR(instance) \ - DEFAULT_ALLOC_INTERNAL(instance) + LIBCWD_DEFAULT_ALLOC_INTERNAL(instance) #else // !LIBCWD_THREAD_SAFE // In a single threaded application, the Non_shared case is equivalent to the Single Threaded case. #define LIBCWD_NS_INTERNAL_ALLOCATOR(instance) \ - DEFAULT_ALLOC_INTERNAL(single_threaded_internal_instance) + LIBCWD_DEFAULT_ALLOC_INTERNAL(single_threaded_internal_instance) #endif // !LIBCWD_THREAD_SAFE #ifdef LIBCWD_THREAD_SAFE // LIBCWD_MT_*_ALLOCATOR uses an different allocator than the normal default allocator of libstdc++ // in the case of multi-threading because it can be that the allocator mutex is locked, which would // result in a deadlock if we try to use it again here. -#define LIBCWD_MT_INTERNAL_ALLOCATOR DEFAULT_ALLOC_INTERNAL(multi_threaded_internal_instance) -#define LIBCWD_MT_USERSPACE_ALLOCATOR DEFAULT_ALLOC_USERSPACE(multi_threaded_userspace_instance) +#define LIBCWD_MT_INTERNAL_ALLOCATOR LIBCWD_DEFAULT_ALLOC_INTERNAL(multi_threaded_internal_instance) +#define LIBCWD_MT_USERSPACE_ALLOCATOR LIBCWD_DEFAULT_ALLOC_USERSPACE(multi_threaded_userspace_instance) #else // !LIBCWD_THREAD_SAFE // LIBCWD_MT_*_ALLOCATOR uses the normal default allocator of libstdc++-v3 (alloc) using locking // itself. The userspace allocator shares it memory pool with everything else (that uses this // allocator, which is most of the (userspace) STL). -#define LIBCWD_MT_INTERNAL_ALLOCATOR DEFAULT_ALLOC_INTERNAL(single_threaded_internal_instance) -#define LIBCWD_MT_USERSPACE_ALLOCATOR DEFAULT_ALLOC_USERSPACE(single_threaded_userspace_instance) +#define LIBCWD_MT_INTERNAL_ALLOCATOR LIBCWD_DEFAULT_ALLOC_INTERNAL(single_threaded_internal_instance) +#define LIBCWD_MT_USERSPACE_ALLOCATOR LIBCWD_DEFAULT_ALLOC_USERSPACE(single_threaded_userspace_instance) #endif // !LIBCWD_THREAD_SAFE //--------------------------------------------------------------------------------------------------- ----------------------- 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-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-18 06:15:05
|
CVSROOT : /cvsroot/libcw Module : src Commit time: 2002-01-18 06:15:04 UTC Modified files: libcwd/include/libcw/class_debug.h Log message: Bug fix. ---------------------- diff included ---------------------- Index: src/libcwd/include/libcw/class_debug.h diff -u src/libcwd/include/libcw/class_debug.h:1.13 src/libcwd/include/libcw/class_debug.h:1.14 --- src/libcwd/include/libcw/class_debug.h:1.13 Sun Feb 17 21:39:14 2002 +++ src/libcwd/include/libcw/class_debug.h Sun Feb 17 22:14:54 2002 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_debug.h,v 1.13 2002/02/18 05:39:14 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_debug.h,v 1.14 2002/02/18 06:14:54 libcw Exp $ // // Copyright (C) 2000 - 2002, by // @@ -279,7 +279,7 @@ #endif // LIBCWD_THREAD_SAFE }; -#ifndef LIBCW_DOXYGEN +#if defined(LIBCWD_THREAD_SAFE) && !defined(LIBCW_DOXYGEN) // Specialization. template<> void debug_ct::set_ostream(std::ostream* os, pthread_mutex_t* mutex); ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2002-02-18 06:08:16
|
CVSROOT : /cvsroot/libcw Module : src Commit time: 2002-01-18 06:08:16 UTC Modified files: libcwd/NEWS libcwd/debug.cc libcwd/documentation/tutorial/tut8.m4 Log message: list_channels_on didn't print the margin. ---------------------- diff included ---------------------- Index: src/libcwd/NEWS diff -u src/libcwd/NEWS:1.72 src/libcwd/NEWS:1.73 --- src/libcwd/NEWS:1.72 Sun Feb 17 21:39:14 2002 +++ src/libcwd/NEWS Sun Feb 17 22:08:05 2002 @@ -27,6 +27,8 @@ that is defined under preferences -> appearance -> fonts. This should be set to -adobe-helvetica-*-. + list_channels_on didn't print the margin. + Fixed a dead lock in object_file_ct::find_nearest_line(). The dead lock occured when debug output written from load_dwarf/load_stabs, which must be done with userspace Index: src/libcwd/debug.cc diff -u src/libcwd/debug.cc:1.73 src/libcwd/debug.cc:1.74 --- src/libcwd/debug.cc:1.73 Sun Feb 17 17:24:46 2002 +++ src/libcwd/debug.cc Sun Feb 17 22:08:05 2002 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.73 2002/02/18 01:24:46 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.74 2002/02/18 06:08:05 libcw Exp $ // // Copyright (C) 2000 - 2002, by // @@ -1250,6 +1250,7 @@ i != _private_::debug_channels.read_locked().end(); ++i) { LibcwDoutScopeBegin(DEBUGCHANNELS, debug_object, dc::always|noprefix_cf); + LibcwDoutStream.write(LIBCWD_DO_TSD_MEMBER(debug_object, margin).c_str(), LIBCWD_DO_TSD_MEMBER(debug_object, margin).size()); LibcwDoutStream.write((*i)->get_label(), WST_max_len); if ((*i)->is_on()) LibcwDoutStream.write(": Enabled", 9); Index: src/libcwd/documentation/tutorial/tut8.m4 diff -u src/libcwd/documentation/tutorial/tut8.m4:1.2 src/libcwd/documentation/tutorial/tut8.m4:1.3 --- src/libcwd/documentation/tutorial/tut8.m4:1.2 Sun Feb 17 21:56:02 2002 +++ src/libcwd/documentation/tutorial/tut8.m4 Sun Feb 17 22:08:06 2002 @@ -117,12 +117,12 @@ <P>Which outputs something like:</P> <PRE class="output"> -BFD : Enabled -DEBUG : Enabled -MALLOC : Enabled -NOTICE : Enabled -SYSTEM : Enabled -WARNING : Enabled +1024 BFD : Enabled +1024 DEBUG : Enabled +1024 MALLOC : Enabled +1024 NOTICE : Enabled +1024 SYSTEM : Enabled +1024 WARNING : Enabled 1024 NOTICE : main: creating thread 0, <unfinished> 1024 MALLOC : malloc(8160) = <unfinished> 1024 BFD : address 0x401fbbd8 corresponds to pthread.c:533 ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2002-02-18 05:56:13
|
CVSROOT : /cvsroot/libcw Module : src Commit time: 2002-01-18 05:56:12 UTC Modified files: libcwd/documentation/tutorial/tut8.m4 Log message: Use < in tut8.m4. ---------------------- diff included ---------------------- Index: src/libcwd/documentation/tutorial/tut8.m4 diff -u src/libcwd/documentation/tutorial/tut8.m4:1.1 src/libcwd/documentation/tutorial/tut8.m4:1.2 --- src/libcwd/documentation/tutorial/tut8.m4:1.1 Sun Feb 17 20:36:07 2002 +++ src/libcwd/documentation/tutorial/tut8.m4 Sun Feb 17 21:56:02 2002 @@ -41,6 +41,12 @@ thread is printing the output. For example:</P> <PRE> +#include "sys.h" // See <A HREF="../html/preparation.html">documentation/html/preparation.html</A> +#include "debug.h" +#include <iostream> +#include <cstdio> +#include <pthread.h> + void* thread_function(void* arguments) { // Set Thread Specific on/off flags of the debug channels. @@ -54,10 +60,10 @@ #endif Debug( libcw_do.margin().assign(margin, 11) ); - Dout(dc::notice, "Entering thread " << pthread_self()); + Dout(dc::notice, "Entering thread " << pthread_self()); // ... do stuff - Dout(dc::notice, "Leaving thread " << pthread_self()); - return NULL; + Dout(dc::notice, "Leaving thread " << pthread_self()); + return (void*)true; } int main(void) @@ -88,24 +94,57 @@ // Create and join a few threads... int const number_of_threads = 4; pthread_t thread_id[number_of_threads]; - for (int i = 0; i < number_of_threads; ++i) + for (int i = 0; i < number_of_threads; ++i) { - Dout(dc::notice|continued_cf, "main: creating thread " << i << ", "); + Dout(dc::notice|continued_cf, "main: creating thread " << i << ", "); pthread_create(&thread_id[i], NULL, thread_function, NULL); - Dout(dc::finish, "id " << thread_id[i] << '.'); + Dout(dc::finish, "id " << thread_id[i] << '.'); } - for (int i = 0; i < number_of_threads; ++i) + for (int i = 0; i < number_of_threads; ++i) { void* status; pthread_join(thread_id[i], &status); - Dout(dc::notice, "main loop: thread " << i << ", id " << thread_id[i] << - ", returned with status " << ((bool)status ? "OK" : "ERROR") << '.'); + Dout(dc::notice, "main loop: thread " << i << ", id " << thread_id[i] << + ", returned with status " << ((bool)status ? "OK" : "ERROR") << '.'); } Dout(dc::notice, "Exiting from main()"); return 0; } +</PRE> + +<P>Which outputs something like:</P> + +<PRE class="output"> +BFD : Enabled +DEBUG : Enabled +MALLOC : Enabled +NOTICE : Enabled +SYSTEM : Enabled +WARNING : Enabled +1024 NOTICE : main: creating thread 0, <unfinished> +1024 MALLOC : malloc(8160) = <unfinished> +1024 BFD : address 0x401fbbd8 corresponds to pthread.c:533 +1024 MALLOC : <continued> 0x838689> +1024 NOTICE : <continued> id 1026. +1026 NOTICE : Entering thread 1026 +1026 NOTICE : Leaving thread 1026 +1024 NOTICE : main: creating thread 1, id 2051. +2051 NOTICE : Entering thread 2051 +2051 NOTICE : Leaving thread 2051 +1024 NOTICE : main: creating thread 2, id 3076. +3076 NOTICE : Entering thread 3076 +3076 NOTICE : Leaving thread 3076 +1024 NOTICE : main: creating thread 3, id 4101. +1024 NOTICE : main loop: thread 0, id 1026, returned with status OK. +1024 NOTICE : main loop: thread 1, id 2051, returned with status OK. +1024 NOTICE : main loop: thread 2, id 3076, returned with status OK. +4101 NOTICE : Entering thread 4101 +4101 NOTICE : Leaving thread 4101 +1024 NOTICE : main loop: thread 3, id 4101, returned with status OK. +1024 NOTICE : Exiting from main() +1024 MALLOC : free(0x8386890) pthread.c:533 <unknown type>; (sz = 8160) </PRE> <P>Congratulations, you are now a libcwd expert. If you still have any ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2002-02-18 05:39:26
|
CVSROOT : /cvsroot/libcw Module : src Commit time: 2002-01-18 05:39:25 UTC Modified files: libcwd/NEWS libcwd/include/libcw/class_debug.h libcwd/include/libcw/set_ostream.inl libcwd/tests/threads4.cc Log message: Gruwelijke Bug. ---------------------- diff included ---------------------- Index: src/libcwd/NEWS diff -u src/libcwd/NEWS:1.71 src/libcwd/NEWS:1.72 --- src/libcwd/NEWS:1.71 Sat Feb 16 17:42:06 2002 +++ src/libcwd/NEWS Sun Feb 17 21:39:14 2002 @@ -1,6 +1,16 @@ libcwd-0.99.17 + A tutorial on debugging threaded applications was added. + Bug fixes: + + The specialization of template + _private_::lock_interface_tct<pthread_mutex_t*> + was accidently left out of its header file, resulting in + the compile error: + /usr/include/libcw/private_lock_interface.h:38: no matching + function for call to `pthread_mutex_t::trylock()' + when trying to pass a pthread_mutex_t to debug_ct::set_ostream. Libcwd failed to find an executable in the current directory when one of the command line parameters contained a '/'. Index: src/libcwd/include/libcw/class_debug.h diff -u src/libcwd/include/libcw/class_debug.h:1.12 src/libcwd/include/libcw/class_debug.h:1.13 --- src/libcwd/include/libcw/class_debug.h:1.12 Sat Feb 16 17:42:07 2002 +++ src/libcwd/include/libcw/class_debug.h Sun Feb 17 21:39:14 2002 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_debug.h,v 1.12 2002/02/17 01:42:07 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_debug.h,v 1.13 2002/02/18 05:39:14 libcw Exp $ // // Copyright (C) 2000 - 2002, by // @@ -220,7 +220,7 @@ // void set_ostream(std::ostream* os); -#ifdef LIBCWD_THREAD_SAFE +#if defined(LIBCWD_THREAD_SAFE) || defined(LIBCW_DOXYGEN) template<class T> void set_ostream(std::ostream* os, T* mutex); #ifdef LIBCW_DOXYGEN @@ -242,7 +242,7 @@ void force_on(OnOffState& state); void restore(OnOffState const& state); -#ifdef LIBCWD_THREAD_SAFE +#if defined(LIBCWD_THREAD_SAFE) || defined(LIBCW_DOXYGEN) /** * \brief Keep Thread Specific Data after thread exit. * @@ -278,6 +278,12 @@ bool keep_tsd(bool keep); #endif // LIBCWD_THREAD_SAFE }; + +#ifndef LIBCW_DOXYGEN +// Specialization. +template<> + void debug_ct::set_ostream(std::ostream* os, pthread_mutex_t* mutex); +#endif } // namespace debug } // namespace libcw Index: src/libcwd/include/libcw/set_ostream.inl diff -u src/libcwd/include/libcw/set_ostream.inl:1.1 src/libcwd/include/libcw/set_ostream.inl:1.2 --- src/libcwd/include/libcw/set_ostream.inl:1.1 Tue Feb 12 19:55:26 2002 +++ src/libcwd/include/libcw/set_ostream.inl Sun Feb 17 21:39:14 2002 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/set_ostream.inl,v 1.1 2002/02/13 03:55:26 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/set_ostream.inl,v 1.2 2002/02/18 05:39:14 libcw Exp $ // // Copyright (C) 2002, by // @@ -21,7 +21,7 @@ #include <libcw/private_threading.h> #endif -#ifdef LIBCWD_THREAD_SAFE +#if defined(LIBCWD_THREAD_SAFE) || defined(LIBCWD_DOXYGEN) namespace libcw { namespace debug { @@ -70,6 +70,7 @@ } // namespace debug } // namespace libcw + #endif // LIBCWD_THREAD_SAFE #endif // LIBCW_SET_OSTREAM_INL Index: src/libcwd/tests/threads4.cc diff -u src/libcwd/tests/threads4.cc:1.10 src/libcwd/tests/threads4.cc:1.11 --- src/libcwd/tests/threads4.cc:1.10 Mon Feb 11 21:40:32 2002 +++ src/libcwd/tests/threads4.cc Sun Feb 17 21:39:14 2002 @@ -2,6 +2,7 @@ #include "threads_debug.h" #include <iostream> #include <sstream> +#include <cstdio> // For sprintf #ifdef CWDEBUG namespace debug_channels { ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2002-02-18 05:07:32
|
CVSROOT : /cvsroot/libcw Module : src Commit time: 2002-01-18 05:07:32 UTC Modified files: libcwd/include/libcw/Makefile.am libcwd/tests/Makefile.am Log message: Fixed 'make install' and 'make uninstall'. ---------------------- diff included ---------------------- Index: src/libcwd/include/libcw/Makefile.am diff -u src/libcwd/include/libcw/Makefile.am:1.25 src/libcwd/include/libcw/Makefile.am:1.26 --- src/libcwd/include/libcw/Makefile.am:1.25 Wed Feb 13 06:45:50 2002 +++ src/libcwd/include/libcw/Makefile.am Sun Feb 17 21:07:22 2002 @@ -63,3 +63,7 @@ $(mkinstalldirs) $(DESTDIR)$(libcwddir) $(INSTALL_DATA) $(EXTRA_HEADERS) $(DESTDIR)$(libcwddir) +uninstall-local: + cd $(DESTDIR)$(libcwddir); rm -f $(EXTRA_HEADERS) + rmdir $(DESTDIR)$(libcwddir) + Index: src/libcwd/tests/Makefile.am diff -u src/libcwd/tests/Makefile.am:1.20 src/libcwd/tests/Makefile.am:1.21 --- src/libcwd/tests/Makefile.am:1.20 Thu Jan 31 21:12:16 2002 +++ src/libcwd/tests/Makefile.am Sun Feb 17 21:07:22 2002 @@ -31,7 +31,7 @@ stabs_SOURCES = stabs.cc lines_SOURCES = lines.cc -include_HEADERS = sys.h debug.h sys.h syslog_debug.h threads_debug.h initbug_GlobalObject.h +noinst_HEADERS = sys.h debug.h sys.h syslog_debug.h threads_debug.h initbug_GlobalObject.h LDADD = ../libcwd.la full_top_builddir := $(shell (cd $(top_builddir); pwd)) ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2002-02-18 04:36:20
|
CVSROOT : /cvsroot/libcw Module : src Commit time: 2002-01-18 04:36:17 UTC Modified files: libcwd/documentation/tutorial/Makefile libcwd/documentation/tutorial/index.m4 libcwd/documentation/tutorial/tut7.in Added files: libcwd/documentation/tutorial/tut8.m4 Log message: Added tutorial on threading. ---------------------- diff included ---------------------- Index: src/libcwd/documentation/tutorial/Makefile diff -u src/libcwd/documentation/tutorial/Makefile:1.2 src/libcwd/documentation/tutorial/Makefile:1.3 --- src/libcwd/documentation/tutorial/Makefile:1.2 Sat Dec 29 20:17:49 2001 +++ src/libcwd/documentation/tutorial/Makefile Sun Feb 17 20:36:07 2002 @@ -9,7 +9,7 @@ all: examples html examples: $(SOURCES5) $(SOURCES7) -html: index.html faq.html intro.html tut1.html tut2.html tut3.html tut4.html tut5.html tut6.html tut7.html +html: index.html faq.html intro.html tut1.html tut2.html tut3.html tut4.html tut5.html tut6.html tut7.html tut8.html %.html: %.m4 ../definitions.m4 m4 -D__TUTORIAL=1 -I.. $< > $@ Index: src/libcwd/documentation/tutorial/index.m4 diff -u src/libcwd/documentation/tutorial/index.m4:1.2 src/libcwd/documentation/tutorial/index.m4:1.3 --- src/libcwd/documentation/tutorial/index.m4:1.2 Sat Dec 29 20:17:49 2001 +++ src/libcwd/documentation/tutorial/index.m4 Sun Feb 17 20:36:07 2002 @@ -9,7 +9,7 @@ </TD> <TD valign=center><DIV class="toc-header1"> <A class="toc1" href="../html/index.html" target="_top"> - Back to main index + back to main index </A></DIV> </TD> </TR> @@ -62,25 +62,26 @@ __TOC_START __PAGE(1, [[Introduction]], intro.html) __PAGE(2, [[Tutorial 1 : Hello World]], tut1.html) -__PAGE(3, [[Tutorial 2 : Creating your own Debug Channels]], tut2.html) -__PAGE(4, [[Tutorial 3 : Setting the <CODE>ostream</CODE>]], tut3.html) -__PAGE(5, [[Tutorial 4 : Management of <CODE>CWDEBUG</CODE>]], tut4.html) -__PAGE(6, [[Tutorial 5 : Advanced examples]], tut5.html) +__PAGE(3, [[Tutorial 2 : Creating Your Own Debug Channels]], tut2.html) +__PAGE(4, [[Tutorial 3 : Setting The <CODE>ostream</CODE>]], tut3.html) +__PAGE(5, [[Tutorial 4 : Management Of <CODE>CWDEBUG</CODE>]], tut4.html) +__PAGE(6, [[Tutorial 5 : Advanced Examples]], tut5.html) __PAGE_START -__PARAGRAPH(2f, 5.1, [[Running over all Debug Channels]], [[tut5.html#Running]]) -__PARAGRAPH(2, 5.2, [[Debug Channels and name spaces]], [[tut5.html#Debug]]) -__PARAGRAPH(2, 5.3, [[Combining channels]], [[tut5.html#Combining]]) -__PARAGRAPH(2, 5.4, [[Formatting debug output]], [[tut5.html#Formatting]]) -__PARAGRAPH(3, 5.4.1, [[Control flags]], [[tut5.html#Control]]) -__PARAGRAPH(3, 5.4.2, [[Methods of the debug object]], [[tut5.html#Methods]]) +__PARAGRAPH(2f, 5.1, [[Running Over All Debug Channels]], [[tut5.html#Running]]) +__PARAGRAPH(2, 5.2, [[Debug Channels And Name Spaces]], [[tut5.html#Debug]]) +__PARAGRAPH(2, 5.3, [[Combining Channels]], [[tut5.html#Combining]]) +__PARAGRAPH(2, 5.4, [[Formatting Debug Output]], [[tut5.html#Formatting]]) +__PARAGRAPH(3, 5.4.1, [[Control Flags]], [[tut5.html#Control]]) +__PARAGRAPH(3, 5.4.2, [[Methods Of The Debug Object]], [[tut5.html#Methods]]) __PAGE_END -__PAGE(7, [[Tutorial 6 : The debugging of dynamic memory allocations]], tut6.html) -__PAGE(8, [[Tutorial 7 : Advanced examples]], tut7.html) +__PAGE(7, [[Tutorial 6 : The Debugging Of Dynamic Memory Allocations]], tut6.html) +__PAGE(8, [[Tutorial 7 : Advanced Examples]], tut7.html) __PAGE_START -__PARAGRAPH(2f, 7.1, [[Removing allocations from the Allocated memory Overview]], [[tut7.html#Removing]]) -__PARAGRAPH(2, 7.2, [[Retrieving information about memory allocations]], [[tut7.html#Retrieving]]) -__PARAGRAPH(2, 7.3, [[Memory leak detection]], [[tut7.html#Memory]]) +__PARAGRAPH(2f, 7.1, [[Removing Allocations From The Allocated Memory Overview]], [[tut7.html#Removing]]) +__PARAGRAPH(2, 7.2, [[Retrieving Information About Memory Allocations]], [[tut7.html#Retrieving]]) +__PARAGRAPH(2, 7.3, [[Memory Leak Detection]], [[tut7.html#Memory]]) __PAGE_END +__PAGE(9, [[Tutorial 8 : Debugging Threaded Applications]], tut8.html) __TOC_END __PAGEEND __PAGEFOOTER Index: src/libcwd/documentation/tutorial/tut7.in diff -u src/libcwd/documentation/tutorial/tut7.in:1.2 src/libcwd/documentation/tutorial/tut7.in:1.3 --- src/libcwd/documentation/tutorial/tut7.in:1.2 Sat Dec 29 20:17:49 2001 +++ src/libcwd/documentation/tutorial/tut7.in Sun Feb 17 20:36:07 2002 @@ -495,14 +495,12 @@ <!-- START OUTPUT examples7/test7.3.5-bin --> </PRE> -<P>Congratulations, you are now a libcwd expert. If you still have any -questions that you can't find here, feel free to mail me.</P> - __PAGEEND -<P class="line"><IMG width=870 height=25 src="../images/lines/owl.png"></P> +<P class="line"><IMG width=870 height=19 src="../images/lines/hippo.png"></P> <DIV class="buttons"> <A HREF="tut6.html"><IMG width=64 height=32 src="../images/buttons/lr_prev.png" border="0"></A> <A HREF="index.html"><IMG width=64 height=32 src="../images/buttons/lr_index.png" border="0"></A> +<A HREF="tut8.html"><IMG width=64 height=32 src="../images/buttons/lr_next.png" border="0"></A> </DIV> __PAGEFOOTER __HTMLFOOTER Index: src/libcwd/documentation/tutorial/tut8.m4 diff -u /dev/null src/libcwd/documentation/tutorial/tut8.m4:1.1 --- /dev/null Sun Feb 17 20:36:17 2002 +++ src/libcwd/documentation/tutorial/tut8.m4 Sun Feb 17 20:36:07 2002 @@ -0,0 +1,121 @@ +include(definitions.m4)dnl +__HTMLHEADER +__PAGEHEADER +__PAGESTART + +<H2>Tutorial 8: Debugging Threaded Applications</H2> + +<P>Libcwd should be completely thread-safe, with the following restrictions:</P> +<UL> +<LI>All debug objects and debug channels <EM>must</EM> be global (as they should +be in non-threaded applications for that matter).</LI> +<LI>You are not allowed to create threads before all static and global objects +are initialized; in practise this means that you are not allowed to create threads +until <CODE>main()</CODE> is reached.</LI> +<LI>You cannot use <CODE>dlopen()</CODE> to load libcwd when threads have +already been created. Likewise you shouldn't <CODE>dlopen()</CODE> +other libraries that use libcwd when there are already running threads, +especially when those libraries define new debug objects and/or channels.</LI> +<LI>You need to provide one and only one locking mechanism per ostream device +that is also used to write debug output. It is preferable not to +use the same ostream with two or more different debug objects.</LI> +</UL> + +<P>Essentially the debug objects and channels react towards each thread as if +that thread is the only thread. The only (visible) shared variable is +the final <CODE>ostream</CODE> that a given debug object writes to. +This means that if one thread changes the <CODE>ostream</CODE> then all other +threads also suddenly start to write to that <CODE>ostream</CODE>. +Basically, it is simply not supported: don't change the output stream +on the fly.</P> + +<P>All other characteristics like the on/off state and the margin and +marker strings as well as the indentation are Thread Specific: Every +thread may change those without locking or worrying about the effect on +other threads.</P> + +<P>Every time a new thread is created, it will start with all debug objects +and channels turned off, just as at the start of <CODE>main()</CODE>.</P> + +<P>In all likelihood, you'd want to set the margin string such that it reflects which +thread is printing the output. For example:</P> + +<PRE> +void* thread_function(void* arguments) +{ + // Set Thread Specific on/off flags of the debug channels. + ForAllDebugChannels( if (!debugChannel.is_on()) debugChannel.on(); ); + // And for the debug object. + Debug( libcw_do.on() ); + // Set a margin. +#ifdef CWDEBUG + char margin[16]; + sprintf(margin, "%-10lu ", pthread_self()); +#endif + Debug( libcw_do.margin().assign(margin, 11) ); + + Dout(dc::notice, "Entering thread " << pthread_self()); + // ... do stuff + Dout(dc::notice, "Leaving thread " << pthread_self()); + return NULL; +} + +int main(void) +{ + // Don't output a single character at a time (yuk) + // (Read <A HREF ="http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#8">http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#8</A> for an explanation.) + std::ios::sync_with_stdio(false); + // 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() ); + // Set a margin. +#ifdef CWDEBUG + char margin[16]; + sprintf(margin, "%-10lu ", pthread_self()); +#endif + Debug( libcw_do.margin().assign(margin, 11) ); + // Turn all debug channels on. + ForAllDebugChannels( if (!debugChannel.is_on()) debugChannel.on(); ); + // List all channels. + Debug( list_channels_on(libcw_do) ); + + // Create and join a few threads... + int const number_of_threads = 4; + pthread_t thread_id[number_of_threads]; + for (int i = 0; i < number_of_threads; ++i) + { + Dout(dc::notice|continued_cf, "main: creating thread " << i << ", "); + pthread_create(&thread_id[i], NULL, thread_function, NULL); + Dout(dc::finish, "id " << thread_id[i] << '.'); + } + + for (int i = 0; i < number_of_threads; ++i) + { + void* status; + pthread_join(thread_id[i], &status); + Dout(dc::notice, "main loop: thread " << i << ", id " << thread_id[i] << + ", returned with status " << ((bool)status ? "OK" : "ERROR") << '.'); + } + + Dout(dc::notice, "Exiting from main()"); + return 0; +} +</PRE> + +<P>Congratulations, you are now a libcwd expert. If you still have any +questions that you can't find answers to here, feel free to mail me.</P> + +__PAGEEND +<P class="line"><IMG width=870 height=25 src="../images/lines/owl.png"></P> +<DIV class="buttons"> +<A HREF="tut7.html"><IMG width=64 height=32 src="../images/buttons/lr_prev.png" border="0"></A> +<A HREF="index.html"><IMG width=64 height=32 src="../images/buttons/lr_index.png" border="0"></A> +</DIV> +__PAGEFOOTER +__HTMLFOOTER ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2002-02-18 01:24:59
|
CVSROOT : /cvsroot/libcw Module : src Commit time: 2002-01-18 01:24:58 UTC Modified files: libcwd/bfd.cc libcwd/debug.cc libcwd/debugmalloc.cc libcwd/demangle.cc libcwd/demangle3.cc libcwd/elf32.cc libcwd/strerrno.cc libcwd/threading.cc libcwd/type_info.cc libcwd/documentation/definitions.m4 libcwd/include/cwd_debug.h libcwd/include/exec_prog.h libcwd/include/ios_base_Init.h libcwd/include/private_debug_stack.inl libcwd/include/raw_write.h libcwd/include/raw_write.inl libcwd/include/libcw/bfd.h libcwd/include/libcw/buf2str.h libcwd/include/libcw/char2str.h libcwd/include/libcw/class_alloc.h libcwd/include/libcw/class_channel.h libcwd/include/libcw/class_channel.inl libcwd/include/libcw/class_channel_set.h libcwd/include/libcw/class_channel_set.inl libcwd/include/libcw/class_continued_channel.h libcwd/include/libcw/class_continued_channel.inl libcwd/include/libcw/class_debug.inl libcwd/include/libcw/class_debug_string.h libcwd/include/libcw/class_debug_string.inl libcwd/include/libcw/class_fatal_channel.h libcwd/include/libcw/class_fatal_channel.inl libcwd/include/libcw/class_location.h libcwd/include/libcw/class_location.inl libcwd/include/libcw/class_marker.h libcwd/include/libcw/control_flag.h libcwd/include/libcw/core_dump.h libcwd/include/libcw/cwprint.h libcwd/include/libcw/debug.h libcwd/include/libcw/debug_config.ho.in libcwd/include/libcw/debugmalloc.h libcwd/include/libcw/demangle.h libcwd/include/libcw/enum_memblk_types.h libcwd/include/libcw/lockable_auto_ptr.h libcwd/include/libcw/macro_AllocTag.h libcwd/include/libcw/macro_ForAllDebugChannels.h libcwd/include/libcw/macro_ForAllDebugObjects.h libcwd/include/libcw/max_label_len.h libcwd/include/libcw/pc_mangled_function_name.h libcwd/include/libcw/private_allocator.h libcwd/include/libcw/private_assert.h libcwd/include/libcw/private_debug_stack.h libcwd/include/libcw/private_internal_string.h libcwd/include/libcw/private_internal_stringstream.h libcwd/include/libcw/private_internal_vector.h libcwd/include/libcw/private_set_alloc_checking.h libcwd/include/libcw/private_struct_TSD.h libcwd/include/libcw/strerrno.h libcwd/include/libcw/sysd.ho.in libcwd/include/libcw/type_info.h libcwd/tests/hello_world.cc libcwd/tests/syslog.cc libcwd/testsuite/libcwd.tst/alloctag.cc libcwd/testsuite/libcwd.tst/bfd.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/sys.h libcwd/testsuite/libcwd.tst/test_delete.cc libcwd/testsuite/libcwd.tst/type_info.cc libcwd/utils/buf2str.cc libcwd/utils/char2str.cc libcwd/utils/exec_prog.cc Log message: Bumped all copyright notices to the year 2002. ---------------------- diff included ---------------------- Index: src/libcwd/bfd.cc diff -u src/libcwd/bfd.cc:1.103 src/libcwd/bfd.cc:1.104 --- src/libcwd/bfd.cc:1.103 Thu Feb 14 21:19:31 2002 +++ src/libcwd/bfd.cc Sun Feb 17 17:24:46 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.103 2002/02/15 05:19:31 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.104 2002/02/18 01:24:46 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/debug.cc diff -u src/libcwd/debug.cc:1.72 src/libcwd/debug.cc:1.73 --- src/libcwd/debug.cc:1.72 Sun Feb 17 08:37:33 2002 +++ src/libcwd/debug.cc Sun Feb 17 17:24:46 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.72 2002/02/17 16:37:33 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.73 2002/02/18 01:24:46 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/debugmalloc.cc diff -u src/libcwd/debugmalloc.cc:1.83 src/libcwd/debugmalloc.cc:1.84 --- src/libcwd/debugmalloc.cc:1.83 Sat Feb 16 17:42:06 2002 +++ src/libcwd/debugmalloc.cc Sun Feb 17 17:24:46 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.83 2002/02/17 01:42:06 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.84 2002/02/18 01:24:46 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/demangle.cc diff -u src/libcwd/demangle.cc:1.24 src/libcwd/demangle.cc:1.25 --- src/libcwd/demangle.cc:1.24 Wed Jan 9 08:16:04 2002 +++ src/libcwd/demangle.cc Sun Feb 17 17:24:46 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/demangle.cc,v 1.24 2002/01/09 16:16:04 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/demangle.cc,v 1.25 2002/02/18 01:24:46 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/demangle3.cc diff -u src/libcwd/demangle3.cc:1.14 src/libcwd/demangle3.cc:1.15 --- src/libcwd/demangle3.cc:1.14 Thu Feb 7 20:03:46 2002 +++ src/libcwd/demangle3.cc Sun Feb 17 17:24:46 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/demangle3.cc,v 1.14 2002/02/08 04:03:46 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/demangle3.cc,v 1.15 2002/02/18 01:24:46 libcw Exp $ // -// Copyright (C) 2001, by +// Copyright (C) 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/documentation/definitions.m4 diff -u src/libcwd/documentation/definitions.m4:1.2 src/libcwd/documentation/definitions.m4:1.3 --- src/libcwd/documentation/definitions.m4:1.2 Sat Dec 29 20:17:47 2001 +++ src/libcwd/documentation/definitions.m4 Sun Feb 17 17:24:47 2002 @@ -32,7 +32,7 @@ The C++ Debugging Support Library </DIV> <DIV class="header-copyright"> - By Carlo Wood, ©1999 - 2001. + By Carlo Wood, ©1999 - 2002. </DIV> </TD> </TR> @@ -40,7 +40,7 @@ </TABLE>]])dnl dnl define(__PAGEFOOTER, [[ -<ADDRESS>Copyright © 2001 Carlo Wood. All rights reserved.</ADDRESS>]])dnl +<ADDRESS>Copyright © 2001, 2002 Carlo Wood. All rights reserved.</ADDRESS>]])dnl dnl define(__PAGESTART, [[ <DIV class="body">]])dnl Index: src/libcwd/elf32.cc diff -u src/libcwd/elf32.cc:1.38 src/libcwd/elf32.cc:1.39 --- src/libcwd/elf32.cc:1.38 Sun Feb 17 08:37:33 2002 +++ src/libcwd/elf32.cc Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/elf32.cc,v 1.38 2002/02/17 16:37:33 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/elf32.cc,v 1.39 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2001, by +// Copyright (C) 2001 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/cwd_debug.h diff -u src/libcwd/include/cwd_debug.h:1.8 src/libcwd/include/cwd_debug.h:1.9 --- src/libcwd/include/cwd_debug.h:1.8 Tue Feb 5 16:46:08 2002 +++ src/libcwd/include/cwd_debug.h Sun Feb 17 17:24:47 2002 @@ -1,7 +1,7 @@ // Generated automatically from sys.ho.in by configure. -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/cwd_debug.h,v 1.8 2002/02/06 00:46:08 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/cwd_debug.h,v 1.9 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2001, by +// Copyright (C) 2001 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/exec_prog.h diff -u src/libcwd/include/exec_prog.h:1.2 src/libcwd/include/exec_prog.h:1.3 --- src/libcwd/include/exec_prog.h:1.2 Sat Dec 29 20:17:49 2001 +++ src/libcwd/include/exec_prog.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/exec_prog.h,v 1.2 2001/12/30 04:17:49 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/exec_prog.h,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/ios_base_Init.h diff -u src/libcwd/include/ios_base_Init.h:1.2 src/libcwd/include/ios_base_Init.h:1.3 --- src/libcwd/include/ios_base_Init.h:1.2 Sat Dec 29 20:17:49 2001 +++ src/libcwd/include/ios_base_Init.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/ios_base_Init.h,v 1.2 2001/12/30 04:17:49 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/ios_base_Init.h,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/bfd.h diff -u src/libcwd/include/libcw/bfd.h:1.22 src/libcwd/include/libcw/bfd.h:1.23 --- src/libcwd/include/libcw/bfd.h:1.22 Sat Dec 29 20:17:49 2001 +++ src/libcwd/include/libcw/bfd.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/bfd.h,v 1.22 2001/12/30 04:17:49 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/bfd.h,v 1.23 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/buf2str.h diff -u src/libcwd/include/libcw/buf2str.h:1.6 src/libcwd/include/libcw/buf2str.h:1.7 --- src/libcwd/include/libcw/buf2str.h:1.6 Sat Dec 29 20:17:49 2001 +++ src/libcwd/include/libcw/buf2str.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/buf2str.h,v 1.6 2001/12/30 04:17:49 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/buf2str.h,v 1.7 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/char2str.h diff -u src/libcwd/include/libcw/char2str.h:1.6 src/libcwd/include/libcw/char2str.h:1.7 --- src/libcwd/include/libcw/char2str.h:1.6 Sat Dec 29 20:17:49 2001 +++ src/libcwd/include/libcw/char2str.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/char2str.h,v 1.6 2001/12/30 04:17:49 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/char2str.h,v 1.7 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/class_alloc.h diff -u src/libcwd/include/libcw/class_alloc.h:1.2 src/libcwd/include/libcw/class_alloc.h:1.3 --- src/libcwd/include/libcw/class_alloc.h:1.2 Sat Dec 29 20:17:49 2001 +++ src/libcwd/include/libcw/class_alloc.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_alloc.h,v 1.2 2001/12/30 04:17:49 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_alloc.h,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/class_channel.h diff -u src/libcwd/include/libcw/class_channel.h:1.5 src/libcwd/include/libcw/class_channel.h:1.6 --- src/libcwd/include/libcw/class_channel.h:1.5 Tue Jan 22 20:03:44 2002 +++ src/libcwd/include/libcw/class_channel.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_channel.h,v 1.5 2002/01/23 04:03:44 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_channel.h,v 1.6 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/class_channel.inl diff -u src/libcwd/include/libcw/class_channel.inl:1.3 src/libcwd/include/libcw/class_channel.inl:1.4 --- src/libcwd/include/libcw/class_channel.inl:1.3 Tue Jan 8 15:04:59 2002 +++ src/libcwd/include/libcw/class_channel.inl Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_channel.inl,v 1.3 2002/01/08 23:04:59 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_channel.inl,v 1.4 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/class_channel_set.h diff -u src/libcwd/include/libcw/class_channel_set.h:1.5 src/libcwd/include/libcw/class_channel_set.h:1.6 --- src/libcwd/include/libcw/class_channel_set.h:1.5 Tue Jan 22 20:03:44 2002 +++ src/libcwd/include/libcw/class_channel_set.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_channel_set.h,v 1.5 2002/01/23 04:03:44 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_channel_set.h,v 1.6 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/class_channel_set.inl diff -u src/libcwd/include/libcw/class_channel_set.inl:1.2 src/libcwd/include/libcw/class_channel_set.inl:1.3 --- src/libcwd/include/libcw/class_channel_set.inl:1.2 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/class_channel_set.inl Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_channel_set.inl,v 1.2 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_channel_set.inl,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/class_continued_channel.h diff -u src/libcwd/include/libcw/class_continued_channel.h:1.2 src/libcwd/include/libcw/class_continued_channel.h:1.3 --- src/libcwd/include/libcw/class_continued_channel.h:1.2 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/class_continued_channel.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_continued_channel.h,v 1.2 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_continued_channel.h,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/class_continued_channel.inl diff -u src/libcwd/include/libcw/class_continued_channel.inl:1.2 src/libcwd/include/libcw/class_continued_channel.inl:1.3 --- src/libcwd/include/libcw/class_continued_channel.inl:1.2 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/class_continued_channel.inl Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_continued_channel.inl,v 1.2 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_continued_channel.inl,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/class_debug.inl diff -u src/libcwd/include/libcw/class_debug.inl:1.8 src/libcwd/include/libcw/class_debug.inl:1.9 --- src/libcwd/include/libcw/class_debug.inl:1.8 Tue Feb 12 19:55:26 2002 +++ src/libcwd/include/libcw/class_debug.inl Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_debug.inl,v 1.8 2002/02/13 03:55:26 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_debug.inl,v 1.9 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/class_debug_string.h diff -u src/libcwd/include/libcw/class_debug_string.h:1.4 src/libcwd/include/libcw/class_debug_string.h:1.5 --- src/libcwd/include/libcw/class_debug_string.h:1.4 Sun Jan 20 08:25:11 2002 +++ src/libcwd/include/libcw/class_debug_string.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_debug_string.h,v 1.4 2002/01/20 16:25:11 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_debug_string.h,v 1.5 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/class_debug_string.inl diff -u src/libcwd/include/libcw/class_debug_string.inl:1.2 src/libcwd/include/libcw/class_debug_string.inl:1.3 --- src/libcwd/include/libcw/class_debug_string.inl:1.2 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/class_debug_string.inl Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_debug_string.inl,v 1.2 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_debug_string.inl,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/class_fatal_channel.h diff -u src/libcwd/include/libcw/class_fatal_channel.h:1.2 src/libcwd/include/libcw/class_fatal_channel.h:1.3 --- src/libcwd/include/libcw/class_fatal_channel.h:1.2 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/class_fatal_channel.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_fatal_channel.h,v 1.2 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_fatal_channel.h,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/class_fatal_channel.inl diff -u src/libcwd/include/libcw/class_fatal_channel.inl:1.2 src/libcwd/include/libcw/class_fatal_channel.inl:1.3 --- src/libcwd/include/libcw/class_fatal_channel.inl:1.2 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/class_fatal_channel.inl Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_fatal_channel.inl,v 1.2 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_fatal_channel.inl,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/class_location.h diff -u src/libcwd/include/libcw/class_location.h:1.4 src/libcwd/include/libcw/class_location.h:1.5 --- src/libcwd/include/libcw/class_location.h:1.4 Tue Jan 22 20:03:44 2002 +++ src/libcwd/include/libcw/class_location.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_location.h,v 1.4 2002/01/23 04:03:44 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_location.h,v 1.5 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/class_location.inl diff -u src/libcwd/include/libcw/class_location.inl:1.3 src/libcwd/include/libcw/class_location.inl:1.4 --- src/libcwd/include/libcw/class_location.inl:1.3 Tue Jan 8 15:04:59 2002 +++ src/libcwd/include/libcw/class_location.inl Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_location.inl,v 1.3 2002/01/08 23:04:59 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_location.inl,v 1.4 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/class_marker.h diff -u src/libcwd/include/libcw/class_marker.h:1.2 src/libcwd/include/libcw/class_marker.h:1.3 --- src/libcwd/include/libcw/class_marker.h:1.2 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/class_marker.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_marker.h,v 1.2 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_marker.h,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/control_flag.h diff -u src/libcwd/include/libcw/control_flag.h:1.2 src/libcwd/include/libcw/control_flag.h:1.3 --- src/libcwd/include/libcw/control_flag.h:1.2 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/control_flag.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/control_flag.h,v 1.2 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/control_flag.h,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/core_dump.h diff -u src/libcwd/include/libcw/core_dump.h:1.2 src/libcwd/include/libcw/core_dump.h:1.3 --- src/libcwd/include/libcw/core_dump.h:1.2 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/core_dump.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/core_dump.h,v 1.2 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/core_dump.h,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/cwprint.h diff -u src/libcwd/include/libcw/cwprint.h:1.6 src/libcwd/include/libcw/cwprint.h:1.7 --- src/libcwd/include/libcw/cwprint.h:1.6 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/cwprint.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/cwprint.h,v 1.6 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/cwprint.h,v 1.7 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/debug.h diff -u src/libcwd/include/libcw/debug.h:1.42 src/libcwd/include/libcw/debug.h:1.43 --- src/libcwd/include/libcw/debug.h:1.42 Mon Feb 11 21:40:32 2002 +++ src/libcwd/include/libcw/debug.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debug.h,v 1.42 2002/02/12 05:40:32 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debug.h,v 1.43 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/debug_config.ho.in diff -u src/libcwd/include/libcw/debug_config.ho.in:1.19 src/libcwd/include/libcw/debug_config.ho.in:1.20 --- src/libcwd/include/libcw/debug_config.ho.in:1.19 Fri Feb 8 19:22:59 2002 +++ src/libcwd/include/libcw/debug_config.ho.in Sun Feb 17 17:24:47 2002 @@ -1,7 +1,7 @@ // @configure_input@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debug_config.ho.in,v 1.19 2002/02/09 03:22:59 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debug_config.ho.in,v 1.20 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/debugmalloc.h diff -u src/libcwd/include/libcw/debugmalloc.h:1.29 src/libcwd/include/libcw/debugmalloc.h:1.30 --- src/libcwd/include/libcw/debugmalloc.h:1.29 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/debugmalloc.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debugmalloc.h,v 1.29 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debugmalloc.h,v 1.30 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/demangle.h diff -u src/libcwd/include/libcw/demangle.h:1.6 src/libcwd/include/libcw/demangle.h:1.7 --- src/libcwd/include/libcw/demangle.h:1.6 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/demangle.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/demangle.h,v 1.6 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/demangle.h,v 1.7 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/enum_memblk_types.h diff -u src/libcwd/include/libcw/enum_memblk_types.h:1.2 src/libcwd/include/libcw/enum_memblk_types.h:1.3 --- src/libcwd/include/libcw/enum_memblk_types.h:1.2 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/enum_memblk_types.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/enum_memblk_types.h,v 1.2 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/enum_memblk_types.h,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/lockable_auto_ptr.h diff -u src/libcwd/include/libcw/lockable_auto_ptr.h:1.9 src/libcwd/include/libcw/lockable_auto_ptr.h:1.10 --- src/libcwd/include/libcw/lockable_auto_ptr.h:1.9 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/lockable_auto_ptr.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/lockable_auto_ptr.h,v 1.9 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/lockable_auto_ptr.h,v 1.10 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/macro_AllocTag.h diff -u src/libcwd/include/libcw/macro_AllocTag.h:1.7 src/libcwd/include/libcw/macro_AllocTag.h:1.8 --- src/libcwd/include/libcw/macro_AllocTag.h:1.7 Sun Feb 10 19:00:24 2002 +++ src/libcwd/include/libcw/macro_AllocTag.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/macro_AllocTag.h,v 1.7 2002/02/11 03:00:24 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/macro_AllocTag.h,v 1.8 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/macro_ForAllDebugChannels.h diff -u src/libcwd/include/libcw/macro_ForAllDebugChannels.h:1.5 src/libcwd/include/libcw/macro_ForAllDebugChannels.h:1.6 --- src/libcwd/include/libcw/macro_ForAllDebugChannels.h:1.5 Sat Feb 2 20:15:11 2002 +++ src/libcwd/include/libcw/macro_ForAllDebugChannels.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/macro_ForAllDebugChannels.h,v 1.5 2002/02/03 04:15:11 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/macro_ForAllDebugChannels.h,v 1.6 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/macro_ForAllDebugObjects.h diff -u src/libcwd/include/libcw/macro_ForAllDebugObjects.h:1.6 src/libcwd/include/libcw/macro_ForAllDebugObjects.h:1.7 --- src/libcwd/include/libcw/macro_ForAllDebugObjects.h:1.6 Mon Feb 11 21:40:32 2002 +++ src/libcwd/include/libcw/macro_ForAllDebugObjects.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/macro_ForAllDebugObjects.h,v 1.6 2002/02/12 05:40:32 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/macro_ForAllDebugObjects.h,v 1.7 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/max_label_len.h diff -u src/libcwd/include/libcw/max_label_len.h:1.2 src/libcwd/include/libcw/max_label_len.h:1.3 --- src/libcwd/include/libcw/max_label_len.h:1.2 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/max_label_len.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/max_label_len.h,v 1.2 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/max_label_len.h,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/pc_mangled_function_name.h diff -u src/libcwd/include/libcw/pc_mangled_function_name.h:1.2 src/libcwd/include/libcw/pc_mangled_function_name.h:1.3 --- src/libcwd/include/libcw/pc_mangled_function_name.h:1.2 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/pc_mangled_function_name.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/pc_mangled_function_name.h,v 1.2 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/pc_mangled_function_name.h,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/private_allocator.h diff -u src/libcwd/include/libcw/private_allocator.h:1.4 src/libcwd/include/libcw/private_allocator.h:1.5 --- src/libcwd/include/libcw/private_allocator.h:1.4 Wed Jan 9 17:28:46 2002 +++ src/libcwd/include/libcw/private_allocator.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_allocator.h,v 1.4 2002/01/10 01:28:46 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_allocator.h,v 1.5 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2001, by +// Copyright (C) 2001 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/private_assert.h diff -u src/libcwd/include/libcw/private_assert.h:1.2 src/libcwd/include/libcw/private_assert.h:1.3 --- src/libcwd/include/libcw/private_assert.h:1.2 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/private_assert.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_assert.h,v 1.2 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_assert.h,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/private_debug_stack.h diff -u src/libcwd/include/libcw/private_debug_stack.h:1.2 src/libcwd/include/libcw/private_debug_stack.h:1.3 --- src/libcwd/include/libcw/private_debug_stack.h:1.2 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/private_debug_stack.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_debug_stack.h,v 1.2 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_debug_stack.h,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/private_internal_string.h diff -u src/libcwd/include/libcw/private_internal_string.h:1.2 src/libcwd/include/libcw/private_internal_string.h:1.3 --- src/libcwd/include/libcw/private_internal_string.h:1.2 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/private_internal_string.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_internal_string.h,v 1.2 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_internal_string.h,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2001, by +// Copyright (C) 2001 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/private_internal_stringstream.h diff -u src/libcwd/include/libcw/private_internal_stringstream.h:1.2 src/libcwd/include/libcw/private_internal_stringstream.h:1.3 --- src/libcwd/include/libcw/private_internal_stringstream.h:1.2 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/private_internal_stringstream.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_internal_stringstream.h,v 1.2 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_internal_stringstream.h,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2001, by +// Copyright (C) 2001 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/private_internal_vector.h diff -u src/libcwd/include/libcw/private_internal_vector.h:1.2 src/libcwd/include/libcw/private_internal_vector.h:1.3 --- src/libcwd/include/libcw/private_internal_vector.h:1.2 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/private_internal_vector.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_internal_vector.h,v 1.2 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_internal_vector.h,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2001, by +// Copyright (C) 2001 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/private_set_alloc_checking.h diff -u src/libcwd/include/libcw/private_set_alloc_checking.h:1.3 src/libcwd/include/libcw/private_set_alloc_checking.h:1.4 --- src/libcwd/include/libcw/private_set_alloc_checking.h:1.3 Tue Jan 22 20:03:45 2002 +++ src/libcwd/include/libcw/private_set_alloc_checking.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_set_alloc_checking.h,v 1.3 2002/01/23 04:03:45 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_set_alloc_checking.h,v 1.4 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/private_struct_TSD.h diff -u src/libcwd/include/libcw/private_struct_TSD.h:1.8 src/libcwd/include/libcw/private_struct_TSD.h:1.9 --- src/libcwd/include/libcw/private_struct_TSD.h:1.8 Sat Feb 16 17:42:07 2002 +++ src/libcwd/include/libcw/private_struct_TSD.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_struct_TSD.h,v 1.8 2002/02/17 01:42:07 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_struct_TSD.h,v 1.9 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2001, by +// Copyright (C) 2001 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/strerrno.h diff -u src/libcwd/include/libcw/strerrno.h:1.5 src/libcwd/include/libcw/strerrno.h:1.6 --- src/libcwd/include/libcw/strerrno.h:1.5 Sat Dec 29 20:17:50 2001 +++ src/libcwd/include/libcw/strerrno.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/strerrno.h,v 1.5 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/strerrno.h,v 1.6 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/sysd.ho.in diff -u src/libcwd/include/libcw/sysd.ho.in:1.6 src/libcwd/include/libcw/sysd.ho.in:1.7 --- src/libcwd/include/libcw/sysd.ho.in:1.6 Thu Feb 7 20:03:47 2002 +++ src/libcwd/include/libcw/sysd.ho.in Sun Feb 17 17:24:47 2002 @@ -1,7 +1,7 @@ // @configure_input@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/sysd.ho.in,v 1.6 2002/02/08 04:03:47 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/sysd.ho.in,v 1.7 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/libcw/type_info.h diff -u src/libcwd/include/libcw/type_info.h:1.19 src/libcwd/include/libcw/type_info.h:1.20 --- src/libcwd/include/libcw/type_info.h:1.19 Thu Feb 7 20:03:47 2002 +++ src/libcwd/include/libcw/type_info.h Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/type_info.h,v 1.19 2002/02/08 04:03:47 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/type_info.h,v 1.20 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/private_debug_stack.inl diff -u src/libcwd/include/private_debug_stack.inl:1.2 src/libcwd/include/private_debug_stack.inl:1.3 --- src/libcwd/include/private_debug_stack.inl:1.2 Sat Dec 29 20:17:49 2001 +++ src/libcwd/include/private_debug_stack.inl Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/private_debug_stack.inl,v 1.2 2001/12/30 04:17:49 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/private_debug_stack.inl,v 1.3 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/raw_write.h diff -u src/libcwd/include/raw_write.h:1.3 src/libcwd/include/raw_write.h:1.4 --- src/libcwd/include/raw_write.h:1.3 Sat Feb 2 20:15:11 2002 +++ src/libcwd/include/raw_write.h Sun Feb 17 17:24:47 2002 @@ -1,7 +1,7 @@ // Generated automatically from sys.ho.in by configure. -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/raw_write.h,v 1.3 2002/02/03 04:15:11 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/raw_write.h,v 1.4 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2001, by +// Copyright (C) 2001 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/include/raw_write.inl diff -u src/libcwd/include/raw_write.inl:1.1 src/libcwd/include/raw_write.inl:1.2 --- src/libcwd/include/raw_write.inl:1.1 Tue Jan 22 20:03:44 2002 +++ src/libcwd/include/raw_write.inl Sun Feb 17 17:24:47 2002 @@ -1,7 +1,7 @@ // Generated automatically from sys.ho.in by configure. -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/raw_write.inl,v 1.1 2002/01/23 04:03:44 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/raw_write.inl,v 1.2 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2001, by +// Copyright (C) 2001 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/strerrno.cc diff -u src/libcwd/strerrno.cc:1.7 src/libcwd/strerrno.cc:1.8 --- src/libcwd/strerrno.cc:1.7 Sat Dec 29 20:17:47 2001 +++ src/libcwd/strerrno.cc Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/strerrno.cc,v 1.7 2001/12/30 04:17:47 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/strerrno.cc,v 1.8 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/tests/hello_world.cc diff -u src/libcwd/tests/hello_world.cc:1.17 src/libcwd/tests/hello_world.cc:1.18 --- src/libcwd/tests/hello_world.cc:1.17 Sat Dec 29 20:17:50 2001 +++ src/libcwd/tests/hello_world.cc Sun Feb 17 17:24:48 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/tests/hello_world.cc,v 1.17 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/tests/hello_world.cc,v 1.18 2002/02/18 01:24:48 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/tests/syslog.cc diff -u src/libcwd/tests/syslog.cc:1.8 src/libcwd/tests/syslog.cc:1.9 --- src/libcwd/tests/syslog.cc:1.8 Sat Dec 29 20:17:50 2001 +++ src/libcwd/tests/syslog.cc Sun Feb 17 17:24:48 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/tests/syslog.cc,v 1.8 2001/12/30 04:17:50 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/tests/syslog.cc,v 1.9 2002/02/18 01:24:48 libcw Exp $ // -// Copyright (C) 2000, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/testsuite/libcwd.tst/alloctag.cc diff -u src/libcwd/testsuite/libcwd.tst/alloctag.cc:1.18 src/libcwd/testsuite/libcwd.tst/alloctag.cc:1.19 --- src/libcwd/testsuite/libcwd.tst/alloctag.cc:1.18 Tue Feb 12 19:55:26 2002 +++ src/libcwd/testsuite/libcwd.tst/alloctag.cc Sun Feb 17 17:24:48 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/alloctag.cc,v 1.18 2002/02/13 03:55:26 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/alloctag.cc,v 1.19 2002/02/18 01:24:48 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/testsuite/libcwd.tst/bfd.cc diff -u src/libcwd/testsuite/libcwd.tst/bfd.cc:1.25 src/libcwd/testsuite/libcwd.tst/bfd.cc:1.26 --- src/libcwd/testsuite/libcwd.tst/bfd.cc:1.25 Tue Feb 12 19:55:26 2002 +++ src/libcwd/testsuite/libcwd.tst/bfd.cc Sun Feb 17 17:24:48 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/bfd.cc,v 1.25 2002/02/13 03:55:26 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/bfd.cc,v 1.26 2002/02/18 01:24:48 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/testsuite/libcwd.tst/leak.cc diff -u src/libcwd/testsuite/libcwd.tst/leak.cc:1.17 src/libcwd/testsuite/libcwd.tst/leak.cc:1.18 --- src/libcwd/testsuite/libcwd.tst/leak.cc:1.17 Tue Feb 12 19:55:26 2002 +++ src/libcwd/testsuite/libcwd.tst/leak.cc Sun Feb 17 17:24:48 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/leak.cc,v 1.17 2002/02/13 03:55:26 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/leak.cc,v 1.18 2002/02/18 01:24:48 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/testsuite/libcwd.tst/lockable_auto_ptr.cc diff -u src/libcwd/testsuite/libcwd.tst/lockable_auto_ptr.cc:1.10 src/libcwd/testsuite/libcwd.tst/lockable_auto_ptr.cc:1.11 --- src/libcwd/testsuite/libcwd.tst/lockable_auto_ptr.cc:1.10 Sat Dec 29 20:17:51 2001 +++ src/libcwd/testsuite/libcwd.tst/lockable_auto_ptr.cc Sun Feb 17 17:24:48 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/lockable_auto_ptr.cc,v 1.10 2001/12/30 04:17:51 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/lockable_auto_ptr.cc,v 1.11 2002/02/18 01:24:48 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/testsuite/libcwd.tst/magic.cc diff -u src/libcwd/testsuite/libcwd.tst/magic.cc:1.11 src/libcwd/testsuite/libcwd.tst/magic.cc:1.12 --- src/libcwd/testsuite/libcwd.tst/magic.cc:1.11 Sat Dec 29 20:17:51 2001 +++ src/libcwd/testsuite/libcwd.tst/magic.cc Sun Feb 17 17:24:48 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/magic.cc,v 1.11 2001/12/30 04:17:51 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/magic.cc,v 1.12 2002/02/18 01:24:48 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/testsuite/libcwd.tst/marker.cc diff -u src/libcwd/testsuite/libcwd.tst/marker.cc:1.16 src/libcwd/testsuite/libcwd.tst/marker.cc:1.17 --- src/libcwd/testsuite/libcwd.tst/marker.cc:1.16 Tue Feb 12 19:55:26 2002 +++ src/libcwd/testsuite/libcwd.tst/marker.cc Sun Feb 17 17:24:48 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/marker.cc,v 1.16 2002/02/13 03:55:26 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/marker.cc,v 1.17 2002/02/18 01:24:48 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/testsuite/libcwd.tst/sys.h diff -u src/libcwd/testsuite/libcwd.tst/sys.h:1.6 src/libcwd/testsuite/libcwd.tst/sys.h:1.7 --- src/libcwd/testsuite/libcwd.tst/sys.h:1.6 Sun Feb 17 08:37:33 2002 +++ src/libcwd/testsuite/libcwd.tst/sys.h Sun Feb 17 17:24:48 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/sys.h,v 1.6 2002/02/17 16:37:33 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/sys.h,v 1.7 2002/02/18 01:24:48 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/testsuite/libcwd.tst/test_delete.cc diff -u src/libcwd/testsuite/libcwd.tst/test_delete.cc:1.12 src/libcwd/testsuite/libcwd.tst/test_delete.cc:1.13 --- src/libcwd/testsuite/libcwd.tst/test_delete.cc:1.12 Tue Feb 12 19:55:26 2002 +++ src/libcwd/testsuite/libcwd.tst/test_delete.cc Sun Feb 17 17:24:48 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/test_delete.cc,v 1.12 2002/02/13 03:55:26 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/test_delete.cc,v 1.13 2002/02/18 01:24:48 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/testsuite/libcwd.tst/type_info.cc diff -u src/libcwd/testsuite/libcwd.tst/type_info.cc:1.12 src/libcwd/testsuite/libcwd.tst/type_info.cc:1.13 --- src/libcwd/testsuite/libcwd.tst/type_info.cc:1.12 Sat Dec 29 20:17:51 2001 +++ src/libcwd/testsuite/libcwd.tst/type_info.cc Sun Feb 17 17:24:48 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/type_info.cc,v 1.12 2001/12/30 04:17:51 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/type_info.cc,v 1.13 2002/02/18 01:24:48 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/threading.cc diff -u src/libcwd/threading.cc:1.11 src/libcwd/threading.cc:1.12 --- src/libcwd/threading.cc:1.11 Tue Feb 12 19:55:26 2002 +++ src/libcwd/threading.cc Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/threading.cc,v 1.11 2002/02/13 03:55:26 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/threading.cc,v 1.12 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2001, by +// Copyright (C) 2001 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/type_info.cc diff -u src/libcwd/type_info.cc:1.14 src/libcwd/type_info.cc:1.15 --- src/libcwd/type_info.cc:1.14 Sat Dec 29 20:17:47 2001 +++ src/libcwd/type_info.cc Sun Feb 17 17:24:47 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/type_info.cc,v 1.14 2001/12/30 04:17:47 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/type_info.cc,v 1.15 2002/02/18 01:24:47 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/utils/buf2str.cc diff -u src/libcwd/utils/buf2str.cc:1.6 src/libcwd/utils/buf2str.cc:1.7 --- src/libcwd/utils/buf2str.cc:1.6 Sat Dec 29 20:17:51 2001 +++ src/libcwd/utils/buf2str.cc Sun Feb 17 17:24:48 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/utils/buf2str.cc,v 1.6 2001/12/30 04:17:51 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/utils/buf2str.cc,v 1.7 2002/02/18 01:24:48 libcw Exp $ // -// Copyright (C) 2000, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/utils/char2str.cc diff -u src/libcwd/utils/char2str.cc:1.8 src/libcwd/utils/char2str.cc:1.9 --- src/libcwd/utils/char2str.cc:1.8 Sat Dec 29 20:17:51 2001 +++ src/libcwd/utils/char2str.cc Sun Feb 17 17:24:48 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/utils/char2str.cc,v 1.8 2001/12/30 04:17:51 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/utils/char2str.cc,v 1.9 2002/02/18 01:24:48 libcw Exp $ // -// Copyright (C) 2000, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt Index: src/libcwd/utils/exec_prog.cc diff -u src/libcwd/utils/exec_prog.cc:1.23 src/libcwd/utils/exec_prog.cc:1.24 --- src/libcwd/utils/exec_prog.cc:1.23 Sun Jan 20 08:25:11 2002 +++ src/libcwd/utils/exec_prog.cc Sun Feb 17 17:24:48 2002 @@ -1,6 +1,6 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/utils/exec_prog.cc,v 1.23 2002/01/20 16:25:11 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/utils/exec_prog.cc,v 1.24 2002/02/18 01:24:48 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2002-02-18 00:46:25
|
CVSROOT : /cvsroot/libcw Module : src Commit time: 2002-01-18 00:46:24 UTC Modified files: libcwd/acconfig.h Log message: Perfectionism. ---------------------- diff included ---------------------- Index: src/libcwd/acconfig.h diff -u src/libcwd/acconfig.h:1.13 src/libcwd/acconfig.h:1.14 --- src/libcwd/acconfig.h:1.13 Sun Feb 17 08:37:32 2002 +++ src/libcwd/acconfig.h Sun Feb 17 16:46:14 2002 @@ -22,7 +22,7 @@ // Defined when both -lpthread and pthread.h could be found. #undef LIBCWD_HAVE_PTHREAD -#if __GNUC__ < 3 +#ifndef _GNU_SOURCE // Might already be defined: g++ 3.x is currently defining this as a hack to get libstdc++ headers work properly. // This is needed when using threading, for example to get `pthread_kill_other_threads_np'. #undef _GNU_SOURCE #endif ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2002-02-18 00:44:17
|
CVSROOT : /cvsroot/libcw Module : src Commit time: 2002-01-18 00:44:16 UTC Modified files: libcwd/documentation/styles/main.css libcwd/documentation/tutorial/channel.cc libcwd/documentation/tutorial/faq.m4 libcwd/documentation/tutorial/log_file.cc libcwd/documentation/tutorial/tut1.m4 libcwd/documentation/tutorial/tut2.m4 libcwd/documentation/tutorial/tut3.m4 libcwd/documentation/tutorial/tut4.m4 libcwd/documentation/tutorial/tut5.in libcwd/documentation/tutorial/tut6.m4 Log message: Misc tutorial fixes after rereading it. ---------------------- diff included ---------------------- Index: src/libcwd/documentation/styles/main.css diff -u src/libcwd/documentation/styles/main.css:1.4 src/libcwd/documentation/styles/main.css:1.5 --- src/libcwd/documentation/styles/main.css:1.4 Sun Feb 17 07:00:49 2002 +++ src/libcwd/documentation/styles/main.css Sun Feb 17 16:44:05 2002 @@ -212,7 +212,7 @@ } .shell-command { - font-family : ludica; + font-family : fixed, monospace; font-size : NORMAL_SIZE; } Index: src/libcwd/documentation/tutorial/channel.cc diff -u src/libcwd/documentation/tutorial/channel.cc:1.4 src/libcwd/documentation/tutorial/channel.cc:1.5 --- src/libcwd/documentation/tutorial/channel.cc:1.4 Sun Feb 17 07:30:15 2002 +++ src/libcwd/documentation/tutorial/channel.cc Sun Feb 17 16:44:06 2002 @@ -13,12 +13,13 @@ #define DEBUGCHANNELS ::example // Where we'll put our namespace dc // "debug.h": #include <libcw/debug.h> +//------------------------------------------------------------------------------- + namespace example { // namespace dc cannot be put in :: namespace dc { libcw::debug::channel_ct ghost("GHOST"); // Create our own Debug Channel } } -//------------------------------------------------------------------------------- int main(void) { @@ -26,7 +27,7 @@ Debug( libcw_do.on() ); // the debug Channel and Object on! for (int i = 0; i < 4; ++i) - Dout( dc::ghost, "i = " << i ); // We can write more than just + Dout(dc::ghost, "i = " << i); // We can write more than just // "Hello World" to the ostream :) return 0; } Index: src/libcwd/documentation/tutorial/faq.m4 diff -u src/libcwd/documentation/tutorial/faq.m4:1.7 src/libcwd/documentation/tutorial/faq.m4:1.8 --- src/libcwd/documentation/tutorial/faq.m4:1.7 Sun Feb 17 08:37:33 2002 +++ src/libcwd/documentation/tutorial/faq.m4 Sun Feb 17 16:44:06 2002 @@ -24,11 +24,10 @@ what could possibly be wrong with your code. Once the application works, you don't have to define _GNU_SOURCE because you won't be including the debug code anymore, nor link with -libcwd. If you need to write 100% ANSI code and you are not sure -whether or not new code that you added is an extension or not, you -should try to compile it with CWDEBUG undefined <EM>and</EM> using -ansi as -command line option to g++; without -ansi g++-3.0 and higher defines -_GNU_SOURCE itself by default.</P> +libcwd. +Note that GNU g++ 3.x already defines this macro currently itself as a hack +to get the libstdc++ headers work properly, hence the test with <CODE>#ifndef</CODE> +is always needed (see <A HREF="http://gcc.gnu.org/ml/gcc/2002-02/msg00996.html">http://gcc.gnu.org/ml/gcc/2002-02/msg00996.html</A>).</P> <A name="sysd.h"></A> <H3>2. Why do I have to include "libcw/sysd.h" as first header file?</H3> @@ -82,7 +81,7 @@ <H3>5. What is defined <EM>exactly</EM> in <SPAN class="H3code">libcw/debug.h</SPAN>?</H3> <P>Everything. -Go and read the <A HREF="../html/reference.html>Reference Manual</A> to get <EM>all</EM> gory details if you dare.</P> +Go and read the <A HREF="../html/reference.html">Reference Manual</A> to get <EM>all</EM> gory details if you dare.</P> <A name="macros"></A> <H3>6. Why are you using macros for <SPAN class="H3code">Debug</SPAN> and <SPAN class="H3code">Dout</SPAN>?</H3> Index: src/libcwd/documentation/tutorial/log_file.cc diff -u src/libcwd/documentation/tutorial/log_file.cc:1.5 src/libcwd/documentation/tutorial/log_file.cc:1.6 --- src/libcwd/documentation/tutorial/log_file.cc:1.5 Sun Feb 17 08:37:33 2002 +++ src/libcwd/documentation/tutorial/log_file.cc Sun Feb 17 16:44:06 2002 @@ -9,6 +9,7 @@ // "debug.h" #include <libcw/debug.h> //------------------------------------------------------------------------------- + #include <fstream> int main(void) @@ -24,7 +25,7 @@ // Set the ostream related with libcw_do to `file': Debug( libcw_do.set_ostream(&file) ); - Dout( dc::notice, "Hippopotamus are heavy" ); + Dout(dc::notice, "Hippopotamus are heavy"); return 0; } Index: src/libcwd/documentation/tutorial/tut1.m4 diff -u src/libcwd/documentation/tutorial/tut1.m4:1.8 src/libcwd/documentation/tutorial/tut1.m4:1.9 --- src/libcwd/documentation/tutorial/tut1.m4:1.8 Sun Feb 17 08:37:33 2002 +++ src/libcwd/documentation/tutorial/tut1.m4 Sun Feb 17 16:44:06 2002 @@ -26,7 +26,7 @@ Debug( dc::notice.on() ); // Turn on the NOTICE Debug Channel. Debug( libcw_do.on() ); // Turn on the default Debug Object. - Dout( dc::notice, "Hello World" ); + Dout(dc::notice, "Hello World"); return 0; } @@ -44,10 +44,7 @@ Note that you only really have to define it when you compiled libcwd with threading support. If you do not define this macro and libcwd needs it, then you will get -a compile error in <libcw/sysd.h> telling you so. -GNU gcc 3.0 (and higher) already defines this macro by itself, so there is -no need to include it if you intend to only compile your application with -this version.</P> +a compile error in <libcw/sysd.h> telling you so.</P> <DIV class="faq-frame"><H4>FAQ</H4><UL class="faq"> <LI><A HREF="faq.html#GNU_SOURCE">Won't this define make my code non-portable?</A></LI> @@ -81,8 +78,8 @@ <A NAME="turn_on_channel"></A> <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 +<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 nothing: all <I>Debug Channels</I> are <EM>off</EM> by default, at start up.</P> <DIV class="faq-frame"><H4>FAQ</H4><UL class="faq"> @@ -95,7 +92,7 @@ <H3><CODE>Debug( libcw_do.on() );</CODE></H3> <P>This turns on the <I><U>D</U>ebug <U>O</U>bject</I> <CODE>libcw_<U>do</U></CODE>. -Without this line, the code <CODE>Dout( dc::notice, "Hello World" )</CODE> would output +Without this line, the code <CODE>Dout(dc::notice, "Hello World")</CODE> would output nothing: all <I>Debug Objects</I> are <EM>off</EM> by default, at start up.</P> <P>A <I>Debug Object</I> is related to exactly one <CODE>ostream</CODE>. @@ -114,7 +111,7 @@ <LI><A HREF="faq.html#Object">Why do you call it a Debug <EM>Object</EM>? What <EM>is</EM> a Debug Object?</A></LI> </UL></DIV> -<H3><CODE>Dout( dc::notice, "Hello World" );</CODE></H3> +<H3><CODE>Dout(dc::notice, "Hello World");</CODE></H3> <P>This outputs "Hello World" to the <CODE>ostream</CODE> currently related to <CODE>libcw_do</CODE> provided that the <I>Debug Channel</I> Index: src/libcwd/documentation/tutorial/tut2.m4 diff -u src/libcwd/documentation/tutorial/tut2.m4:1.6 src/libcwd/documentation/tutorial/tut2.m4:1.7 --- src/libcwd/documentation/tutorial/tut2.m4:1.6 Sun Feb 17 08:37:33 2002 +++ src/libcwd/documentation/tutorial/tut2.m4 Sun Feb 17 16:44:06 2002 @@ -9,8 +9,6 @@ In the example below we create a debug channel <CODE>dc::ghost</CODE> that will use the string "<SPAN class="output">GHOST</SPAN>" as label.</P> -<P class="download">[<A HREF="channel.cc">download</A>]</P> - <P>Create a file <CODE>"sys.h"</CODE> that is part of your application and put in it:</P> <PRE> #ifdef HAVE_CONFIG_H // This is just an example of what you could do @@ -75,6 +73,7 @@ #endif // DEBUG_H </PRE> <P>Finally write the program:</P> +<P class="download">[<A HREF="channel.cc">download</A>]</P> <PRE> #include "sys.h" #include "debug.h" @@ -92,8 +91,8 @@ Debug( libcw_do.on() ); // the debug Channel and Object on! for (int i = 0; i < 4; ++i) - Dout( <SPAN class="highlight">dc::ghost</SPAN>, "i = " << i ); // We can write more than just - // "Hello World" to the ostream :) + Dout(<SPAN class="highlight">dc::ghost</SPAN>, "i = " << i); // We can write more than just + // "Hello World" to the ostream :) return 0; } </PRE> Index: src/libcwd/documentation/tutorial/tut3.m4 diff -u src/libcwd/documentation/tutorial/tut3.m4:1.4 src/libcwd/documentation/tutorial/tut3.m4:1.5 --- src/libcwd/documentation/tutorial/tut3.m4:1.4 Sun Feb 17 07:30:15 2002 +++ src/libcwd/documentation/tutorial/tut3.m4 Sun Feb 17 16:44:06 2002 @@ -30,7 +30,7 @@ // Set the ostream related with libcw_do to `file': <SPAN class="highlight">Debug( libcw_do.set_ostream(&file) );</SPAN> - Dout( dc::notice, "Hippopotamus are heavy" ); + Dout(dc::notice, "Hippopotamus are heavy"); return 0; } Index: src/libcwd/documentation/tutorial/tut4.m4 diff -u src/libcwd/documentation/tutorial/tut4.m4:1.2 src/libcwd/documentation/tutorial/tut4.m4:1.3 --- src/libcwd/documentation/tutorial/tut4.m4:1.2 Sat Dec 29 20:17:49 2001 +++ src/libcwd/documentation/tutorial/tut4.m4 Sun Feb 17 16:44:06 2002 @@ -21,8 +21,9 @@ <P>Because the final application doesn't need libcwd, we can afford to use features of g++ and third party libraries that developers are able to install but that would be impractical as demand for the end-user of the application. The <EM>developer</EM> that uses libcwd will have to use -g++ as compiler and install libraries like libbfd and libiberty, but gets a lot of developing -advantages in return.</P> +g++ as compiler and perhaps use a linux box for the development of the application, but gets a lot +of developing advantages in return. Afterwards it is relatively easy to port the bug-free +code to other platforms/compilers.</P> <P>As a developer you need to know two things:</P> <OL TYPE="1"> Index: src/libcwd/documentation/tutorial/tut5.in diff -u src/libcwd/documentation/tutorial/tut5.in:1.4 src/libcwd/documentation/tutorial/tut5.in:1.5 --- src/libcwd/documentation/tutorial/tut5.in:1.4 Sun Feb 17 07:30:15 2002 +++ src/libcwd/documentation/tutorial/tut5.in Sun Feb 17 16:44:06 2002 @@ -66,7 +66,7 @@ The debug channels of libcw are put in namespace <CODE>libcw::debug::channels</CODE>. Nevertheless, it is not necessary to type</P> -<PRE>Dout( libcw::debug::channels::dc::notice, "Hello World" );</PRE> +<PRE>Dout(libcw::debug::channels::dc::notice, "Hello World");</PRE> <P>By default, the macro <CODE>Dout</CODE> et al. automatically include a<CODE> using namespace libcw::debug::channels</CODE>. It is possible to change this default namespace by defining <CODE>DEBUGCHANNELS</CODE> @@ -204,7 +204,7 @@ Debug( libcw_do.on() ); ForAllDebugChannels( if (!debugChannel.is_on()) debugChannel.on() ); - Dout( dc::elephant|dc::owl, "The elephant is called Dumbo, the owl is called Einstein." ); + Dout(dc::elephant|dc::owl, "The elephant is called Dumbo, the owl is called Einstein."); return 0; } @@ -234,7 +234,7 @@ ForAllDebugChannels( if (!debugChannel.is_on()) debugChannel.on() ); <SPAN class="highlight">Debug( dc::elephant.off() );</SPAN> - Dout( dc::elephant|dc::owl, "The elephant is called Dumbo, the owl is called Einstein." ); + Dout(dc::elephant|dc::owl, "The elephant is called Dumbo, the owl is called Einstein."); return 0; } @@ -275,8 +275,8 @@ Debug( libcw_do.on() ); Debug( dc::notice.on() ); - Dout( dc::notice|nonewline_cf, "Hello, " ); - Dout( dc::notice, "World" ); + Dout(dc::notice|nonewline_cf, "Hello, "); + Dout(dc::notice, "World"); return 0; } @@ -303,8 +303,8 @@ Debug( libcw_do.on() ); Debug( dc::notice.on() ); - Dout( dc::notice|nonewline_cf, "Hello, " ); - Dout( dc::notice|<SPAN class="highlight">noprefix_cf</SPAN>, "World" ); + Dout(dc::notice|nonewline_cf, "Hello, "); + Dout(dc::notice|<SPAN class="highlight">noprefix_cf</SPAN>, "World"); return 0; } @@ -361,13 +361,13 @@ struct stat buf; // Warning: this is NOT the correct way to do this (see below) - Dout( dc::notice|nonewline_cf, - "stat(\"" << file_name << "\", " ); + Dout(dc::notice|nonewline_cf, + "stat(\"" << file_name << "\", "); int ret = stat(file_name, &buf); - Dout( dc::notice|noprefix_cf|cond_error_cf(ret != 0), - &buf << ") = " << ret ); + Dout(dc::notice|noprefix_cf|cond_error_cf(ret != 0), + &buf << ") = " << ret); return 0; } @@ -442,13 +442,13 @@ struct stat<SPAN class="highlight">*</SPAN> buf<SPAN class="highlight">p</SPAN>; // This is NOT the correct way to do this. - Dout( dc::notice|nonewline_cf, - "stat_with_buf_alloc(\"" << file_name << "\", " ); + Dout(dc::notice|nonewline_cf, + "stat_with_buf_alloc(\"" << file_name << "\", "); int ret = stat<SPAN class="highlight">_with_buf_alloc</SPAN>(file_name, buf<SPAN class="highlight">p</SPAN>); - Dout( dc::notice|noprefix_cf|cond_error_cf(ret != 0), - bufp << ") = " << ret ); + Dout(dc::notice|noprefix_cf|cond_error_cf(ret != 0), + bufp << ") = " << ret); <SPAN class="highlight"> Debug( dc::malloc.off() ); @@ -514,13 +514,13 @@ char const* file_name = argv[1]; struct stat* bufp; - Dout( dc::notice|<SPAN class="highlight">continued_cf</SPAN>, - "stat_with_buf_alloc(\"" << file_name << "\", " ); + Dout(dc::notice|<SPAN class="highlight">continued_cf</SPAN>, + "stat_with_buf_alloc(\"" << file_name << "\", "); int ret = stat_with_buf_alloc(file_name, bufp); - Dout( <SPAN class="highlight">dc::finish</SPAN>|cond_error_cf(ret != 0), - bufp << ") = " << ret ); + Dout(<SPAN class="highlight">dc::finish</SPAN>|cond_error_cf(ret != 0), + bufp << ") = " << ret); Debug( dc::malloc.off() ); delete bufp; @@ -554,14 +554,14 @@ Debug( libcw_do.<SPAN class="highlight">set_margin</SPAN>("<-- margin -->") ); Debug( libcw_do.<SPAN class="highlight">set_marker</SPAN>("<-- marker -->") ); - Dout( dc::cat|dc::mouse, "The cat chases the mouse." ); - Dout( dc::mouse|dc::elephant, "The mouse chases the elephant." ); - Dout( dc::notice|<SPAN class="highlight">nolabel_cf</SPAN>, "Setting indentation to 8 spaces:" ); - Dout( dc::notice|<SPAN class="highlight">blank_label_cf</SPAN>, "<------>" ); + Dout(dc::cat|dc::mouse, "The cat chases the mouse."); + Dout(dc::mouse|dc::elephant, "The mouse chases the elephant."); + Dout(dc::notice|<SPAN class="highlight">nolabel_cf</SPAN>, "Setting indentation to 8 spaces:"); + Dout(dc::notice|<SPAN class="highlight">blank_label_cf</SPAN>, "<------>"); Debug( libcw_do.<SPAN class="highlight">set_indent(8)</SPAN> ); - Dout( dc::cat, "The cat sleeps." ); - Dout( dc::elephant, "The elephant looks around:" ); - Dout( dc::elephant|<SPAN class="highlight">blank_label_cf|blank_marker_cf</SPAN>, "where did the mouse go?" ); + Dout(dc::cat, "The cat sleeps."); + Dout(dc::elephant, "The elephant looks around:"); + Dout(dc::elephant|<SPAN class="highlight">blank_label_cf|blank_marker_cf</SPAN>, "where did the mouse go?"); return 0; } Index: src/libcwd/documentation/tutorial/tut6.m4 diff -u src/libcwd/documentation/tutorial/tut6.m4:1.4 src/libcwd/documentation/tutorial/tut6.m4:1.5 --- src/libcwd/documentation/tutorial/tut6.m4:1.4 Sun Feb 17 07:30:15 2002 +++ src/libcwd/documentation/tutorial/tut6.m4 Sun Feb 17 16:44:06 2002 @@ -157,6 +157,9 @@ <A HREF="tut5.html#interrupted">interrupting</A> the debug output of the first allocation.</LI> <LI>The allocation is done somewhere inside a function <CODE>main</CODE></A> but no <A HREF="../html/group__group__locations.html">Source-file:Line-number Information</A> information is found.</LI> +<LI>Likely the 'Loading debug symbols from..' is done <EM>before</EM> the application reaches <CODE>main()</CODE> +and is hence invisible (because the debug object, <CODE>libcw_do</CODE>, is still turned off). +You can force libcwd to print it nevertheless by setting the environment variable <CODE>LIBCWD_PRINT_LOADING</CODE>.</LI> </UL> <TABLE> ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2002-02-17 16:37:46
|
CVSROOT : /cvsroot/libcw Module : src Commit time: 2002-01-17 16:37:43 UTC Modified files: libcwd/acconfig.h libcwd/acinclude.m4 libcwd/debug.cc libcwd/elf32.cc libcwd/documentation/tutorial/faq.m4 libcwd/documentation/tutorial/hello_world.cc libcwd/documentation/tutorial/log_file.cc libcwd/documentation/tutorial/tut1.m4 libcwd/documentation/tutorial/tut2.m4 libcwd/include/sys.ho.in libcwd/testsuite/libcwd.tst/sys.h Log message: More _GNU_SOURCE fixes... Only bother about queuing messages for gcc 3.0 and higher. ---------------------- diff included ---------------------- Index: src/libcwd/acconfig.h diff -u src/libcwd/acconfig.h:1.12 src/libcwd/acconfig.h:1.13 --- src/libcwd/acconfig.h:1.12 Thu Feb 14 21:19:31 2002 +++ src/libcwd/acconfig.h Sun Feb 17 08:37:32 2002 @@ -22,8 +22,10 @@ // Defined when both -lpthread and pthread.h could be found. #undef LIBCWD_HAVE_PTHREAD +#if __GNUC__ < 3 // This is needed when using threading, for example to get `pthread_kill_other_threads_np'. #undef _GNU_SOURCE +#endif // Defined when --enable-libcwd-threading is used. #undef LIBCWD_THREAD_SAFE Index: src/libcwd/acinclude.m4 diff -u src/libcwd/acinclude.m4:1.49 src/libcwd/acinclude.m4:1.50 --- src/libcwd/acinclude.m4:1.49 Thu Feb 14 21:36:09 2002 +++ src/libcwd/acinclude.m4 Sun Feb 17 08:37:32 2002 @@ -886,7 +886,6 @@ dnl Other options if test "$USE_MAINTAINER_MODE" = yes; then EXTRAOPTS="-O" -DEBUGOPTS="-ggdb3" else EXTRAOPTS="-O" fi Index: src/libcwd/debug.cc diff -u src/libcwd/debug.cc:1.71 src/libcwd/debug.cc:1.72 --- src/libcwd/debug.cc:1.71 Sat Feb 16 17:42:06 2002 +++ src/libcwd/debug.cc Sun Feb 17 08:37:33 2002 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.71 2002/02/17 01:42:06 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.72 2002/02/17 16:37:33 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -126,7 +126,7 @@ ) #endif // LIBCWD_THREAD_SAFE { -#if defined(DEBUGMALLOC) && defined(LIBCWD_THREAD_SAFE) +#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && defined(DEBUGMALLOC) 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,7 +155,7 @@ msgbuf = (msgbuf_t)malloc(curlen + extra_size); free_msgbuf = true; } -#if defined(DEBUGMALLOC) && defined(LIBCWD_THREAD_SAFE) +#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && defined(DEBUGMALLOC) rdbuf()->sgetn(msgbuf->buf, curlen); #else rdbuf()->sgetn(msgbuf, curlen); @@ -183,7 +183,7 @@ } } #endif // !LIBCWD_THREAD_SAFE -#if defined(DEBUGMALLOC) && defined(LIBCWD_THREAD_SAFE) +#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && defined(DEBUGMALLOC) 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. Index: src/libcwd/documentation/tutorial/faq.m4 diff -u src/libcwd/documentation/tutorial/faq.m4:1.6 src/libcwd/documentation/tutorial/faq.m4:1.7 --- src/libcwd/documentation/tutorial/faq.m4:1.6 Sun Feb 17 07:30:15 2002 +++ src/libcwd/documentation/tutorial/faq.m4 Sun Feb 17 08:37:33 2002 @@ -27,7 +27,7 @@ libcwd. If you need to write 100% ANSI code and you are not sure whether or not new code that you added is an extension or not, you should try to compile it with CWDEBUG undefined <EM>and</EM> using -ansi as -command line option to g++; without -ansi g++-3.0.3 and higher define +command line option to g++; without -ansi g++-3.0 and higher defines _GNU_SOURCE itself by default.</P> <A name="sysd.h"></A> Index: src/libcwd/documentation/tutorial/hello_world.cc diff -u src/libcwd/documentation/tutorial/hello_world.cc:1.4 src/libcwd/documentation/tutorial/hello_world.cc:1.5 --- src/libcwd/documentation/tutorial/hello_world.cc:1.4 Sun Feb 17 07:30:15 2002 +++ src/libcwd/documentation/tutorial/hello_world.cc Sun Feb 17 08:37:33 2002 @@ -2,7 +2,7 @@ // This block should really be part of custom header files! Please ignore it // and read documentation/html/preparation.html#preparation_step2 instead. // "sys.h": -#ifndef _GNU_SOURCE // g++ 3.0.3 and higher already define this. +#ifndef _GNU_SOURCE // g++ 3.0 and higher already defines this. #define _GNU_SOURCE #endif #include <libcw/sysd.h> // This must be the first header file Index: src/libcwd/documentation/tutorial/log_file.cc diff -u src/libcwd/documentation/tutorial/log_file.cc:1.4 src/libcwd/documentation/tutorial/log_file.cc:1.5 --- src/libcwd/documentation/tutorial/log_file.cc:1.4 Sun Feb 17 07:30:15 2002 +++ src/libcwd/documentation/tutorial/log_file.cc Sun Feb 17 08:37:33 2002 @@ -2,7 +2,7 @@ // This block should really be part of custom header files! Please ignore it // and read documentation/html/preparation.html#preparation_step2 instead. // "sys.h": -#ifndef _GNU_SOURCE // g++ 3.0.3 and higher already define this. +#ifndef _GNU_SOURCE // g++ 3.0 and higher already defines this. #define _GNU_SOURCE #endif #include <libcw/sysd.h> // This must be the first header file Index: src/libcwd/documentation/tutorial/tut1.m4 diff -u src/libcwd/documentation/tutorial/tut1.m4:1.7 src/libcwd/documentation/tutorial/tut1.m4:1.8 --- src/libcwd/documentation/tutorial/tut1.m4:1.7 Sun Feb 17 07:30:15 2002 +++ src/libcwd/documentation/tutorial/tut1.m4 Sun Feb 17 08:37:33 2002 @@ -14,7 +14,7 @@ <PRE> // These four lines should actually be part of a custom "sys.h" file. See <A HREF="tut2.html">tutorial 2</A>. -#ifndef _GNU_SOURCE // Already defined by g++ 3.0.3 and higher. +#ifndef _GNU_SOURCE // Already defined by g++ 3.0 and higher. #define _GNU_SOURCE // This must be defined before including <libcw/sysd.h> #endif #include <libcw/sysd.h> // This must be the first header file @@ -45,7 +45,7 @@ threading support. If you do not define this macro and libcwd needs it, then you will get a compile error in <libcw/sysd.h> telling you so. -GNU gcc 3.0.3 (and higher) already defines this macro by itself, so there is +GNU gcc 3.0 (and higher) already defines this macro by itself, so there is no need to include it if you intend to only compile your application with this version.</P> Index: src/libcwd/documentation/tutorial/tut2.m4 diff -u src/libcwd/documentation/tutorial/tut2.m4:1.5 src/libcwd/documentation/tutorial/tut2.m4:1.6 --- src/libcwd/documentation/tutorial/tut2.m4:1.5 Sun Feb 17 07:30:15 2002 +++ src/libcwd/documentation/tutorial/tut2.m4 Sun Feb 17 08:37:33 2002 @@ -18,7 +18,7 @@ #endif #ifdef CWDEBUG // This is needed so that others can compile // your application without having libcwd installed. -#ifndef _GNU_SOURCE // Already defined by g++ 3.0.3 and higher. +#ifndef _GNU_SOURCE // Already defined by g++ 3.0 and higher. #define _GNU_SOURCE // Needed for libpthread extensions. #endif #include <libcw/sysd.h> Index: src/libcwd/elf32.cc diff -u src/libcwd/elf32.cc:1.37 src/libcwd/elf32.cc:1.38 --- src/libcwd/elf32.cc:1.37 Sat Feb 16 17:42:06 2002 +++ src/libcwd/elf32.cc Sun Feb 17 08:37:33 2002 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/elf32.cc,v 1.37 2002/02/17 01:42:06 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/elf32.cc,v 1.38 2002/02/17 16:37:33 libcw Exp $ // // Copyright (C) 2001, by // @@ -1125,6 +1125,10 @@ void object_file_ct::load_dwarf(void) { +#if __GNUC__ == 2 && __GNUC_MINOR__ == 96 + Dout(dc::warning, "gcc/g++ 2.96 has broken DWARF2 debug information. Source file / Line number lookups will fail frequently. " + "Use either g++ 2.95.x, 3.x or -gstabs."); +#endif uint32_t total_length; if (DEBUGDWARF) { @@ -1663,7 +1667,14 @@ } } } +#if __GNUC__ == 2 && __GNUC_MINOR__ < 96 +#ifdef DEBUGDEBUG // Play safe. + // g++ bug work around. + LIBCWD_ASSERT( debug_line_ptr == debug_line_ptr_end || debug_line_ptr == debug_line_ptr_end + 1 ); +#endif +#else LIBCWD_ASSERT( debug_line_ptr == debug_line_ptr_end ); +#endif // End state machine code. // ===========================================================================================================================17" Index: src/libcwd/include/sys.ho.in diff -u src/libcwd/include/sys.ho.in:1.9 src/libcwd/include/sys.ho.in:1.10 --- src/libcwd/include/sys.ho.in:1.9 Sat Feb 16 17:42:07 2002 +++ src/libcwd/include/sys.ho.in Sun Feb 17 08:37:33 2002 @@ -1,7 +1,7 @@ // @configure_input@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/sys.ho.in,v 1.9 2002/02/17 01:42:07 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/sys.ho.in,v 1.10 2002/02/17 16:37:33 libcw Exp $ // -// Copyright (C) 2000 - 2001, by +// Copyright (C) 2000 - 2002, by // // Carlo Wood, Run on IRC <ca...@al...> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt @@ -15,7 +15,6 @@ #ifndef SYS_H #define SYS_H -#undef _GNU_SOURCE // Could be defined by g++ itself and redefined in ../config.h #include "../config.h" // Index: src/libcwd/testsuite/libcwd.tst/sys.h diff -u src/libcwd/testsuite/libcwd.tst/sys.h:1.5 src/libcwd/testsuite/libcwd.tst/sys.h:1.6 --- src/libcwd/testsuite/libcwd.tst/sys.h:1.5 Sat Feb 16 17:42:07 2002 +++ src/libcwd/testsuite/libcwd.tst/sys.h Sun Feb 17 08:37:33 2002 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/sys.h,v 1.5 2002/02/17 01:42:07 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/sys.h,v 1.6 2002/02/17 16:37:33 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -14,13 +14,13 @@ #ifndef TESTSUITE_SYS_H #define TESTSUITE_SYS_H +#include "../../config.h" + #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include <libcw/sysd.h> -#undef _GNU_SOURCE -#include "../../config.h" #ifdef HAVE__G_CONFIG_H #include <_G_config.h> #ifndef _G_CLOG_CONFLICT ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2002-02-17 15:30:27
|
CVSROOT : /cvsroot/libcw Module : src Commit time: 2002-01-17 15:30:25 UTC Modified files: libcwd/documentation/doxygen-examples/markers.cc libcwd/documentation/tutorial/channel.cc libcwd/documentation/tutorial/faq.m4 libcwd/documentation/tutorial/hello_world.cc libcwd/documentation/tutorial/log_file.cc libcwd/documentation/tutorial/tut1.m4 libcwd/documentation/tutorial/tut2.m4 libcwd/documentation/tutorial/tut3.m4 libcwd/documentation/tutorial/tut5.in libcwd/documentation/tutorial/tut6.m4 Log message: Fixes for _GNU_SOURCE. Put even more stress on using custom debug.h and sys.h in the tutorial. ---------------------- diff included ---------------------- Index: src/libcwd/documentation/doxygen-examples/markers.cc diff -u src/libcwd/documentation/doxygen-examples/markers.cc:1.3 src/libcwd/documentation/doxygen-examples/markers.cc:1.4 --- src/libcwd/documentation/doxygen-examples/markers.cc:1.3 Thu Feb 7 20:03:47 2002 +++ src/libcwd/documentation/doxygen-examples/markers.cc Sun Feb 17 07:30:14 2002 @@ -1,4 +1,6 @@ +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include <libcw/sysd.h> #include <libcw/debug.h> Index: src/libcwd/documentation/tutorial/channel.cc diff -u src/libcwd/documentation/tutorial/channel.cc:1.3 src/libcwd/documentation/tutorial/channel.cc:1.4 --- src/libcwd/documentation/tutorial/channel.cc:1.3 Thu Feb 7 20:03:47 2002 +++ src/libcwd/documentation/tutorial/channel.cc Sun Feb 17 07:30:15 2002 @@ -2,16 +2,23 @@ // Please see the "example-project" in the source distribution of libcwd // for a better Real Life example. +//------------------------------------------------------------------------------- +// This block should really be part of custom header files! Please ignore it +// and read documentation/html/preparation.html#preparation_step2 instead. +// "sys.h": +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include <libcw/sysd.h> #define DEBUGCHANNELS ::example // Where we'll put our namespace dc +// "debug.h": #include <libcw/debug.h> - namespace example { // namespace dc cannot be put in :: namespace dc { libcw::debug::channel_ct ghost("GHOST"); // Create our own Debug Channel } } +//------------------------------------------------------------------------------- int main(void) { Index: src/libcwd/documentation/tutorial/faq.m4 diff -u src/libcwd/documentation/tutorial/faq.m4:1.5 src/libcwd/documentation/tutorial/faq.m4:1.6 --- src/libcwd/documentation/tutorial/faq.m4:1.5 Thu Feb 14 15:32:12 2002 +++ src/libcwd/documentation/tutorial/faq.m4 Sun Feb 17 07:30:15 2002 @@ -24,9 +24,11 @@ what could possibly be wrong with your code. Once the application works, you don't have to define _GNU_SOURCE because you won't be including the debug code anymore, nor link with -libcwd. Of course, when you are not sure whether or not new code -that you added is a GNU extension or not, you should try to compile it -with CWDEBUG undefined.</P> +libcwd. If you need to write 100% ANSI code and you are not sure +whether or not new code that you added is an extension or not, you +should try to compile it with CWDEBUG undefined <EM>and</EM> using -ansi as +command line option to g++; without -ansi g++-3.0.3 and higher define +_GNU_SOURCE itself by default.</P> <A name="sysd.h"></A> <H3>2. Why do I have to include "libcw/sysd.h" as first header file?</H3> Index: src/libcwd/documentation/tutorial/hello_world.cc diff -u src/libcwd/documentation/tutorial/hello_world.cc:1.3 src/libcwd/documentation/tutorial/hello_world.cc:1.4 --- src/libcwd/documentation/tutorial/hello_world.cc:1.3 Thu Feb 7 20:03:47 2002 +++ src/libcwd/documentation/tutorial/hello_world.cc Sun Feb 17 07:30:15 2002 @@ -1,6 +1,14 @@ +//------------------------------------------------------------------------------- +// This block should really be part of custom header files! Please ignore it +// and read documentation/html/preparation.html#preparation_step2 instead. +// "sys.h": +#ifndef _GNU_SOURCE // g++ 3.0.3 and higher already define this. #define _GNU_SOURCE -#include <libcw/sysd.h> // This must be the first header file +#endif +#include <libcw/sysd.h> // This must be the first header file +// "debug.h" #include <libcw/debug.h> +//------------------------------------------------------------------------------- int main(void) { Index: src/libcwd/documentation/tutorial/log_file.cc diff -u src/libcwd/documentation/tutorial/log_file.cc:1.3 src/libcwd/documentation/tutorial/log_file.cc:1.4 --- src/libcwd/documentation/tutorial/log_file.cc:1.3 Thu Feb 7 20:03:47 2002 +++ src/libcwd/documentation/tutorial/log_file.cc Sun Feb 17 07:30:15 2002 @@ -1,7 +1,15 @@ +//------------------------------------------------------------------------------- +// This block should really be part of custom header files! Please ignore it +// and read documentation/html/preparation.html#preparation_step2 instead. +// "sys.h": +#ifndef _GNU_SOURCE // g++ 3.0.3 and higher already define this. #define _GNU_SOURCE -#include <libcw/sysd.h> -#include <fstream> +#endif +#include <libcw/sysd.h> // This must be the first header file +// "debug.h" #include <libcw/debug.h> +//------------------------------------------------------------------------------- +#include <fstream> int main(void) { Index: src/libcwd/documentation/tutorial/tut1.m4 diff -u src/libcwd/documentation/tutorial/tut1.m4:1.6 src/libcwd/documentation/tutorial/tut1.m4:1.7 --- src/libcwd/documentation/tutorial/tut1.m4:1.6 Thu Feb 14 21:19:32 2002 +++ src/libcwd/documentation/tutorial/tut1.m4 Sun Feb 17 07:30:15 2002 @@ -13,8 +13,10 @@ <P>Compile as: <SPAN class="shell-command">g++ -g -DCWDEBUG hello_world.cc -lcwd -o hello_world</SPAN></P> <PRE> -// These two lines should actually be part of a custom "sys.h" file. See <A HREF="tut2.html">tutorial 2</A>. +// These four lines should actually be part of a custom "sys.h" file. See <A HREF="tut2.html">tutorial 2</A>. +#ifndef _GNU_SOURCE // Already defined by g++ 3.0.3 and higher. #define _GNU_SOURCE // This must be defined before including <libcw/sysd.h> +#endif #include <libcw/sysd.h> // This must be the first header file // This line should actually be part of a custom "debug.h" file. See <A HREF="tut2.html">tutorial 2</A>. #include <libcw/debug.h> @@ -42,7 +44,10 @@ Note that you only really have to define it when you compiled libcwd with threading support. If you do not define this macro and libcwd needs it, then you will get -a compile error in <libcw/sysd.h> telling you so.</P> +a compile error in <libcw/sysd.h> telling you so. +GNU gcc 3.0.3 (and higher) already defines this macro by itself, so there is +no need to include it if you intend to only compile your application with +this version.</P> <DIV class="faq-frame"><H4>FAQ</H4><UL class="faq"> <LI><A HREF="faq.html#GNU_SOURCE">Won't this define make my code non-portable?</A></LI> Index: src/libcwd/documentation/tutorial/tut2.m4 diff -u src/libcwd/documentation/tutorial/tut2.m4:1.4 src/libcwd/documentation/tutorial/tut2.m4:1.5 --- src/libcwd/documentation/tutorial/tut2.m4:1.4 Thu Feb 14 15:32:12 2002 +++ src/libcwd/documentation/tutorial/tut2.m4 Sun Feb 17 07:30:15 2002 @@ -16,11 +16,12 @@ #ifdef HAVE_CONFIG_H // This is just an example of what you could do #include "config.h" // when using autoconf for your project. #endif -#ifdef CWDEBUG // This is needed so that others can compile -#ifndef _GNU_SOURCE -#define _GNU_SOURCE +#ifdef CWDEBUG // This is needed so that others can compile + // your application without having libcwd installed. +#ifndef _GNU_SOURCE // Already defined by g++ 3.0.3 and higher. +#define _GNU_SOURCE // Needed for libpthread extensions. #endif -#include <libcw/sysd.h> // your application without having libcwd installed. +#include <libcw/sysd.h> #endif </PRE> <P>Create a file <CODE>"debug.h"</CODE> that is part of your application and put in it:</P> @@ -78,13 +79,10 @@ #include "sys.h" #include "debug.h" -// Include this to make life easier. -using namespace libcw::debug; - // Actual definition of `ghost' namespace debug_channels { namespace dc { - channel_ct <SPAN class="highlight">ghost</SPAN>("GHOST"); + libcw::debug::channel_ct <SPAN class="highlight">ghost</SPAN>("GHOST"); } } Index: src/libcwd/documentation/tutorial/tut3.m4 diff -u src/libcwd/documentation/tutorial/tut3.m4:1.3 src/libcwd/documentation/tutorial/tut3.m4:1.4 --- src/libcwd/documentation/tutorial/tut3.m4:1.3 Thu Feb 7 20:03:47 2002 +++ src/libcwd/documentation/tutorial/tut3.m4 Sun Feb 17 07:30:15 2002 @@ -13,10 +13,9 @@ <P>Compile as: <CODE>g++ -DCWDEBUG log_file.cc -lcwd -o log_file</CODE></P> <PRE> -#define _GNU_SOURCE -#include <libcw/sysd.h> +#include "sys.h" // See tutorial 2. #include <fstream> -#include <libcw/debug.h> +#include "debug.h" // See tutorial 2. int main(void) { Index: src/libcwd/documentation/tutorial/tut5.in diff -u src/libcwd/documentation/tutorial/tut5.in:1.3 src/libcwd/documentation/tutorial/tut5.in:1.4 --- src/libcwd/documentation/tutorial/tut5.in:1.3 Thu Feb 14 15:32:13 2002 +++ src/libcwd/documentation/tutorial/tut5.in Sun Feb 17 07:30:15 2002 @@ -30,8 +30,8 @@ <P class="download">[<A HREF="examples5/test5.1.1.cc">download</A>]</P> <PRE> <!-- START CODE examples5/test5.1.1.cc --> -#include "sys.h" // See tutorial 2 -#include <libcw/debug.h> +#include "sys.h" // See tutorial 2 +#include "debug.h" int main(void) { Index: src/libcwd/documentation/tutorial/tut6.m4 diff -u src/libcwd/documentation/tutorial/tut6.m4:1.3 src/libcwd/documentation/tutorial/tut6.m4:1.4 --- src/libcwd/documentation/tutorial/tut6.m4:1.3 Thu Feb 7 20:03:47 2002 +++ src/libcwd/documentation/tutorial/tut6.m4 Sun Feb 17 07:30:15 2002 @@ -59,9 +59,8 @@ <P>Compile as: <CODE>g++ -DCWDEBUG amo.cc -lcwd -o amo</CODE></P> <PRE> -#define _GNU_SOURCE -#include <libcw/sysd.h> -#include <libcw/debug.h> +#include "sys.h" // See tutorial 2. +#include "debug.h" int main(void) { @@ -85,9 +84,8 @@ <P>Now let us actually allocate some memory:</P> <PRE> -#define _GNU_SOURCE -#include <libcw/sysd.h> -#include <libcw/debug.h> +#include "sys.h" // See tutorial 2. +#include "debug.h" int main(void) { @@ -117,9 +115,8 @@ In order to find out what is wrong, we <EM>also turn on debug channel</EM><CODE> dc::bfd</CODE>:</P> <PRE> -#define _GNU_SOURCE -#include <libcw/sysd.h> -#include <libcw/debug.h> +#include "sys.h" // See tutorial 2. +#include "debug.h" int main(void) { @@ -183,9 +180,8 @@ your program is doing:</P> <PRE> -#define _GNU_SOURCE -#include <libcw/sysd.h> -#include <libcw/debug.h> +#include "sys.h" // See tutorial 2. +#include "debug.h" int main(void) { @@ -219,9 +215,8 @@ <P>Consider the following code:</P> <PRE> -#define _GNU_SOURCE -#include <libcw/sysd.h> -#include <libcw/debug.h> +#include "sys.h" // See tutorial 2. +#include "debug.h" int main(void) { @@ -259,9 +254,8 @@ <CODE>AllocTag_dynamic_description()</CODE>, which <EM>will</EM> work.</P> <PRE> -#define _GNU_SOURCE -#include <libcw/sysd.h> -#include <libcw/debug.h> +#include "sys.h" // See tutorial 2. +#include "debug.h" int main(void) { @@ -305,9 +299,8 @@ <CODE>AllocTag1(p)</CODE>:</P> <PRE> -#define _GNU_SOURCE -#include <libcw/sysd.h> -#include <libcw/debug.h> +#include "sys.h" // See tutorial 2. +#include "debug.h" int main(void) { ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2002-02-17 15:01:02
|
CVSROOT : /cvsroot/libcw Module : src Commit time: 2002-01-17 15:01:00 UTC Modified files: libcwd/documentation/styles/defines.h libcwd/documentation/styles/doxygen.css libcwd/documentation/styles/main.css Log message: Correct fix for helvetica italics. ---------------------- diff included ---------------------- Index: src/libcwd/documentation/styles/defines.h diff -u src/libcwd/documentation/styles/defines.h:1.3 src/libcwd/documentation/styles/defines.h:1.4 --- src/libcwd/documentation/styles/defines.h:1.3 Thu Feb 14 21:19:32 2002 +++ src/libcwd/documentation/styles/defines.h Sun Feb 17 07:00:49 2002 @@ -26,9 +26,9 @@ /* Don't use helvetica, it is broken on RedHat which has an alias "-alias-helvetica-medium-i-normal--*-iso8859-1" * installed that is actually a horrible looking japanese font. See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=59911 */ #ifndef IE -#define NORMAL_ITALICS_FONT font-family: sans-serif; font-size: NORMAL_SIZE; font-size-adjust: none +#define ITALICS font-family: sans-serif; font-style: italic; #else -#define NORMAL_ITALICS_FONT NORMAL_FONT +#define ITALICS font-style: italic; #endif #ifdef KONQUEROR Index: src/libcwd/documentation/styles/doxygen.css diff -u src/libcwd/documentation/styles/doxygen.css:1.3 src/libcwd/documentation/styles/doxygen.css:1.4 --- src/libcwd/documentation/styles/doxygen.css:1.3 Sun Jan 20 08:25:11 2002 +++ src/libcwd/documentation/styles/doxygen.css Sun Feb 17 07:00:49 2002 @@ -85,7 +85,7 @@ DIV.groupText { margin-left : 16px; - font-style : italic; + ITALICS font-size : smaller; } Index: src/libcwd/documentation/styles/main.css diff -u src/libcwd/documentation/styles/main.css:1.3 src/libcwd/documentation/styles/main.css:1.4 --- src/libcwd/documentation/styles/main.css:1.3 Thu Feb 14 21:19:32 2002 +++ src/libcwd/documentation/styles/main.css Sun Feb 17 07:00:49 2002 @@ -199,7 +199,7 @@ } .para { - font-style : italic; + ITALICS } .command-line-parameter { @@ -208,7 +208,7 @@ .command-line-variable { font-weight : normal; - font-style : italic; + ITALICS } .shell-command { @@ -217,10 +217,10 @@ } I { - NORMAL_ITALICS_FONT + ITALICS } EM { - NORMAL_ITALICS_FONT + ITALICS } ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2002-02-17 01:42:19
|
CVSROOT : /cvsroot/libcw Module : src Commit time: 2002-01-17 01:42:17 UTC Modified files: libcwd/NEWS libcwd/debug.cc libcwd/debugmalloc.cc libcwd/elf32.cc libcwd/include/sys.ho.in libcwd/include/libcw/class_debug.h libcwd/include/libcw/private_struct_TSD.h libcwd/testsuite/libcwd.tst/sys.h Log message: Fixed two theoretically possible dead locks. ---------------------- diff included ---------------------- Index: src/libcwd/NEWS diff -u src/libcwd/NEWS:1.70 src/libcwd/NEWS:1.71 --- src/libcwd/NEWS:1.70 Thu Feb 14 21:19:31 2002 +++ src/libcwd/NEWS Sat Feb 16 17:42:06 2002 @@ -17,6 +17,28 @@ that is defined under preferences -> appearance -> fonts. This should be set to -adobe-helvetica-*-. + Fixed a dead lock in object_file_ct::find_nearest_line(). + The dead lock occured when debug output written from + load_dwarf/load_stabs, which must be done with userspace + allocations, caused a recursive entry into this function. + + Fixed a dead lock in std::__default_allocator<true, 0>, the + default userspace allocator of the STL. The problem here + is that this lock is set when it calls malloc() to increase + its internal memory pool, causing a dead lock when memory + needs to be allocated during the writing of debug output + to dc::malloc or dc::bfd (this happens *extremely* seldom, + I even knew about this when I released 0.99.16). The solution + is to queue messages instead of writing them to the final + ostream when we find that the std::__default_allocator<true, 0> + is set and we are printing debug output from within malloc() + et al (then we assume we took the lock). The queued messages + are flushed the first time this condition is not true. The + queue is debug object specific which means that if you use + two or more different debug objects that write to the same + ostream, the ordering of messages could become non chronologic, + but then again - we could also put a man on Pluto next year. + libcwd-0.99.16 * libcwd is now thread-safe * Index: src/libcwd/debug.cc diff -u src/libcwd/debug.cc:1.70 src/libcwd/debug.cc:1.71 --- src/libcwd/debug.cc:1.70 Thu Feb 14 21:36:09 2002 +++ src/libcwd/debug.cc Sat Feb 16 17:42:06 2002 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.70 2002/02/15 05:36:09 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.71 2002/02/17 01:42:06 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -13,6 +13,14 @@ #include "sys.h" #include <libcw/debug_config.h> + +#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && defined(DEBUGMALLOC) +// 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) + #include <errno.h> #include <iostream> #include <sys/time.h> // Needed for setrlimit() @@ -59,8 +67,42 @@ namespace libcw { namespace debug { +namespace _private_ { + +#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && defined(DEBUGMALLOC) +// 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 +// test instead. +__inline__ +bool allocator_trylock(void) +{ + if (!(__NODE_ALLOCATOR_THREADS)) return true; +#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION) + if (!std::__default_alloc_template<true, 0>::_S_node_allocator_lock._M_init_flag) + std::__default_alloc_template<true, 0>::_S_node_allocator_lock._M_initialize(); +#endif + return (__gthread_mutex_trylock(&std::__default_alloc_template<true, 0>::_S_node_allocator_lock._M_lock) == 0); +} + +// The following unlocks the node allocator. +__inline__ +void allocator_unlock(void) +{ + if (!(__NODE_ALLOCATOR_THREADS)) return; +#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION) + if (!std::__default_alloc_template<true, 0>::_S_node_allocator_lock._M_init_flag) + std::__default_alloc_template<true, 0>::_S_node_allocator_lock._M_initialize(); +#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) + +} // namespace _private_ + using _private_::set_alloc_checking_on; using _private_::set_alloc_checking_off; + using _private_::debug_message_st; class buffer_ct : public _private_::internal_stringstream { private: @@ -71,24 +113,56 @@ #endif public: #ifdef LIBCWD_THREAD_SAFE - void writeto(std::ostream* os, _private_::lock_interface_base_ct* mutex LIBCWD_COMMA_TSD_PARAM) + void writeto(std::ostream* os, _private_::lock_interface_base_ct* mutex LIBCWD_COMMA_TSD_PARAM, debug_ct& +#ifdef DEBUGMALLOC + debug_object +#endif + ) #else - void writeto(std::ostream* os LIBCWD_COMMA_TSD_PARAM) + void writeto(std::ostream* os LIBCWD_COMMA_TSD_PARAM, debug_ct& +#ifdef DEBUGMALLOC + debug_object #endif + ) +#endif // LIBCWD_THREAD_SAFE { - char* buf; - bool used_malloc = false; - int curlen = rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out) - rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in); - if (curlen > 512 || !(buf = (char*)__builtin_alloca(curlen))) +#if defined(DEBUGMALLOC) && defined(LIBCWD_THREAD_SAFE) + 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 + // did that (because we got here via malloc or free). At least as important: if + // this is the last thread, just prior to exiting the application, and we CAN + // get the lock - then DON'T queue the message (and thus flush all possibly queued + // messages); this garantees that there will never messages be left in the queue + // when the application exits. + bool const queue_msg = __libcwd_tsd.inside_malloc_or_free && !_private_::allocator_trylock(); + if (__libcwd_tsd.inside_malloc_or_free && !queue_msg) + _private_::allocator_unlock(); // Always immedeately release the lock again. + int const extra_size = sizeof(debug_message_st) - sizeof(msgbuf->buf); +#else + typedef char* msgbuf_t; + msgbuf_t msgbuf; + bool const queue_msg = false; + int const extra_size = 0; +#endif + int curlen; + curlen = rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out) - rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in); + bool free_msgbuf = false; + if (queue_msg) + msgbuf = (msgbuf_t)malloc(curlen + extra_size); + else if (curlen > 512 || !(msgbuf = (msgbuf_t)__builtin_alloca(curlen + extra_size))) { - set_alloc_checking_off(LIBCWD_TSD); - buf = (char*)malloc(curlen); - set_alloc_checking_on(LIBCWD_TSD); - used_malloc = true; + msgbuf = (msgbuf_t)malloc(curlen + extra_size); + free_msgbuf = true; } - rdbuf()->sgetn(buf, curlen); +#if defined(DEBUGMALLOC) && defined(LIBCWD_THREAD_SAFE) + rdbuf()->sgetn(msgbuf->buf, curlen); +#else + rdbuf()->sgetn(msgbuf, curlen); +#endif #ifdef DEBUGMALLOC // 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; __libcwd_tsd.internal = 0; ++__libcwd_tsd.library_call; @@ -97,40 +171,69 @@ #ifdef LIBCWD_THREAD_SAFE LIBCWD_DISABLE_CANCEL // We don't want Dout() to be a cancellation point. if (mutex) - { mutex->lock(); - os->write(buf, curlen); - mutex->unlock(); - } else if (_private_::WST_multi_threaded) { static bool WST_second_time = false; // Break infinite loop. - if (WST_second_time) - os->write(buf, curlen); - else + if (!WST_second_time) { WST_second_time = true; DoutFatal(dc::core, "When using multiple threads, you must provide a locking mechanism for the debug output stream. " "You can pass a pointer to a mutex with `debug_ct::set_ostream' (see documentation/html/group__group__destination.html)."); } } +#endif // !LIBCWD_THREAD_SAFE +#if defined(DEBUGMALLOC) && defined(LIBCWD_THREAD_SAFE) + 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. + // It is namely possible that this will again try to acquire the lock in std::__default_alloc_template<true, 0>, resulting + // in a dead lock. Append it to the queue instead. + msgbuf->curlen = curlen; + msgbuf->prev = NULL; + msgbuf->next = debug_object.queue; + if (debug_object.queue) + debug_object.queue->prev = msgbuf; + else + debug_object.queue_top = msgbuf; + debug_object.queue = msgbuf; + } else - os->write(buf, curlen); + { + debug_message_st* message = debug_object.queue_top; + if (message) + { + // First empty the whole queue. + debug_message_st* next_message; + do + { + next_message = message->prev; + os->write(message->buf, message->curlen); + __libcwd_tsd.internal = 1; + free(message); + __libcwd_tsd.internal = 0; + } + while ((message = next_message)); + debug_object.queue_top = debug_object.queue = NULL; + } + // Then write the new message. + os->write(msgbuf->buf, curlen); + } +#else // !(defined(DEBUGMALLOC) && defined(LIBCWD_THREAD_SAFE)) + os->write(msgbuf, curlen); +#endif // !DEBUGMALLOC +#ifdef LIBCWD_THREAD_SAFE + if (mutex) + mutex->unlock(); LIBCWD_ENABLE_CANCEL -#else // !LIBCWD_THREAD_SAFE - os->write(buf, curlen); #endif // !LIBCWD_THREAD_SAFE #ifdef DEBUGMALLOC --LIBCWD_DO_TSD_MEMBER_OFF(libcw_do); --__libcwd_tsd.library_call; __libcwd_tsd.internal = saved_internal; #endif - if (used_malloc) - { - set_alloc_checking_off(LIBCWD_TSD); - free(buf); - set_alloc_checking_on(LIBCWD_TSD); - } + if (free_msgbuf) + free(msgbuf); } void store_position(void) { position = rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out); @@ -735,7 +838,7 @@ current_oss->write("<unfinished>\n", 13); // Continued debug output should end on a space by itself, // And write out what is in the buffer till now. std::ostream* target_os = (channel_set.mask & cerr_cf) ? &std::cerr : debug_object.real_os; - static_cast<buffer_ct*>(current_oss)->writeto(target_os LIBCWD_COMMA_MUTEX LIBCWD_COMMA_TSD); + static_cast<buffer_ct*>(current_oss)->writeto(target_os LIBCWD_COMMA_MUTEX LIBCWD_COMMA_TSD, debug_object); // Truncate the buffer to its prefix and append "<continued>" to it already. static_cast<buffer_ct*>(current_oss)->restore_position(); current_oss->write("<continued> ", 12); // therefore we repeat the space here. @@ -831,7 +934,7 @@ if ((current->mask & flush_cf)) { // Write buffer to ostream. - static_cast<buffer_ct*>(current_oss)->writeto(target_os LIBCWD_COMMA_MUTEX LIBCWD_COMMA_TSD); + static_cast<buffer_ct*>(current_oss)->writeto(target_os LIBCWD_COMMA_MUTEX LIBCWD_COMMA_TSD, debug_object); // Flush ostream. Note that in the case of nested debug output this `os' can be an stringstream, // in that case, no actual flushing is done until the debug output to the real ostream has // finished. @@ -851,7 +954,7 @@ current_oss->put('\n'); // Write buffer to ostream. - static_cast<buffer_ct*>(current_oss)->writeto(target_os LIBCWD_COMMA_MUTEX LIBCWD_COMMA_TSD); + static_cast<buffer_ct*>(current_oss)->writeto(target_os LIBCWD_COMMA_MUTEX LIBCWD_COMMA_TSD, debug_object); // Handle control flags, if any: if (current->mask != 0) @@ -1066,44 +1169,14 @@ debug_tsd_st::~debug_tsd_st() { - if (!tsd_initialized) // Don't de-initialize when it wasn't initialized. + if (!tsd_initialized) // Skip 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?)" ); if (laf_stack.size()) DoutFatal( dc::core|cerr_cf, "Destructing debug_tsd_st with a non-empty laf_stack" ); - - LIBCWD_TSD_DECLARATION - set_alloc_checking_off(LIBCWD_TSD); - marker.ST_internal_deinit(); - margin.ST_internal_deinit(); - set_alloc_checking_on(LIBCWD_TSD); - tsd_initialized = false; - } - - /** - * \brief Destructor - */ - debug_ct::~debug_ct() - { - WNS_initialized = false; -#ifdef DEBUGDEBUG - init_magic = 0; -#endif - LIBCWD_TSD_DECLARATION - LIBCWD_DEFER_CANCEL - set_alloc_checking_off(LIBCWD_TSD); - DEBUG_OBJECTS_ACQUIRE_WRITE_LOCK - { - _private_::debug_objects_ct::container_type& objects(_private_::debug_objects.write_locked()); - objects.erase(find(objects.begin(), objects.end(), this)); - if (objects.empty()) - _private_::debug_objects.ST_uninit(); - } - DEBUG_OBJECTS_RELEASE_WRITE_LOCK - set_alloc_checking_on(LIBCWD_TSD); - LIBCWD_RESTORE_CANCEL + // Don't actually deinitialize anything. } /** @@ -1450,7 +1523,7 @@ LIBCWD_TSD_DECLARATION if (__libcwd_tsd.recursive_assert #ifdef DEBUGDEBUGMALLOC - || __libcwd_tsd.recursive + || __libcwd_tsd.inside_malloc_or_free #endif ) { Index: src/libcwd/debugmalloc.cc diff -u src/libcwd/debugmalloc.cc:1.82 src/libcwd/debugmalloc.cc:1.83 --- src/libcwd/debugmalloc.cc:1.82 Fri Feb 8 19:22:59 2002 +++ src/libcwd/debugmalloc.cc Sat Feb 16 17:42:06 2002 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.82 2002/02/09 03:22:59 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.83 2002/02/17 01:42:06 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -122,12 +122,6 @@ #define DEBUGMALLOC_INTERNAL #include "sys.h" #include <libcw/debug_config.h> -#if defined(LIBCWD_THREAD_SAFE) && (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) -// 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 && LIBCWD_THREAD_SAFE #if defined(DEBUGMALLOC) || defined(LIBCW_DOXYGEN) @@ -222,37 +216,6 @@ namespace _private_ { -#if __GNUC__ >= 3 || __GNUC_MINOR__ >= 97 -#ifdef LIBCWD_THREAD_SAFE -// 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 -// test instead. -bool allocator_trylock(bool when_no_threads) -{ - if (!(__NODE_ALLOCATOR_THREADS)) return when_no_threads; - -#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION) - if (!std::__default_alloc_template<true, 0>::_S_node_allocator_lock._M_init_flag) - std::__default_alloc_template<true, 0>::_S_node_allocator_lock._M_initialize(); -#endif - return (__gthread_mutex_trylock(&std::__default_alloc_template<true, 0>::_S_node_allocator_lock._M_lock) == 0); -} - -// The following unlocks the node allocator. -void allocator_unlock(void) -{ - if (!(__NODE_ALLOCATOR_THREADS)) return; - -#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION) - if (!std::__default_alloc_template<true, 0>::_S_node_allocator_lock._M_init_flag) - std::__default_alloc_template<true, 0>::_S_node_allocator_lock._M_initialize(); -#endif - __gthread_mutex_unlock(&std::__default_alloc_template<true, 0>::_S_node_allocator_lock._M_lock); -} -#endif // LIBCWD_THREAD_SAFE -#endif // __GNUC__ >= 3 - void no_alloc_print_int_to(std::ostream* os, unsigned long val, bool hexadecimal) { char buf[32]; // 32 > x where x is the number of digits of the largest unsigned long. @@ -1297,12 +1260,11 @@ { #ifdef DEBUGDEBUGMALLOC // We can't use `assert' here, because that can call malloc. - if (__libcwd_tsd.recursive > __libcwd_tsd.library_call && !__libcwd_tsd.internal) + 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.recursive <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed."); + DEBUGDEBUGMALLOC_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(); } - ++__libcwd_tsd.recursive; #endif #if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(DEBUGMALLOCEXTERNALCLINKAGE) LIBCWD_ASSERT( _private_::WST_ios_base_initialized || __libcwd_tsd.internal ); @@ -1325,12 +1287,7 @@ #endif // DEBUGDEBUGMALLOC #ifdef DEBUGMAGICMALLOC if (!ptr) - { -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; -#endif return; - } ptr = static_cast<size_t*>(ptr) - 2; if (from == from_delete) { @@ -1357,22 +1314,18 @@ ((size_t*)(static_cast<char*>(ptr) + SIZE_PLUS_TWELVE(((size_t*)ptr)[1])))[-1] ^= (size_t)-1; #endif // DEBUGMAGICMALLOC __libc_free(ptr); -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; -#endif return; } // internal + ++__libcwd_tsd.inside_malloc_or_free; if (!ptr) { -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; -#endif #if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) DoutInternal( dc_malloc, "Trying to free NULL - ignored [" << ++__libcwd_tsd.marker << "]." ); #else DoutInternal( dc_malloc, "Trying to free NULL - ignored." ); #endif + --__libcwd_tsd.inside_malloc_or_free; return; } @@ -1502,9 +1455,7 @@ if (visible) DoutInternal( dc::finish, "" ); } -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; -#endif + --__libcwd_tsd.inside_malloc_or_free; } void init_debugmalloc(void) @@ -1527,16 +1478,13 @@ #endif // __GLIBCPP__ ) { - WST_initialization_state = 1; // ST_initialize_globals() calls malloc again of course. -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; // Allow that. -#endif + WST_initialization_state = 1; // ST_initialize_globals() calls malloc again of course. + int recursive_store = __libcwd_tsd.inside_malloc_or_free; + __libcwd_tsd.inside_malloc_or_free = 0; // Allow that (this call to malloc will not have done from STL allocator). libcw::debug::ST_initialize_globals(); // This doesn't belong in the malloc department at all, but malloc() happens // to be a function that is called _very_ early - and hence this is a good moment // to initialize ALL of libcwd. -#ifdef DEBUGDEBUGMALLOC - ++__libcwd_tsd.recursive; -#endif + __libcwd_tsd.inside_malloc_or_free = recursive_store; } } } @@ -1645,7 +1593,7 @@ #ifdef DEBUGDEBUGMALLOC { LIBCWD_TSD_DECLARATION - LIBCWD_ASSERT( !__libcwd_tsd.recursive && !__libcwd_tsd.internal ); + LIBCWD_ASSERT( !__libcwd_tsd.inside_malloc_or_free && !__libcwd_tsd.internal ); } #endif @@ -1805,7 +1753,7 @@ { #ifdef DEBUGDEBUGMALLOC LIBCWD_TSD_DECLARATION - LIBCWD_ASSERT( !__libcwd_tsd.recursive && !__libcwd_tsd.internal ); + LIBCWD_ASSERT( !__libcwd_tsd.inside_malloc_or_free && !__libcwd_tsd.internal ); #endif Dout( dc_malloc, "New libcw::debug::marker_ct at " << this ); bool error = false; @@ -1837,7 +1785,7 @@ { #ifdef DEBUGDEBUGMALLOC LIBCWD_TSD_DECLARATION - LIBCWD_ASSERT( !__libcwd_tsd.recursive && !__libcwd_tsd.internal ); + LIBCWD_ASSERT( !__libcwd_tsd.inside_malloc_or_free && !__libcwd_tsd.internal ); #endif LIBCWD_DEFER_CANCEL_NO_BRACE @@ -1882,7 +1830,7 @@ { #ifdef DEBUGDEBUGMALLOC LIBCWD_TSD_DECLARATION - LIBCWD_ASSERT( !__libcwd_tsd.recursive && !__libcwd_tsd.internal ); + LIBCWD_ASSERT( !__libcwd_tsd.inside_malloc_or_free && !__libcwd_tsd.internal ); #endif LIBCWD_DEFER_CANCEL_NO_BRACE @@ -1980,7 +1928,7 @@ { #ifdef DEBUGDEBUGMALLOC LIBCWD_TSD_DECLARATION - LIBCWD_ASSERT( !__libcwd_tsd.recursive && !__libcwd_tsd.internal ); + LIBCWD_ASSERT( !__libcwd_tsd.inside_malloc_or_free && !__libcwd_tsd.internal ); #endif alloc_ct const* res; @@ -2096,10 +2044,9 @@ // void register_external_allocation(void const* mptr, size_t size) { -#ifdef DEBUGDEBUGMALLOC LIBCWD_TSD_DECLARATION - LIBCWD_ASSERT( !__libcwd_tsd.recursive && !__libcwd_tsd.internal ); - ++__libcwd_tsd.recursive; +#ifdef DEBUGDEBUGMALLOC + LIBCWD_ASSERT( !__libcwd_tsd.inside_malloc_or_free && !__libcwd_tsd.internal ); #endif #if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) LIBCWD_ASSERT( _private_::WST_ios_base_initialized ); @@ -2108,7 +2055,7 @@ DoutFatalInternal( dc::core, "Calling register_external_allocation while `internal' is non-zero! " "You can't use RegisterExternalAlloc() inside a Dout() et. al. " "(or whenever alloc_checking is off)." ); - + ++__libcwd_tsd.inside_malloc_or_free; DoutInternal( dc_malloc, "register_external_allocation(" << (void*)mptr << ", " << size << ')' ); if (WST_initialization_state == 0) // Only true once. @@ -2150,10 +2097,7 @@ #ifdef DEBUGUSEBFD memblk_info.get_alloc_node()->location_reference().move(loc); #endif - -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; -#endif + --__libcwd_tsd.inside_malloc_or_free; } #endif // !DEBUGMALLOCEXTERNALCLINKAGE @@ -2190,21 +2134,14 @@ void* __libcwd_malloc(size_t size) { -#if (__GNUC__ >= 3 || __GNUC_MINOR__ >= 97) && defined(LIBCWD_THREAD_SAFE) && defined(DEBUGDEBUG) - bool locked = false; - if (_private_::WST_multi_threaded) - locked = _private_::allocator_trylock(true); // Fake a std::string (etc) lock. -#endif - LIBCWD_TSD_DECLARATION #ifdef DEBUGDEBUGMALLOC // We can't use `assert' here, because that can call malloc. - if (__libcwd_tsd.recursive > __libcwd_tsd.library_call && !__libcwd_tsd.internal) + if (__libcwd_tsd.inside_malloc_or_free > __libcwd_tsd.library_call && !__libcwd_tsd.internal) { - FATALDEBUGDEBUG_CERR("DEBUGDEBUGMALLOC: debugmalloc.cc:" << __LINE__ - 2 << ": " << __PRETTY_FUNCTION__ << ": Assertion `__libcwd_tsd.recursive <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed."); + FATALDEBUGDEBUG_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(); } - ++__libcwd_tsd.recursive; #ifdef DEBUGDEBUGOUTPUT int saved_marker = ++__libcwd_tsd.marker; #endif @@ -2217,49 +2154,34 @@ DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Entering `__libcwd_malloc(" << size << ")' [" << saved_marker << ']' ); #if !defined(DEBUGDEBUGMALLOC) && !defined(DEBUGMAGICMALLOC) - UNLOCK return __libc_malloc(size); #else // defined(DEBUGDEBUGMALLOC) || defined(DEBUGMAGICMALLOC) #ifndef DEBUGMAGICMALLOC void* ptr = __libc_malloc(size); -#ifdef DEBUGDEBUGMALLOC DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_malloc': " << ptr << " [" << saved_marker << ']' ); - --__libcwd_tsd.recursive; -#endif // DEBUGDEBUGMALLOC - UNLOCK return ptr; #else // DEBUGMAGICMALLOC void* ptr = __libc_malloc(SIZE_PLUS_TWELVE(size)); if (!ptr) - { -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; -#endif - UNLOCK return NULL; - } ((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; -#ifdef DEBUGDEBUGMALLOC DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_malloc': " << static_cast<size_t*>(ptr) + 2 << " [" << saved_marker << ']' ); - --__libcwd_tsd.recursive; -#endif // DEBUGDEBUGMALLOC - UNLOCK return static_cast<size_t*>(ptr) + 2; #endif // DEBUGMAGICMALLOC #endif // defined(DEBUGDEBUGMALLOC) || defined(DEBUGMAGICMALLOC) } // internal + ++__libcwd_tsd.inside_malloc_or_free; #if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) DoutInternal( dc_malloc|continued_cf, "malloc(" << size << ") = [" << saved_marker << ']' ); #else DoutInternal( dc_malloc|continued_cf, "malloc(" << size << ") = " ); #endif void* ptr = internal_malloc(size, memblk_type_malloc CALL_ADDRESS LIBCWD_COMMA_TSD SAVEDMARKER); - #ifdef DEBUGMAGICMALLOC if (ptr) { @@ -2268,11 +2190,7 @@ ((size_t*)(static_cast<char*>(ptr) + SIZE_PLUS_FOUR(size)))[-1] = MAGIC_MALLOC_END; } #endif - -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; -#endif - UNLOCK + --__libcwd_tsd.inside_malloc_or_free; return ptr; } @@ -2281,12 +2199,11 @@ LIBCWD_TSD_DECLARATION #ifdef DEBUGDEBUGMALLOC // We can't use `assert' here, because that can call malloc. - if (__libcwd_tsd.recursive > __libcwd_tsd.library_call && !__libcwd_tsd.internal) + 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.recursive <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed."); + DEBUGDEBUGMALLOC_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(); } - ++__libcwd_tsd.recursive; #ifdef DEBUGDEBUGOUTPUT int saved_marker = ++__libcwd_tsd.marker; #endif @@ -2304,34 +2221,24 @@ #ifndef DEBUGMAGICMALLOC void* ptr = __libc_calloc(nmemb, size); -#ifdef DEBUGDEBUGMALLOC DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_calloc': " << ptr << " [" << saved_marker << ']' ); - --__libcwd_tsd.recursive; -#endif return ptr; #else // DEBUGMAGICMALLOC void* ptr = __libc_malloc(SIZE_PLUS_TWELVE(nmemb * size)); if (!ptr) - { -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; -#endif return NULL; - } memset(static_cast<void*>(static_cast<size_t*>(ptr) + 2), 0, nmemb * size); ((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; -#ifdef DEBUGDEBUGMALLOC DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_calloc': " << static_cast<size_t*>(ptr) + 2 << " [" << saved_marker << ']' ); - --__libcwd_tsd.recursive; -#endif // DEBUGDEBUGMALLOC return static_cast<size_t*>(ptr) + 2; #endif // DEBUGMAGICMALLOC #endif // defined(DEBUGDEBUGMALLOC) || defined(DEBUGMAGICMALLOC) } // internal + ++__libcwd_tsd.inside_malloc_or_free; #if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) DoutInternal( dc_malloc|continued_cf, "calloc(" << nmemb << ", " << size << ") = [" << saved_marker << ']' ); #else @@ -2341,7 +2248,6 @@ size *= nmemb; if ((ptr = internal_malloc(size, memblk_type_malloc CALL_ADDRESS LIBCWD_COMMA_TSD SAVEDMARKER))) memset(ptr, 0, size); - #ifdef DEBUGMAGICMALLOC if (ptr) { @@ -2350,10 +2256,7 @@ ((size_t*)(static_cast<char*>(ptr) + SIZE_PLUS_FOUR(size)))[-1] = MAGIC_MALLOC_END; } #endif - -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; -#endif + --__libcwd_tsd.inside_malloc_or_free; return ptr; } @@ -2369,12 +2272,11 @@ LIBCWD_TSD_DECLARATION #ifdef DEBUGDEBUGMALLOC // We can't use `assert' here, because that can call malloc. - if (__libcwd_tsd.recursive > __libcwd_tsd.library_call && !__libcwd_tsd.internal) + 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.recursive <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed."); + DEBUGDEBUGMALLOC_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(); } - ++__libcwd_tsd.recursive; #ifdef DEBUGDEBUGOUTPUT int saved_marker = ++__libcwd_tsd.marker; #endif @@ -2392,10 +2294,7 @@ #ifndef DEBUGMAGICMALLOC void* ptr1 = __libc_realloc(ptr, size); -#ifdef DEBUGDEBUGMALLOC DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_realloc': " << ptr1 << " [" << saved_marker << ']' ); - --__libcwd_tsd.recursive; -#endif // DEBUGDEBUGMALLOC return ptr1; #else // DEBUGMAGICMALLOC void* ptr1; @@ -2408,10 +2307,7 @@ if (size == 0) { __libc_free(ptr); -#ifdef DEBUGDEBUGMALLOC DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_realloc': NULL [" << saved_marker << ']' ); - --__libcwd_tsd.recursive; -#endif // DEBUGDEBUGMALLOC return NULL; } ptr1 = __libc_realloc(ptr, SIZE_PLUS_TWELVE(size)); @@ -2421,16 +2317,14 @@ ((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; -#ifdef DEBUGDEBUGMALLOC DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `__libcwd_realloc': " << static_cast<size_t*>(ptr1) + 2 << " [" << saved_marker << ']' ); - --__libcwd_tsd.recursive; -#endif // DEBUGDEBUGMALLOC return static_cast<size_t*>(ptr1) + 2; #endif // DEBUGMAGICMALLOC #endif // defined(DEBUGDEBUGMALLOC) || defined(DEBUGMAGICMALLOC) } // internal + ++__libcwd_tsd.inside_malloc_or_free; #if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) DoutInternal( dc_malloc|continued_cf, "realloc(" << ptr << ", " << size << ") = [" << saved_marker << ']' ); #else @@ -2449,10 +2343,7 @@ ((size_t*)(static_cast<char*>(mptr) + SIZE_PLUS_FOUR(size)))[-1] = MAGIC_MALLOC_END; } #endif - -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; -#endif + --__libcwd_tsd.inside_malloc_or_free; return mptr; } @@ -2493,15 +2384,15 @@ // again set a lock and again try to find the ptr in the memblk_map. // It might print "free" instead of "realloc", but the program is ill-formed // anyway in this case. -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; -#endif + --__libcwd_tsd.inside_malloc_or_free; internal_free(ptr, from_free LIBCWD_COMMA_TSD); + ++__libcwd_tsd.inside_malloc_or_free; #if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) DoutInternal( dc::finish, "NULL [" << saved_marker << ']' ); #else DoutInternal( dc::finish, "NULL" ); #endif + --__libcwd_tsd.inside_malloc_or_free; return NULL; } @@ -2537,9 +2428,7 @@ DoutInternal( dc::finish, "NULL" ); #endif DoutInternal( dc_malloc, "Out of memory! This is only a pre-detection!" ); -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; -#endif + --__libcwd_tsd.inside_malloc_or_free; return NULL; // A fatal error should occur directly after this } #ifdef DEBUGMAGICMALLOC @@ -2579,9 +2468,7 @@ #else DoutInternal( dc::finish, (void*)(mptr) ); #endif -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; -#endif + --__libcwd_tsd.inside_malloc_or_free; return mptr; } @@ -2597,12 +2484,11 @@ LIBCWD_TSD_DECLARATION #ifdef DEBUGDEBUGMALLOC // We can't use `assert' here, because that can call malloc. - if (__libcwd_tsd.recursive > __libcwd_tsd.library_call && !__libcwd_tsd.internal) + 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.recursive <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed."); + DEBUGDEBUGMALLOC_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(); } - ++__libcwd_tsd.recursive; #ifdef DEBUGDEBUGOUTPUT int saved_marker = ++__libcwd_tsd.marker; #endif @@ -2619,10 +2505,7 @@ void* ptr = __libc_malloc(size); if (!ptr) DoutFatalInternal( dc::core, "Out of memory in `operator new'" ); -#ifdef DEBUGDEBUGMALLOC DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `operator new': " << ptr << " [" << saved_marker << ']' ); - --__libcwd_tsd.recursive; -#endif // DEBUGDEBUGMALLOC return ptr; #else // DEBUGMAGICMALLOC void* ptr = __libc_malloc(SIZE_PLUS_TWELVE(size)); @@ -2631,16 +2514,14 @@ ((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; -#ifdef DEBUGDEBUGMALLOC DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `operator new': " << static_cast<size_t*>(ptr) + 2 << " [" << saved_marker << ']' ); - --__libcwd_tsd.recursive; -#endif // DEBUGDEBUGMALLOC return static_cast<size_t*>(ptr) + 2; #endif // DEBUGMAGICMALLOC #endif // defined(DEBUGDEBUGMALLOC) || defined(DEBUGMAGICMALLOC) } // internal + ++__libcwd_tsd.inside_malloc_or_free; #if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) DoutInternal( dc_malloc|continued_cf, "operator new (size = " << size << ") = [" << saved_marker << ']' ); #else @@ -2657,9 +2538,7 @@ ((size_t*)(static_cast<char*>(ptr) + SIZE_PLUS_FOUR(size)))[-1] = MAGIC_NEW_END; } #endif -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; -#endif + --__libcwd_tsd.inside_malloc_or_free; return ptr; } @@ -2668,12 +2547,11 @@ LIBCWD_TSD_DECLARATION #ifdef DEBUGDEBUGMALLOC // We can't use `assert' here, because that can call malloc. - if (__libcwd_tsd.recursive > __libcwd_tsd.library_call && !__libcwd_tsd.internal) + 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.recursive <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed."); + DEBUGDEBUGMALLOC_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(); } - ++__libcwd_tsd.recursive; #ifdef DEBUGDEBUGOUTPUT int saved_marker = ++__libcwd_tsd.marker; #endif @@ -2690,10 +2568,7 @@ void* ptr = __libc_malloc(size); if (!ptr) DoutFatalInternal( dc::core, "Out of memory in `operator new[]'" ); -#ifdef DEBUGDEBUGMALLOC DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `operator new[]': " << ptr << " [" << saved_marker << ']' ); - --__libcwd_tsd.recursive; -#endif // DEBUGDEBUGMALLOC return ptr; #else // DEBUGMAGICMALLOC void* ptr = __libc_malloc(SIZE_PLUS_TWELVE(size)); @@ -2702,16 +2577,14 @@ ((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; -#ifdef DEBUGDEBUGMALLOC DEBUGDEBUGMALLOC_CERR( "DEBUGDEBUGMALLOC: Internal: Leaving `operator new[]': " << static_cast<size_t*>(ptr) + 2 << " [" << saved_marker << ']' ); - --__libcwd_tsd.recursive; -#endif // DEBUGDEBUGMALLOC return static_cast<size_t*>(ptr) + 2; #endif // DEBUGMAGICMALLOC #endif // defined(DEBUGDEBUGMALLOC) || defined(DEBUGMAGICMALLOC) } // internal + ++__libcwd_tsd.inside_malloc_or_free; #if defined(DEBUGDEBUGMALLOC) && defined(DEBUGDEBUGOUTPUT) DoutInternal( dc_malloc|continued_cf, "operator new[] (size = " << size << ") = [" << saved_marker << ']' ); #else @@ -2728,9 +2601,7 @@ ((size_t*)(static_cast<char*>(ptr) + SIZE_PLUS_FOUR(size)))[-1] = MAGIC_NEW_ARRAY_END; } #endif -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; -#endif + --__libcwd_tsd.inside_malloc_or_free; return ptr; } @@ -2744,19 +2615,15 @@ LIBCWD_TSD_DECLARATION #ifdef DEBUGDEBUGMALLOC // We can't use `assert' here, because that can call malloc. - if (__libcwd_tsd.recursive > __libcwd_tsd.library_call && !__libcwd_tsd.internal) + 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.recursive <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed."); + DEBUGDEBUGMALLOC_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(); } - ++__libcwd_tsd.recursive; #endif #if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(DEBUGMALLOCEXTERNALCLINKAGE) LIBCWD_ASSERT( _private_::WST_ios_base_initialized || __libcwd_tsd.internal ); #endif -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; -#endif internal_free(ptr, from_delete LIBCWD_COMMA_TSD); } @@ -2765,22 +2632,18 @@ LIBCWD_TSD_DECLARATION #ifdef DEBUGDEBUGMALLOC // We can't use `assert' here, because that can call malloc. - if (__libcwd_tsd.recursive > __libcwd_tsd.library_call && !__libcwd_tsd.internal) + 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.recursive <= __libcwd_tsd.library_call || __libcwd_tsd.internal' failed."); + DEBUGDEBUGMALLOC_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(); } - ++__libcwd_tsd.recursive; #endif #if defined(DEBUGDEBUGMALLOC) && defined(__GLIBCPP__) && !defined(DEBUGMALLOCEXTERNALCLINKAGE) LIBCWD_ASSERT( _private_::WST_ios_base_initialized || __libcwd_tsd.internal ); #endif -#ifdef DEBUGDEBUGMALLOC - --__libcwd_tsd.recursive; -#endif internal_free(ptr, from_delete_array LIBCWD_COMMA_TSD); // Note that the standard demands that we call free(), and not delete(). - // This forces everyone to overload both, operator delete() and operator delete[]() - // and not only operator delete(). + // This forces everyone to overload both, operator delete() and operator + // delete[]() and not only operator delete(). } #endif /* DEBUGMALLOC */ Index: src/libcwd/elf32.cc diff -u src/libcwd/elf32.cc:1.36 src/libcwd/elf32.cc:1.37 --- src/libcwd/elf32.cc:1.36 Sat Feb 2 20:15:11 2002 +++ src/libcwd/elf32.cc Sat Feb 16 17:42:06 2002 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/elf32.cc,v 1.36 2002/02/03 04:15:11 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/elf32.cc,v 1.37 2002/02/17 01:42:06 libcw Exp $ // // Copyright (C) 2001, by // @@ -798,7 +798,11 @@ object_files_string_set_ct M_source_files; object_files_range_location_map_ct M_ranges; bool M_debug_info_loaded; +#ifndef LIBCWD_THREAD_SAFE bool M_inside_find_nearest_line; +#else + static pthread_t S_thread_inside_find_nearest_line; +#endif Elf32_Word M_stabs_section_index; Elf32_Word M_dwarf_debug_info_section_index; Elf32_Word M_dwarf_debug_abbrev_section_index; @@ -827,6 +831,10 @@ uint32_t elf_hash(unsigned char const* name, unsigned char delim) const; }; +#ifdef LIBCWD_THREAD_SAFE +pthread_t object_file_ct::S_thread_inside_find_nearest_line; +#endif + //------------------------------------------------------------------------------------------------------------------------------------------- void location_ct::M_store(void) @@ -1868,13 +1876,11 @@ void object_file_ct::find_nearest_line(asymbol_st const* symbol, Elf32_Addr offset, char const** file, char const** func, unsigned int* line) { - if (!M_debug_info_loaded) + while (!M_debug_info_loaded) // So we can use 'break'. { -#ifdef LIBCWD_THREAD_SAFE - // `object_files_string' and the STL containers using `_private_::object_files_allocator' in the - // following functions need this lock. - _private_::rwlock_tct<_private_::object_files_instance>::wrlock(); -#endif + // The call to load_dwarf()/load_stabs() below can call malloc, causing us to recursively enter this function + // for this object or another object_file_ct. +#ifndef LIBCWD_THREAD_SAFE if (M_inside_find_nearest_line) // Break loop caused by re-entry through a call to malloc. { *file = NULL; @@ -1883,6 +1889,29 @@ return; } M_inside_find_nearest_line = true; +#else + // `S_thread_inside_find_nearest_line' is only *changed* inside the critical area + // of `object_files_instance'. Therefore, when it is set to our thread id at + // this moment - then other threads can't change it. + if (pthread_equal(S_thread_inside_find_nearest_line, pthread_self())) + { + // This thread set the lock. Don't try to acquire it again... + *file = NULL; + *func = symbol->name; + *line = 0; + return; + } + // Ok, now we are sure that THIS thread doesn't hold the following lock, try to acquire it. + // `object_files_string' and the STL containers using `_private_::object_files_allocator' in the following functions need this lock. + _private_::rwlock_tct<_private_::object_files_instance>::wrlock(); + // Now we acquired the lock, check again if another thread not already read the debug info. + if (M_debug_info_loaded) + { + _private_::rwlock_tct<_private_::object_files_instance>::wrunlock(); + break; + } + S_thread_inside_find_nearest_line = pthread_self(); +#endif #if DEBUGSTABS || DEBUGDWARF libcw::debug::debug_ct::OnOffState state; Debug( libcw_do.force_on(state) ); @@ -1897,11 +1926,14 @@ Debug( dc::bfd.restore(state2) ); Debug( libcw_do.restore(state) ); #endif +#ifndef LIBCWD_THREAD_SAFE M_inside_find_nearest_line = false; -#ifdef LIBCWD_THREAD_SAFE +#else + S_thread_inside_find_nearest_line = (pthread_t) 0; _private_::rwlock_tct<_private_::object_files_instance>::wrunlock(); #endif M_input_stream.close(); + break; } range_st range; range.start = offset; @@ -1991,7 +2023,9 @@ if (DEBUGELF32) Debug( libcw_do.inc_indent(4) ); M_debug_info_loaded = false; +#ifndef LIBCWD_THREAD_SAFE M_inside_find_nearest_line = false; +#endif M_stabs_section_index = 0; M_dwarf_debug_line_section_index = 0; for(int i = 0; i < M_header.e_shnum; ++i) Index: src/libcwd/include/libcw/class_debug.h diff -u src/libcwd/include/libcw/class_debug.h:1.11 src/libcwd/include/libcw/class_debug.h:1.12 --- src/libcwd/include/libcw/class_debug.h:1.11 Tue Feb 12 19:55:26 2002 +++ src/libcwd/include/libcw/class_debug.h Sat Feb 16 17:42:07 2002 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_debug.h,v 1.11 2002/02/13 03:55:26 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_debug.h,v 1.12 2002/02/17 01:42:07 libcw Exp $ // // Copyright (C) 2000 - 2002, by // @@ -41,6 +41,19 @@ namespace libcw { namespace debug { +#ifdef DEBUGMALLOC +namespace _private_ { + +struct debug_message_st { + struct debug_message_st* next; + struct debug_message_st* prev; + int curlen; + char buf[sizeof(int)]; +}; + +} +#endif + //=================================================================================================== // class debug_ct // @@ -110,6 +123,14 @@ bool interactive; // Set true if the last or current debug output is to cerr +#ifdef DEBUGMALLOC +public: + _private_::debug_message_st* queue; + _private_::debug_message_st* queue_top; + // Queue of messages written inside malloc/realloc/calloc/free/new/delete. + // Locked by mutex provided through set_ostream. +#endif + public: /** \addtogroup group_formatting */ /** \{ */ @@ -189,7 +210,6 @@ // debug_ct(void); - ~debug_ct(); private: void private_set_ostream(std::ostream* os); Index: src/libcwd/include/libcw/private_struct_TSD.h diff -u src/libcwd/include/libcw/private_struct_TSD.h:1.7 src/libcwd/include/libcw/private_struct_TSD.h:1.8 --- src/libcwd/include/libcw/private_struct_TSD.h:1.7 Sat Feb 9 21:41:58 2002 +++ src/libcwd/include/libcw/private_struct_TSD.h Sat Feb 16 17:42:07 2002 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_struct_TSD.h,v 1.7 2002/02/10 05:41:58 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_struct_TSD.h,v 1.8 2002/02/17 01:42:07 libcw Exp $ // // Copyright (C) 2001, by // @@ -136,9 +136,9 @@ #ifdef DEBUGMALLOC int internal; int library_call; + int inside_malloc_or_free; // Set when entering a (de)allocation routine non-internal. #ifdef DEBUGDEBUGMALLOC int marker; - int recursive; // Used for sanity double checks in debugmalloc.cc. #endif #endif // DEBUGMALLOC bool recursive_fatal; // Detect loop involving dc::fatal or dc::core. Index: src/libcwd/include/sys.ho.in diff -u src/libcwd/include/sys.ho.in:1.8 src/libcwd/include/sys.ho.in:1.9 --- src/libcwd/include/sys.ho.in:1.8 Thu Feb 14 21:19:32 2002 +++ src/libcwd/include/sys.ho.in Sat Feb 16 17:42:07 2002 @@ -1,5 +1,5 @@ // @configure_input@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/sys.ho.in,v 1.8 2002/02/15 05:19:32 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/sys.ho.in,v 1.9 2002/02/17 01:42:07 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -15,6 +15,7 @@ #ifndef SYS_H #define SYS_H +#undef _GNU_SOURCE // Could be defined by g++ itself and redefined in ../config.h #include "../config.h" // Index: src/libcwd/testsuite/libcwd.tst/sys.h diff -u src/libcwd/testsuite/libcwd.tst/sys.h:1.4 src/libcwd/testsuite/libcwd.tst/sys.h:1.5 --- src/libcwd/testsuite/libcwd.tst/sys.h:1.4 Thu Feb 7 20:03:47 2002 +++ src/libcwd/testsuite/libcwd.tst/sys.h Sat Feb 16 17:42:07 2002 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/sys.h,v 1.4 2002/02/08 04:03:47 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/testsuite/libcwd.tst/sys.h,v 1.5 2002/02/17 01:42:07 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -19,6 +19,7 @@ #endif #include <libcw/sysd.h> +#undef _GNU_SOURCE #include "../../config.h" #ifdef HAVE__G_CONFIG_H #include <_G_config.h> ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2002-02-15 05:36:20
|
CVSROOT : /cvsroot/libcw Module : src Commit time: 2002-01-15 05:36:19 UTC Modified files: libcwd/INSTALL libcwd/acinclude.m4 libcwd/configure.in libcwd/debug.cc libcwd/documentation/doxygen.config Log message: Also use -O in maintainer mode. ---------------------- diff included ---------------------- Index: src/libcwd/INSTALL diff -u src/libcwd/INSTALL:1.24 src/libcwd/INSTALL:1.25 --- src/libcwd/INSTALL:1.24 Sat Feb 9 18:42:16 2002 +++ src/libcwd/INSTALL Thu Feb 14 21:36:09 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.16 was tested with gcc-2.95.x, gcc-2.96-98 (RedHat) +libcwd-0.99.17 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.16.tar.gz +tar xzf libcwd-0.99.17.tar.gz mkdir libcwd-objdir cd libcwd-objdir -../libcwd-0.99.16/configure --prefix=/usr +../libcwd-0.99.17/configure --prefix=/usr make su make install Index: src/libcwd/acinclude.m4 diff -u src/libcwd/acinclude.m4:1.48 src/libcwd/acinclude.m4:1.49 --- src/libcwd/acinclude.m4:1.48 Fri Jan 18 21:08:54 2002 +++ src/libcwd/acinclude.m4 Thu Feb 14 21:36:09 2002 @@ -885,7 +885,7 @@ dnl Other options if test "$USE_MAINTAINER_MODE" = yes; then -EXTRAOPTS="" +EXTRAOPTS="-O" DEBUGOPTS="-ggdb3" else EXTRAOPTS="-O" Index: src/libcwd/configure.in diff -u src/libcwd/configure.in:1.104 src/libcwd/configure.in:1.105 --- src/libcwd/configure.in:1.104 Thu Feb 14 21:19:32 2002 +++ src/libcwd/configure.in Thu Feb 14 21:36:09 2002 @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_REVISION($Revision: 1.104 $)dnl +AC_REVISION($Revision: 1.105 $)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=16 +INTERFACE_VERSION_REVISION=17 INTERFACE_AGE=99 dnl 0.99 actually VERSION_MAJOR=`expr $INTERFACE_VERSION - $INTERFACE_AGE` Index: src/libcwd/debug.cc diff -u src/libcwd/debug.cc:1.69 src/libcwd/debug.cc:1.70 --- src/libcwd/debug.cc:1.69 Tue Feb 12 20:03:56 2002 +++ src/libcwd/debug.cc Thu Feb 14 21:36:09 2002 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.69 2002/02/13 04:03:56 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.70 2002/02/15 05:36:09 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -685,13 +685,14 @@ // Try to get the lock, but don't try too long... int res; struct timespec const t = { 0, 5000000 }; - for(int count = 0; count < 40; ++count) + int count = 0; + do { - res = debug_object.M_mutex->trylock(); - if (res == 0) + if (!(res = debug_object.M_mutex->trylock())) break; nanosleep(&t, NULL); } + while(++count < 40); #endif target_os->put('\n'); #ifdef LIBCWD_THREAD_SAFE Index: src/libcwd/documentation/doxygen.config diff -u src/libcwd/documentation/doxygen.config:1.3 src/libcwd/documentation/doxygen.config:1.4 --- src/libcwd/documentation/doxygen.config:1.3 Sat Feb 9 18:42:16 2002 +++ src/libcwd/documentation/doxygen.config Thu Feb 14 21:36:09 2002 @@ -4,7 +4,7 @@ # General configuration options #--------------------------------------------------------------------------- PROJECT_NAME = libcwd -PROJECT_NUMBER = "libcwd 0.99.16" +PROJECT_NUMBER = "libcwd 0.99.17" OUTPUT_DIRECTORY = OUTPUT_LANGUAGE = English EXTRACT_ALL = NO ----------------------- End of diff ----------------------- |