From: Carlo W. <li...@us...> - 2001-11-06 09:04:18
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-10-06 02:54:18 UTC Modified files: Tag: branch-threading libcwd/example-project/Makefile.am libcwd/example-project/configure.in Added files: Tag: branch-threading libcwd/example-project/debug.h.maintainer Removed files: Tag: branch-threading libcwd/example-project/debug.h libcwd/example-project/maintMakefile.in Log message: Work in progress: Moving nodebug.h contents from include/libcw/debug.h to nodebug.h. These contents will now be put inside the example-project/debug.h file directly. ---------------------- diff included ---------------------- Index: src/libcwd/example-project/Makefile.am diff -u src/libcwd/example-project/Makefile.am:1.1 src/libcwd/example-project/Makefile.am:1.1.2.1 --- src/libcwd/example-project/Makefile.am:1.1 Mon Sep 11 12:39:38 2000 +++ src/libcwd/example-project/Makefile.am Mon Nov 5 18:54:08 2001 @@ -3,15 +3,11 @@ AUTOMAKE_OPTIONS = foreign bin_PROGRAMS = program -program_SOURCES = debug.cc program.cc -include_HEADERS = debug.h sys.h@MAINTAINER_MODE_FALSE@ nodebug.h -BUILT_SOURCES =@MAINTAINER_MODE_TRUE@ nodebug.h -EXTRA_DIST =@MAINTAINER_MODE_TRUE@ nodebug.h +include_HEADERS = debug.h sys.h +program_SOURCES = debug.cc program.cc # --------------- Maintainer's Section MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure stamp-h.in Makefile.in install-sh missing mkinstalldirs - -@MAINTAINER_MODE_TRUE@include maintMakefile Index: src/libcwd/example-project/configure.in diff -u src/libcwd/example-project/configure.in:1.6 src/libcwd/example-project/configure.in:1.6.2.1 --- src/libcwd/example-project/configure.in:1.6 Sun Aug 19 19:03:26 2001 +++ src/libcwd/example-project/configure.in Mon Nov 5 18:54:08 2001 @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_REVISION($Revision: 1.6 $)dnl +AC_REVISION($Revision: 1.6.2.1 $)dnl dnl General initialization of `autoconf' variables. dnl Ensure that the directory specified with --srcdir was correct @@ -49,5 +49,5 @@ fi dnl Generate output files. -AC_OUTPUT([Makefile maintMakefile]) +AC_OUTPUT([Makefile]) Index: src/libcwd/example-project/debug.h diff -u src/libcwd/example-project/debug.h:1.3.2.1 src/libcwd/example-project/debug.h:removed --- src/libcwd/example-project/debug.h:1.3.2.1 Thu Sep 27 18:13:57 2001 +++ src/libcwd/example-project/debug.h Mon Nov 5 18:54:18 2001 @@ -1,30 +0,0 @@ -#ifndef DEBUG_H -#define DEBUG_H - -#ifndef CWDEBUG -#include "nodebug.h" - -#else // CWDEBUG - -#ifndef DEBUGCHANNELS -#define DEBUGCHANNELS ::myproject::debug::channels -#endif -#include <libcw/debug.h> - -namespace myproject { - namespace debug { - namespace channels { - namespace dc { - using namespace ::libcw::debug::channels::dc; - - // Add new debug channels here. - extern ::libcw::debug::channel_ct custom; - - } - } - } -} - -#endif // CWDEBUG - -#endif // DEBUG_H Index: src/libcwd/example-project/debug.h.maintainer diff -u /dev/null src/libcwd/example-project/debug.h.maintainer:1.1.2.1 --- /dev/null Mon Nov 5 18:54:18 2001 +++ src/libcwd/example-project/debug.h.maintainer Mon Nov 5 18:54:08 2001 @@ -0,0 +1,36 @@ +#ifndef DEBUG_H +#define DEBUG_H + +#ifndef CWDEBUG + +@NODEBUGMACROS@ + +#else // CWDEBUG + +#ifndef DEBUGCHANNELS +// This must be defined before <libcw/debug.h> is included and must be the +// name of the namespace containing your `dc' namespace (see below). +// You can use any namespace(s) you like, except existing namespaces +// (like ::, ::std and ::libcw). +#define DEBUGCHANNELS ::myproject::debug::channels +#endif +#include <libcw/debug.h> + +namespace myproject { + namespace debug { + namespace channels { + namespace dc { + using namespace ::libcw::debug::channels::dc; + + // Add the declaration of new debug channels here + // and their definition in a custom debug.cc file. + extern ::libcw::debug::channel_ct custom; + + } // namespace dc + } // namespace DEBUGCHANNELS + } +} + +#endif // CWDEBUG + +#endif // DEBUG_H Index: src/libcwd/example-project/maintMakefile.in diff -u src/libcwd/example-project/maintMakefile.in:1.6.2.1 src/libcwd/example-project/maintMakefile.in:removed --- src/libcwd/example-project/maintMakefile.in:1.6.2.1 Thu Oct 11 21:15:50 2001 +++ src/libcwd/example-project/maintMakefile.in Mon Nov 5 18:54:18 2001 @@ -1,21 +0,0 @@ -# $Id: maintMakefile.in,v 1.6.2.1 2001/10/12 04:15:50 libcw Exp $ -# -# Maintainers Makefile, a makefile with maintainer rules. -# -# This makefile is only used when --enable-maintainer-mode was passed to -# configure. The targets in this file are used to generate files that -# might require special tools (or like in the case of nodebug.h, -# need the header files of libcwd to be installed). These generated -# files are put into the distribution so that ordinairy users don't need -# to generate them. - -CPPFLAGS=@CPPFLAGS@ - -nodebug.h: maintMakefile macrotest.cc debug.h - g++ -dM -E $(CPPFLAGS) macrotest.cc | sed -e 's/#define \([^ ]*\).*/#undef \1/' > phase1.h - g++ -dM -E $(CPPFLAGS) -DPHASE2 macrotest.cc 2>/dev/null | egrep -v '(#define __|_H *$$|DEBUG|LIBCWD_)' | sort > nodebug.h - rm -f phase1.h - -# See the maintMakefile.in in the libcwd distribution for more -# interesting ideas. - ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-11-14 03:01:19
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-10-14 03:01:18 UTC Modified files: Tag: branch-threading libcwd/INSTALL libcwd/Makefile.am libcwd/acinclude.m4 libcwd/bfd.cc libcwd/configure.in libcwd/debug.cc libcwd/debugmalloc.cc libcwd/maintMakefile.in libcwd/documentation/doxygen.config libcwd/documentation/html.footer libcwd/documentation/scripts/load_style_sheets.js libcwd/documentation/styles/main.css libcwd/example-project/.cvsignore libcwd/example-project/debug.cc libcwd/example-project/sys.h libcwd/include/libcw/class_channel.h libcwd/include/libcw/class_debug.h libcwd/include/libcw/control_flag.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/macro_ForAllDebugChannels.h libcwd/include/libcw/macro_ForAllDebugObjects.h Added files: Tag: branch-threading libcwd/nodebug.h libcwd/documentation/Makefile libcwd/documentation/custom-debug.h.dox libcwd/documentation/custom_do.dox libcwd/documentation/downloading.dox libcwd/documentation/mainpage.dox libcwd/documentation/namespaces.dox libcwd/documentation/nested.dox libcwd/documentation/preparation.dox libcwd/documentation/reference.dox libcwd/documentation/external/.cvsignore libcwd/documentation/styles/ns4/main.css libcwd/documentation/styles/ns4/linux/main.css libcwd/documentation/styles/ns5/main.css Removed files: Tag: branch-threading libcwd/README.nodebug.h libcwd/documentation/custom-debug.h.doc libcwd/documentation/mainpage.doc libcwd/documentation/namespaces.doc Log message: Work in progress. Moving documentation into the source tree and using doxygen. Synchronizing source tree with Eric. ---------------------- diff included ---------------------- Index: src/libcwd/INSTALL diff -u src/libcwd/INSTALL:1.20.2.1 src/libcwd/INSTALL:1.20.2.2 --- src/libcwd/INSTALL:1.20.2.1 Sun Sep 23 10:07:45 2001 +++ src/libcwd/INSTALL Tue Nov 13 19:01:06 2001 @@ -26,7 +26,7 @@ i) The GNU compiler, version 2.95.1 or higher. Location: gnu/gcc/ - Current version: 3.0 + Current version: 3.0.2 Alternatively you can install only ia) gnu/gcc/gcc-core-<version>.tar.gz and @@ -54,8 +54,8 @@ Don't delete those libraries if you have them though since existing binaries might need to link with them. - libcwd-0.99.15 was tested with gcc-2.95.x, gcc-2.96-97 (RedHat), - gcc-3.0 and gcc-3.0.1. + libcwd-0.99.16 was tested with gcc-2.95.x, gcc-2.96-97 (RedHat) + and gcc-3.0.x. Packages needed to run the testsuite ------------------------------------ @@ -91,6 +91,13 @@ Each of those can be downloaded from your local GNU site. + Moreover, in order to generate the documentation, you need to + have the following installed: + + ix) GNU grep version 2.4.2 is known to work. + x) doxygen http://www.doxygen.org/ + xi) graphviz http://www.research.att.com/sw/tools/graphviz/ + Hackers info ============ @@ -102,13 +109,13 @@ There is no reason to use libcwd's feature options (--disable-libcwd-alloc, --disable-libcwd-magic, --disable-libcwd-marker and --disable-libcwd-location). -Actually, I forgot why they are there :). You can read more about what -they do in Chapter 4 "Debugging compile options" here: -http://libcw.sourceforge.net/templates/index.html?debugging +Actually, I forgot why they are there :). You can read more about the +configuration options and what they do in include/libcw/debug_config.h. + If you want to change Makefile.am files and the-like then you'll need to use --enable-maintainer-mode. If you enable maintainer-mode then you -will need GNU make, other make won't work (you also need a lot of other -extra tools installed on your system). +will need GNU make, other make won't work (you also need a LOT of other +extra tools installed on your system, only for the brave thus). -=ii=- @@ -124,7 +131,7 @@ -=iii=- If you don't have an ELF32 system and therefore need to link with libbfd, then you -can configure using --enable-libcwd-bfd. If libiberty.a or libbfd.so are in an +can configure using --enable-libcwd-libbfd. If libiberty.a or libbfd.so are in an unusual directory, then you will have to set LDFLAGS prior to running ./configure: LDFLAGS="-L/usr/gnu/lib" CPPFLAGS="-I/usr/gnu/include" ./configure @@ -150,22 +157,29 @@ make clean make distclean -If you feel brave you might even want to try +If you configured with --enable-maintainer-mode then the following +targets exist as well: -make dist -make maintainer-clean +make dist // Create tar ball +make maintainer-clean // Erase everything that was generated somehow +make check // Run test suite +make tar // Create tar ball +make rpm // Create rpms +make ChangeLog // Generate ChangeLog from cvs database +make CC="gcc-3.0.2" CXX="g++-3.0.2" reconfig // Switch compilers keeping the same configuration +make full-check // Iterate over all configurations and all compiler versions -well, ... heh. Look in the Makefile for more targets ;) +It is not garanteed that these work on another machine then mine however. -=v=- Finally, you can also build libcwd in a different directory than the source tree is in: -tar xzf libcwd-0.99.15.tar.gz +tar xzf libcwd-0.99.16.tar.gz mkdir libcwd-objdir cd libcwd-objdir -../libcwd-0.99.15/configure --prefix=/usr +../libcwd-0.99.16/configure --prefix=/usr make su make install Index: src/libcwd/Makefile.am diff -u src/libcwd/Makefile.am:1.30.2.11 src/libcwd/Makefile.am:1.30.2.12 --- src/libcwd/Makefile.am:1.30.2.11 Tue Oct 23 07:17:08 2001 +++ src/libcwd/Makefile.am Tue Nov 13 19:01:06 2001 @@ -4,8 +4,8 @@ SUBDIRS = include utils . tests testsuite -BUILT_SOURCES =@MAINTAINER_MODE_TRUE@ libcwd.lsm libcwd.spec nodebug.h -EXTRA_DIST = LICENSE.QPL README.FreeBSD README.openbsd README.nodebug.h $(BUILT_SOURCES) +BUILT_SOURCES =@MAINTAINER_MODE_TRUE@ libcwd.lsm libcwd.spec +EXTRA_DIST = LICENSE.QPL README.FreeBSD README.openbsd nodebug.h $(BUILT_SOURCES) DISTCLEANFILES = libcwd-@VERSION@.tar.gz VERSIONINFO=@VERSIONINFO@ @@ -39,6 +39,8 @@ for i in `grep '^/' $(srcdir)/example-project/CVS/Entries | cut -d/ -f2`; do \ cp -p $(srcdir)/example-project/$$i $(distdir)/example-project; \ done + rm $(distdir)/example-project/debug.h.maintainer + cp -p $(srcdir)/example-project/debug.h $(distdir)/example-project chmod +x $(distdir)/install-sh mkdir $(distdir)/debian for i in `grep '^/' $(srcdir)/debian/CVS/Entries | cut -d/ -f2`; do \ Index: src/libcwd/README.nodebug.h diff -u src/libcwd/README.nodebug.h:1.1 src/libcwd/README.nodebug.h:removed --- src/libcwd/README.nodebug.h:1.1 Wed Jul 25 19:10:39 2001 +++ src/libcwd/README.nodebug.h Tue Nov 13 19:01:18 2001 @@ -1,7 +0,0 @@ -In order to make it possible that others compile your application without -having libcwd installed, the file nodebug.h must be part of the distribution -of your application and should be included instead of <libcw/debug.h> -when CWDEBUG is not defined. - -For an example of how to do this, see the example-project directory. - Index: src/libcwd/acinclude.m4 diff -u src/libcwd/acinclude.m4:1.41.2.7 src/libcwd/acinclude.m4:1.41.2.8 --- src/libcwd/acinclude.m4:1.41.2.7 Sat Oct 27 16:21:05 2001 +++ src/libcwd/acinclude.m4 Tue Nov 13 19:01:06 2001 @@ -161,12 +161,11 @@ dnl CW_DEFINE_TYPE(NEWTYPE, OLDTYPE) dnl -dnl Add `typedef OLDTYPE NEWTYPE' to the output variable CW_TYPEDEFS +dnl Add `typedef OLDTYPE NEWTYPE;' to the output variable CW_TYPEDEFS dnl AC_DEFUN(CW_DEFINE_TYPE, [AC_REQUIRE([CW_DEFINE_TYPE_INITIALIZATION]) -CW_TYPEDEFS="$CW_TYPEDEFS\\ -typedef $2 $1;" +CW_TYPEDEFS="typedef $2 $1; $CW_TYPEDEFS" ]) dnl CW_TYPE_EXTRACT_FROM(FUNCTION, INIT, ARGUMENTS, ARGUMENT) Index: src/libcwd/bfd.cc diff -u src/libcwd/bfd.cc:1.85.2.27 src/libcwd/bfd.cc:1.85.2.28 --- src/libcwd/bfd.cc:1.85.2.27 Sun Oct 21 09:02:48 2001 +++ src/libcwd/bfd.cc Tue Nov 13 19:01:06 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.85.2.27 2001/10/21 16:02:48 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.85.2.28 2001/11/14 03:01:06 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -96,7 +96,13 @@ // New debug channel namespace channels { namespace dc { + /** /addtogroup default_dc */ + /* \{ */ + + /** The BFD channel. */ channel_ct bfd("BFD"); + + /** \} */ } } Index: src/libcwd/configure.in diff -u src/libcwd/configure.in:1.81.2.11 src/libcwd/configure.in:1.81.2.12 --- src/libcwd/configure.in:1.81.2.11 Sun Oct 21 16:29:28 2001 +++ src/libcwd/configure.in Tue Nov 13 19:01:06 2001 @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_REVISION($Revision: 1.81.2.11 $)dnl +AC_REVISION($Revision: 1.81.2.12 $)dnl dnl General intialization of `autoconf' varaibles. dnl Ensure that the directory specified with --srcdir was correct @@ -35,6 +35,11 @@ dnl Libtool version info VERSIONINFO="$INTERFACE_VERSION:$INTERFACE_VERSION_REVISION:$INTERFACE_AGE" AC_SUBST(VERSIONINFO) + +dnl For version code used in check_configuration(). +AC_SUBST(VERSION_MAJOR) +AC_SUBST(VERSION_MINOR) +AC_SUBST(VERSION_REVISION) dnl Set a decent default value in case we don't have the right libraries case "$host" in Index: src/libcwd/debug.cc diff -u src/libcwd/debug.cc:1.46.2.36 src/libcwd/debug.cc:1.46.2.37 --- src/libcwd/debug.cc:1.46.2.36 Fri Oct 26 15:58:03 2001 +++ src/libcwd/debug.cc Tue Nov 13 19:01:06 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.46.2.36 2001/10/26 22:58:03 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.46.2.37 2001/11/14 03:01:06 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -140,14 +140,19 @@ DoutFatal(dc::fatal, "check_configuration: This version of libcwd was compiled with a different configuration than is currently used in libcw/debug_config.h!"); } + void version_check_failed(void) + { + DoutFatal(dc::fatal, "check_configuration: This version of libcwd does not match the version of libcw/debug_config.h! Are your paths correct?"); + } + /** * \brief The default %debug stream object. * - * Detailed description here. + * The %debug object that is used by default by Dout and DoutFatal, the only %debug object used by libcwd itself. + * \sa \ref custom_do */ - debug_ct libcw_do; // The Debug Object that is used by default by Dout(), the only debug object used - // by libcw itself. + debug_ct libcw_do; namespace { unsigned short int WST_max_len = 8; // The length of the longest label. Is adjusted automatically @@ -156,17 +161,96 @@ namespace channels { namespace dc { - channel_ct debug("DEBUG"); - channel_ct notice("NOTICE"); - channel_ct warning("WARNING"); - channel_ct system("SYSTEM"); - channel_ct malloc("MALLOC"); - continued_channel_ct continued(continued_maskbit); - continued_channel_ct finish(finish_maskbit); + /** \defgroup default_dc Pre-defined debug channels + * + * These are the default %debug %channels pre-defined in libcwd. + */ + + /** \{ */ + + /** The DEBUG channel. */ + channel_ct debug +#ifndef HIDE_FROM_DOXYGEN + ("DEBUG") +#endif + ; + + /** The NOTICE channel. */ + channel_ct notice +#ifndef HIDE_FROM_DOXYGEN + ("NOTICE") +#endif + ; + + /** The SYSTEM channel. */ + channel_ct system +#ifndef HIDE_FROM_DOXYGEN + ("SYSTEM") +#endif + ; + + /** The MALLOC channel. */ + channel_ct malloc +#ifndef HIDE_FROM_DOXYGEN + ("MALLOC") +#endif + ; + + /** The WARNING channel. + * + * This is the only channel that + * is turned on by default. + */ + channel_ct warning +#ifndef HIDE_FROM_DOXYGEN + ("WARNING") +#endif + ; + + /** A special channel to continue to + * write a previous %debug channel. + * + * \sa \ref using_continued + */ + continued_channel_ct continued +#ifndef HIDE_FROM_DOXYGEN + (continued_maskbit) +#endif + ; + + /** A special channel to finish writing + * <EM>%continued</EM> %debug output. + * + * \sa \ref using_continued + */ + continued_channel_ct finish +#ifndef HIDE_FROM_DOXYGEN + (finish_maskbit) +#endif + ; + + /** The special FATAL channel. + * + * \sa DoutFatal + */ + fatal_channel_ct fatal +#ifndef HIDE_FROM_DOXYGEN + ("FATAL", fatal_maskbit) +#endif + ; + + /** The special COREDUMP channel. + * + * \sa DoutFatal + */ + fatal_channel_ct core +#ifndef HIDE_FROM_DOXYGEN + ("COREDUMP", coredump_maskbit) +#endif + ; - fatal_channel_ct fatal("FATAL", fatal_maskbit); - fatal_channel_ct core("COREDUMP", coredump_maskbit); + /** \} */ } } @@ -888,8 +972,8 @@ * \brief Find %debug channel with label \a label. * * \return A pointer to the %debug channel object whose name starts with \a label. - * If there is more than one such %debug %channel, the object with the lexicographically - * largest name is returned. When no %debug channel could be found, NULL is returned. + * If there is more than one such %debug %channel, the object with the lexicographically + * largest name is returned. When no %debug channel could be found, NULL is returned. */ channel_ct* find_channel(char const* label) { @@ -906,15 +990,33 @@ return tmp; } - /** - * \brief Write a list of all %debug %channels to the %debug object \a debug_object. + /** \interface list_channels_on debug.h libcw/debug.h + * + * \brief List all %debug %channels to a given %debug stream object. * * \par Example: * \n * * \code - * Dout( list_channels_on(libcw_do) ); // libcw_do is the (default) debug object of libcwd. + * Dout( list_channels_on(libcw_do) ); // libcw_do is the (default) debug stream object of libcwd. * \endcode + * + * Example of output: + * + * \exampleoutput <PRE> + * DEBUG : Disabled + * NOTICE : Enabled + * WARNING : Enabled + * SYSTEM : Enabled + * MALLOC : Disabled + * LLISTS : Disabled + * KERNEL : Disabled + * IO : Disabled + * FOO : Enabled + * BAR : Enabled</PRE> + * \endexampleoutput + * + * Where FOO and BAR are \link preparation user defined channels \endlink in this example. */ void list_channels_on(debug_ct const& debug_object) { @@ -1155,20 +1257,24 @@ " : Use dc::core or dc::fatal together with DoutFatal."); } - void _private_::assert_fail(char const* expr, char const* file, int line, char const* function) - { -#ifdef DEBUGDEBUGMALLOC - LIBCWD_TSD_DECLARATION - if (__libcwd_tsd.recursive) + namespace _private_ { + + void assert_fail(char const* expr, char const* file, int line, char const* function) { - set_alloc_checking_off(LIBCWD_TSD); - FATALDEBUGDEBUG_CERR(file << ':' << line << ": " << function << ": Assertion `" << expr << "' failed.\n"); - set_alloc_checking_on(LIBCWD_TSD); - core_dump(); - } +#ifdef DEBUGDEBUGMALLOC + LIBCWD_TSD_DECLARATION + if (__libcwd_tsd.recursive) + { + set_alloc_checking_off(LIBCWD_TSD); + FATALDEBUGDEBUG_CERR(file << ':' << line << ": " << function << ": Assertion `" << expr << "' failed.\n"); + set_alloc_checking_on(LIBCWD_TSD); + core_dump(); + } #endif - DoutFatal(dc::core, file << ':' << line << ": " << function << ": Assertion `" << expr << "' failed.\n"); - } + DoutFatal(dc::core, file << ':' << line << ": " << function << ": Assertion `" << expr << "' failed.\n"); + } + + } // namespace _private_ } // namespace debug } // namespace libcw Index: src/libcwd/debugmalloc.cc diff -u src/libcwd/debugmalloc.cc:1.61.2.41 src/libcwd/debugmalloc.cc:1.61.2.42 --- src/libcwd/debugmalloc.cc:1.61.2.41 Sat Oct 27 17:18:00 2001 +++ src/libcwd/debugmalloc.cc Tue Nov 13 19:01:06 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.61.2.41 2001/10/28 00:18:00 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.61.2.42 2001/11/14 03:01:06 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -129,7 +129,7 @@ #undef private #endif // LIBCWD_THREAD_SAFE -#ifdef DEBUGMALLOC +#if defined(DEBUGMALLOC) || defined(LIBCW_DOXYGEN) #include <cstring> #include <string> @@ -1544,6 +1544,20 @@ return o; } +/** \interface list_allocations_on debug.h libcw/debug.h + * + * \brief List all current allocations to a given %debug stream object. + * + * \par Example: + * \n + * + * \code + * Debug( list_allocations_on(libcw_do) ); // libcw_do is the (default) debug stream object of libcwd. + * \endcode + * + * output example here... + * + */ void list_allocations_on(debug_ct& debug_object) { #ifdef DEBUGDEBUGMALLOC @@ -1605,6 +1619,24 @@ __libcwd_tsd.internal = 0; } +/** \interface make_all_allocations_invisible_except debug.h libcw/debug.h + * + * \brief Make all current allocations invisible except the given pointer. + * + * All allocations, except the given pointer, are made invisible; they won't show up + * anymore in the \link list_allocations_on Memory Allocation Overview \endlink. + * + * If you want to make \em all allocations invisible, just pass \c NULL as parameter. + * + * \par Example: + * \n + * + * \code + * Debug( make_all_allocations_invisible_except(NULL) ); + * \endcode + * + * \sa list_allocations_on + */ void make_all_allocations_invisible_except(void const* ptr) { LIBCWD_TSD_DECLARATION Index: src/libcwd/documentation/Makefile diff -u /dev/null src/libcwd/documentation/Makefile:1.1.2.1 --- /dev/null Tue Nov 13 19:01:18 2001 +++ src/libcwd/documentation/Makefile Tue Nov 13 19:01:07 2001 @@ -0,0 +1,22 @@ +include doxygen.config +INPUT_FILES=$(shell for i in $(INPUT); do if test -f $$i; then echo $$i; else for j in $(FILE_PATTERNS); do ls $$i/$$j; done; fi done) +EXAMPLE_FILES=$(shell find doxygen-examples -mindepth 1 -maxdepth 1 -type f -print) + +.PHONY: html external + +html: external + doxygen doxygen.config + +external: external/INSTALL external/sys.h external/debug.h external/debug.cc + +external/INSTALL: ../INSTALL + cp ../INSTALL external/INSTALL + +external/sys.h: ../example-project/sys.h + cp ../example-project/sys.h external/sys.h + +external/debug.h: ../example-project/debug.h + cp ../example-project/debug.h external/debug.h + +external/debug.cc: ../example-project/debug.cc + cp ../example-project/debug.cc external/debug.cc Index: src/libcwd/documentation/custom-debug.h.doc diff -u src/libcwd/documentation/custom-debug.h.doc:1.1.2.1 src/libcwd/documentation/custom-debug.h.doc:removed --- src/libcwd/documentation/custom-debug.h.doc:1.1.2.1 Fri Oct 26 15:58:03 2001 +++ src/libcwd/documentation/custom-debug.h.doc Tue Nov 13 19:01:18 2001 @@ -1,171 +0,0 @@ -// Work around for bug in doxygen. -#define debug somethingelse - -/** \page custom_debug_h The Custom debug.h file - * - * This page describes how you can use custom debug channels in a safe and flexible way. - * It involves: creating a new header file for your application "%debug.h" and including - * that header file in all your source files. New channels are declared in this custom - * header file. - * - * \section debug_channels_and_namespace Debug channels and namespace - * - * \subsection applications Applications - * - * User applications have less strict requirements than libraries, because nobody else will link with it. - * The developer of an application directly controls and checks and resolves name collisions when needed. - * If you are writing an end-application then you are still urged to create a header file - * called %debug.h and use \em that in your source files, instead of including <libcw/debug.h> directly. - * You will benefit greatly from this in terms on flexibility (trust me). - * - * Here is a template %debug.h to get you started: - * - * \code - * #ifndef MY_DEBUG_H - * #define MY_DEBUG_H - * - * #ifndef CWDEBUG - * #include "nodebug.h" - * #else // CWDEBUG - * - * // Define the namespace where you will put your debug channels. - * // This can be any arbitrary namespace. - * #define DEBUGCHANNELS debug_channels - * #include <libcw/debug.h> - * - * namespace debug_channels { // This is namespace DEBUGCHANNELS - * namespace dc { - * using namespace libcw::debug::channels::dc; - * - * // Add custom debug channels here. - * extern libcw::debug::channel_ct my_own_channel; - * - * } - * } - * - * #endif // CWDEBUG - * #endif // MY_DEBUG_H - * \endcode - * - * In the above you can replace <CODE>##include "nodebug.h" </CODE> by the contents of - * the nodebug.h file that is distributed with libcwd. It just defines all macros as empty - * so that your code will still compile on hosts that do not have libcwd installed. - * - * \subsection libraries Libraries - * - * Libraries that use libcwd should not put their debug channels in libcw::debug::channels::dc. The correct way to declare - * new debug channels is by putting them in a namespace of the library and providing new macros for writing debug output. Also end - * applications will benefit by using this method (in terms of flexibility). - * - * The following code would define a debug channel \c warp in the namespace \c libexample: - * - * \code - * namespace libexample { - * namespace channels { - * namespace dc { - * ::libcw::debug::channel_ct warp("WARP"); - * } - * } - * } - * \endcode - * - * Then provide a debug header file (%debug.h) with the following: - * - * \code - * #ifndef LIBEXAMPLE_DEBUG_H - * #define LIBEXAMPLE_DEBUG_H - * - * #ifndef DEBUGCHANNELS - * #define DEBUGCHANNELS ::libexample::channels - * #endif - * #include <libcw/debug.h> - * - * namespace libexample { - * namespace channels { - * namespace dc { - * using namespace libcw::debug::channels::dc; - * extern libcw::debug::channel_ct warp; - * } - * } - * } - * - * // Define private debug output macros for use in header files of the library, - * // there is no reason to do this for normal applications. - * #ifdef CWDEBUG - * #define LibExampleDout(cntrl, data) \ - * LibcwDout(libexample::channels, libcw::debug::libcw_do, cntrl, data) - * #define LibExampleDoutFatal(cntrl, data) \ - * LibcwDoutFatal(libexample::channels, libcw::debug::libcw_do, cntrl, data) - * #else - * #define LibExampleDout(cntrl, data) - * #define LibExampleDoutFatal(cntrl, data) LibcwDoutFatal(::std, , cntrl, data) - * #endif - * - * #endif // LIBEXAMPLE_DEBUG_H - * \endcode - * - * This will make your debug channels available in the usual way (by using Dout and friends. LibExampleDout and friends are only - * for use in the header files of `libexample' itself) avoiding any linker name collisions. - * - * \subsection header_files_of_libraries Header files of libraries - * - * Don't use Dout etc. in header files of libraries, instead use (for example) LibExampleDout etc., as shown above. It is advisable not - * to include any %debug.h in your headerfiles. Instead, add the following lines to each header file that needs debugging: - * - * \code - * #ifndef LIBEXAMPLE_DEBUG_H - * #error "You need to include the appropriate debug.h in the source file, before including this header file." - * #endif - * \endcode - * - * Don't use "libexample/%debug.h" in this error message because someone else might write a library that is using your library and needs - * a different %debug.h to be included in end applications. - * - * \subsection debug_channel_name_collisions Debug channel name collisions - * - * The reason that libcwd uses the convention to put debug channels in the namespace dc is to avoid collisions between debug channel - * names of libraries. There are two types of name collisions possible: you upgrade or start to use a library which uses a debug channel - * that you had already defined, in that case you might need to change the name of your own channel, or you link with two or more - * libraries that both use libcwd and that defined the same debug channel, in that case you will have to make your own debug - * namespace as shown above and choose a new name for one of the channels. - * - * For example, suppose you link with two libraries: lib1 and lib2 who use the above convention and defined their own namespaces called - * lib1 and lib2, but both defined a debug channel called foobar. Then you can rename these channels as follows. Make a debug - * header file that contains: - * - * \code - * #ifndef DEBUGCHANNELS - * #define DEBUGCHANNELS ::application::channels - * #endif - * #include <lib1/debug.h> - * #include <lib2/debug.h> - * namespace application { - * namespace channels { - * namespace dc { - * using namespace ::lib1::channels::dc; - * using namespace ::lib2::channels::dc; - * static libcw::debug::channel_ct& foobar1(::lib1::channels::dc::foobar) __attribute__ ((unused)); - * static libcw::debug::channel_ct& foobar2(::lib2::channels::dc::foobar) __attribute__ ((unused)); - * } - * } - * } - * \endcode - * - * \htmlonly - * <DIV class="normal"> - * \endhtmlonly - * The hiding mechanism of the above `cascading' of debug channel declarations of libraries works as follows. The debug macros use a - * using-directive to include the scope DEBUGCHANNELS. Because all debug channels are specified as <CODE>dc::channelname</CODE> (and - * there is no <CODE>using namespace someother::dc</CODE> in name space DEBUGCHANNELS!), the namespace \c dc is uniquely defined. For - * instance, in the case of the above example, when writing <CODE>dc::notice</CODE> the \c dc will be unambiguously resolved to - * <CODE>application::debug::channels::dc</CODE>, because it is the only \c dc name space in DEBUGCHANNELS - * (<CODE>application::debug::channels</CODE>). The C++ standard states: "During the lookup of a name qualified by a namespace name, - * declarations that would otherwise be made visible by a using-directive can be hidden by declarations with the same name in the - * namespace containing the using-directive;". This allows us to put a list of using-directives in - * <CODE>application::debug::channels::dc</CODE> and then hide any collision by redefining it in - * <CODE>application::debug::channels::dc</CODE> itself, either as new debug channel, or as reference to one of the debug channels - * of the library of choice. - * \htmlonly - * </DIV> - * \endhtmlonly - */ Index: src/libcwd/documentation/custom-debug.h.dox diff -u /dev/null src/libcwd/documentation/custom-debug.h.dox:1.1.2.1 --- /dev/null Tue Nov 13 19:01:18 2001 +++ src/libcwd/documentation/custom-debug.h.dox Tue Nov 13 19:01:07 2001 @@ -0,0 +1,140 @@ +// Work around for bug in doxygen. +#define debug somethingelse + +/** \page custom_debug_h The Custom debug.h file + * + * \section debug_channels_and_namespace Debug channels and namespace + * + * \subsection applications Applications + * + * User applications have less strict requirements than libraries, because nobody else will link with it. + * The developer of an application directly controls and checks and resolves name collisions when needed. + * If you are writing an end-application then you are still urged to create a header file + * called %debug.h and use \em that in your source files, instead of including <libcw/debug.h> directly. + * You will benefit greatly from this in terms on flexibility (trust me). + * + * \sa \ref preparation + * + * \subsection libraries Libraries + * + * Libraries that use libcwd should not put their debug channels in libcw::debug::channels::dc. + * The correct way to declare new debug channels is by putting them in a namespace of the library and + * providing new macros for writing debug output. + * Also end applications will benefit by using this method (in terms of flexibility). + * + * The following code would define a debug channel \c warp in the namespace \c libexample: + * + * \code + * namespace libexample { + * namespace channels { + * namespace dc { + * ::libcw::debug::channel_ct warp("WARP"); + * } + * } + * } + * \endcode + * + * Then provide a debug header file (%debug.h) with the following: + * + * \code + * #ifndef LIBEXAMPLE_DEBUG_H + * #define LIBEXAMPLE_DEBUG_H + * + * #ifndef DEBUGCHANNELS + * #define DEBUGCHANNELS ::libexample::channels + * #endif + * #include <libcw/debug.h> + * + * namespace libexample { + * namespace channels { + * namespace dc { + * using namespace libcw::debug::channels::dc; + * extern libcw::debug::channel_ct warp; + * } + * } + * } + * + * // Define private debug output macros for use in header files of the library, + * // there is no reason to do this for normal applications. + * #ifdef CWDEBUG + * #define LibExampleDout(cntrl, data) \ + * LibcwDout(libexample::channels, libcw::debug::libcw_do, cntrl, data) + * #define LibExampleDoutFatal(cntrl, data) \ + * LibcwDoutFatal(libexample::channels, libcw::debug::libcw_do, cntrl, data) + * #else + * #define LibExampleDout(cntrl, data) + * #define LibExampleDoutFatal(cntrl, data) LibcwDoutFatal(::std, , cntrl, data) + * #endif + * + * #endif // LIBEXAMPLE_DEBUG_H + * \endcode + * + * This will make your debug channels available in the usual way (by using Dout and friends. + * LibExampleDout and friends are only for use in the header files of `libexample' itself) avoiding any linker name collisions. + * + * \subsection header_files_of_libraries Header files of libraries + * + * Don't use Dout etc. in header files of libraries, instead use (for example) LibExampleDout etc., as shown above. + * It is advisable not to include any %debug.h in your headerfiles. + * Instead, add the following lines to each header file that needs debugging: + * + * \code + * #ifndef LIBEXAMPLE_DEBUG_H + * #error "You need to include the appropriate debug.h in the source file, before including this header file." + * #endif + * \endcode + * + * Don't use "libexample/%debug.h" in this error message because someone else might write a library that is using your library and needs + * a different %debug.h to be included in end applications. + * + * \subsection debug_channel_name_collisions Debug channel name collisions + * + * The reason that libcwd uses the convention to put debug channels in the namespace dc is to avoid collisions between debug channel + * names of libraries. + * There are two types of name collisions possible: you upgrade or start to use a library which uses a debug channel + * that you had already defined, in that case you might need to change the name of your own channel, or you link with two or more + * libraries that both use libcwd and that defined the same debug channel, in that case you will have to make your own debug + * namespace as shown above and choose a new name for one of the channels. + * + * For example, suppose you link with two libraries: lib1 and lib2 who use the above convention and defined their own namespaces called + * lib1 and lib2, but both defined a debug channel called foobar. + * Then you can rename these channels as follows. + * Make a debug header file that contains: + * + * \code + * #ifndef DEBUGCHANNELS + * #define DEBUGCHANNELS ::application::channels + * #endif + * #include <lib1/debug.h> + * #include <lib2/debug.h> + * namespace application { + * namespace channels { + * namespace dc { + * using namespace ::lib1::channels::dc; + * using namespace ::lib2::channels::dc; + * static libcw::debug::channel_ct& foobar1(::lib1::channels::dc::foobar) __attribute__ ((unused)); + * static libcw::debug::channel_ct& foobar2(::lib2::channels::dc::foobar) __attribute__ ((unused)); + * } + * } + * } + * \endcode + * + * \htmlonly + * <DIV class="normal"> + * \endhtmlonly + * The hiding mechanism of the above `cascading' of debug channel declarations of libraries works as follows. + * The debug macros use a using-directive to include the scope DEBUGCHANNELS. + * Because all debug channels are specified as <CODE>dc::channelname</CODE> + * (and there is no <CODE>using namespace someother::dc</CODE> in name space DEBUGCHANNELS!), the namespace \c dc is uniquely defined. + * For instance, in the case of the above example, when writing <CODE>dc::%notice</CODE> the \c dc will be unambiguously resolved to + * <CODE>application::debug::channels::dc</CODE>, because it is the only \c dc name space in DEBUGCHANNELS + * (<CODE>application::debug::channels</CODE>). + * The C++ standard states: "During the lookup of a name qualified by a namespace name, declarations that would otherwise be made + * visible by a using-directive can be hidden by declarations with the same name in the namespace containing the using-directive;". + * This allows us to put a list of using-directives in <CODE>application::debug::channels::dc</CODE> and then hide any collision by + * redefining it in <CODE>application::debug::channels::dc</CODE> itself, either as new debug channel, or as reference to one of the + * %debug %channels of the library of choice. + * \htmlonly + * </DIV> + * \endhtmlonly + */ Index: src/libcwd/documentation/custom_do.dox diff -u /dev/null src/libcwd/documentation/custom_do.dox:1.1.2.1 --- /dev/null Tue Nov 13 19:01:18 2001 +++ src/libcwd/documentation/custom_do.dox Tue Nov 13 19:01:07 2001 @@ -0,0 +1,23 @@ +/*! + +\page custom_do Custom Debug Objects + +Each %debug object is associated with one ostream. +The default %debug output macros Dout and DoutFatal use the \em default debug object libcw::debug::libcw_do. +Other %debug objects may be created as global objects; +it is convenient to define new macros for each (custom) %debug object using the generic macros LibcwDout and LibcwDoutFatal. + +For example, add something like the following to your own \link custom_debug_h "debug.h" \endlink file: + +\code +#ifdef CWDEBUG +extern libcw::debug::debug_ct my_debug_object; +#define MyDout(cntrl, data) LibcwDout(DEBUGCHANNELS, my_debug_object, cntrl, data) +#define MyDoutFatal(cntrl, data) LibcwDoutFatal(DEBUGCHANNELS, my_debug_object, cntrl, data) +#else // !CWDEBUG +#define MyDout(a, b) +#define MyDoutFatal(a, b) LibcwDoutFatal(::std,, a, b) +#endif // !CWDEBUG +\endcode + +*/ Index: src/libcwd/documentation/downloading.dox diff -u /dev/null src/libcwd/documentation/downloading.dox:1.1.2.1 --- /dev/null Tue Nov 13 19:01:18 2001 +++ src/libcwd/documentation/downloading.dox Tue Nov 13 19:01:07 2001 @@ -0,0 +1,4 @@ +/** \page downloading Downloading + * + * For now, download libcwd from sourceforge at http://sourceforge.net/project/showfiles.php?group_id=354 + */ Index: src/libcwd/documentation/doxygen.config diff -u src/libcwd/documentation/doxygen.config:1.1.2.2 src/libcwd/documentation/doxygen.config:1.1.2.3 --- src/libcwd/documentation/doxygen.config:1.1.2.2 Fri Oct 26 15:58:03 2001 +++ src/libcwd/documentation/doxygen.config Tue Nov 13 19:01:07 2001 @@ -8,10 +8,10 @@ OUTPUT_DIRECTORY = OUTPUT_LANGUAGE = English EXTRACT_ALL = NO -EXTRACT_PRIVATE = YES +EXTRACT_PRIVATE = NO EXTRACT_STATIC = NO HIDE_UNDOC_MEMBERS = YES -HIDE_UNDOC_CLASSES = NO +HIDE_UNDOC_CLASSES = YES BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ALWAYS_DETAILED_SEC = NO @@ -35,17 +35,20 @@ DISTRIBUTE_GROUP_DOC = NO TAB_SIZE = 8 GENERATE_TODOLIST = NO -GENERATE_TESTLIST = NO +GENERATE_TESTLIST = YES GENERATE_BUGLIST = NO -ALIASES = +ALIASES = exampleoutput=\htmlonly\n<DIV\nclass=example-output>\n\endhtmlonly\n \ + endexampleoutput=\htmlonly\n</DIV>\n\endhtmlonly \ + shellcommand=\htmlonly\n<SPAN\nclass=shell-command>\n\endhtmlonly\n \ + endshellcommand=\htmlonly\n</SPAN>\n\endhtmlonly ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 OPTIMIZE_OUTPUT_FOR_C = NO -SHOW_USED_FILES = NO +SHOW_USED_FILES = YES #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- -QUIET = NO +QUIET = YES WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_FORMAT = @@ -57,13 +60,26 @@ ../include/libcw/char2str.h \ ../include/libcw/cwprint.h \ ../include/libcw/debug.h \ - . \ - ../debug.cc -FILE_PATTERNS = *.doc + ../debug.cc \ + ../include/libcw/class_debug.h \ + ../include/libcw/control_flag.h \ + ../include/libcw/class_channel.h \ + ../include/libcw/debug_config.h \ + ../debugmalloc.cc \ + ../include/libcw/macro_ForAllDebugChannels.h \ + ../include/libcw/macro_ForAllDebugObjects.h \ + ../bfd.cc \ + ../include/libcw/class_debug_string.h \ + ../include/libcw/class_fatal_channel.h \ + ../include/libcw/class_continued_channel.h \ + ../include/libcw/class_channel_set.h \ + . +FILE_PATTERNS = *.dox RECURSIVE = NO EXCLUDE = EXCLUDE_PATTERNS = -EXAMPLE_PATH = doxygen-examples +EXAMPLE_PATH = external \ + doxygen-examples EXAMPLE_PATTERNS = IMAGE_PATH = INPUT_FILTER = Index: src/libcwd/documentation/external/.cvsignore diff -u /dev/null src/libcwd/documentation/external/.cvsignore:1.1.2.1 --- /dev/null Tue Nov 13 19:01:18 2001 +++ src/libcwd/documentation/external/.cvsignore Tue Nov 13 19:01:07 2001 @@ -0,0 +1,5 @@ +INSTALL +sys.h +debug.h +debug.cc + Index: src/libcwd/documentation/html.footer diff -u src/libcwd/documentation/html.footer:1.1.2.1 src/libcwd/documentation/html.footer:1.1.2.2 --- src/libcwd/documentation/html.footer:1.1.2.1 Fri Oct 26 15:58:03 2001 +++ src/libcwd/documentation/html.footer Tue Nov 13 19:01:07 2001 @@ -1,6 +1,5 @@ -<BR> -<HR SIZE=1 NOSHADE> -<ADDRESS>Copyright © 2001 Carlo Wood. All rights reserved.</ADDRESS> +<ADDRESS>Copyright © 2001 Carlo Wood. All rights reserved.</ADDRESS> + </DIV> </BODY> </HTML> Index: src/libcwd/documentation/mainpage.doc diff -u src/libcwd/documentation/mainpage.doc:1.1.2.1 src/libcwd/documentation/mainpage.doc:removed --- src/libcwd/documentation/mainpage.doc:1.1.2.1 Fri Oct 26 15:58:03 2001 +++ src/libcwd/documentation/mainpage.doc Tue Nov 13 19:01:18 2001 @@ -1,46 +0,0 @@ -/*! \mainpage An Object Oriented Debugging library - * - * \section intro Introduction - * - * Libcwd is a full-featured debugging - * support library for C++ developers. - * It includes ostream-based debug - * output with custom debug channels - * and devices, powerful memory - * allocation debugging support, as - * well as run-time support for printing - * source-%file:line-number information - * and demangled type names. - * - * \section output_example Example output - * - * \htmlonly - * <CODE> - * <PRE> - * MALLOC : malloc(72) = <unfinished> - * BFD : address 0x402ad017 corresponds to dl-open.c:114 - * MALLOC : <continued> 0x81c1330 - * BFD : Loading debug info from ./module.so (0x4031f000) ... done (206 symbols) - * MALLOC : malloc(310) = <unfinished> - * BFD : address 0x40325943 corresponds to module.cc:16 - * MALLOC : <continued> 0x81bfb68 - * MALLOC : malloc(300) = <unfinished> - * BFD : address 0x40325490 corresponds to module.cc:7 - * MALLOC : <continued> 0x817c490 - * MALLOC : Allocated memory: 1518 bytes in 10 blocks. - * malloc 0x817c490 module.cc:7 void*; (sz = 300) Allocated inside static_test_symbol - * malloc 0x81bfb68 module.cc:16 void*; (sz = 310) Allocated inside global_test_symbol - * malloc 0x81c1330 dl-open.c:114 <unknown type>; (sz = 72) - * malloc 0x81f52a8 dl-version.c:287 <unknown type>; (sz = 96) - * malloc 0x804f410 dl-deps.c:495 <unknown type>; (sz = 52) - * malloc 0x81c1290 dl-object.c:107 <unknown type>; (sz = 140) - * malloc 0x81c0d30 dl-object.c:41 <unknown type>; (sz = 24) - * malloc 0x81c05f8 dl-object.c:40 <unknown type>; (sz = 496) - * malloc 0x81f5288 dl-load.c:164 <unknown type>; (sz = 12) - * malloc 0x81c00a0 dlerror.c:108 <unknown type>; (sz = 16) - * NOTICE : Finished - * </PRE> - * </CODE> - * \endhtmlonly - * - */ Index: src/libcwd/documentation/mainpage.dox diff -u /dev/null src/libcwd/documentation/mainpage.dox:1.1.2.1 --- /dev/null Tue Nov 13 19:01:18 2001 +++ src/libcwd/documentation/mainpage.dox Tue Nov 13 19:01:07 2001 @@ -0,0 +1,48 @@ +/*! \mainpage An Object Oriented Debugging library + * + * \section intro Introduction + * + * Libcwd is a full-featured debugging support library for C++ developers. + * It includes ostream-based debug output with custom debug channels + * and devices, powerful memory allocation debugging support, as + * well as run-time support for printing source-%file:line-number information + * and demangled type names. + * + * \section mainpage_links Links + * + * \li \ref downloading + * \li \ref preparation + * \li \ref reference + * + * \section output_example Example output + * + * \htmlonly + * <CODE> + * <PRE> + * MALLOC : malloc(72) = <unfinished> + * BFD : address 0x402ad017 corresponds to dl-open.c:114 + * MALLOC : <continued> 0x81c1330 + * BFD : Loading debug info from ./module.so (0x4031f000) ... done (206 symbols) + * MALLOC : malloc(310) = <unfinished> + * BFD : address 0x40325943 corresponds to module.cc:16 + * MALLOC : <continued> 0x81bfb68 + * MALLOC : malloc(300) = <unfinished> + * BFD : address 0x40325490 corresponds to module.cc:7 + * MALLOC : <continued> 0x817c490 + * MALLOC : Allocated memory: 1518 bytes in 10 blocks. + * malloc 0x817c490 module.cc:7 void*; (sz = 300) Allocated inside static_test_symbol + * malloc 0x81bfb68 module.cc:16 void*; (sz = 310) Allocated inside global_test_symbol + * malloc 0x81c1330 dl-open.c:114 <unknown type>; (sz = 72) + * malloc 0x81f52a8 dl-version.c:287 <unknown type>; (sz = 96) + * malloc 0x804f410 dl-deps.c:495 <unknown type>; (sz = 52) + * malloc 0x81c1290 dl-object.c:107 <unknown type>; (sz = 140) + * malloc 0x81c0d30 dl-object.c:41 <unknown type>; (sz = 24) + * malloc 0x81c05f8 dl-object.c:40 <unknown type>; (sz = 496) + * malloc 0x81f5288 dl-load.c:164 <unknown type>; (sz = 12) + * malloc 0x81c00a0 dlerror.c:108 <unknown type>; (sz = 16) + * NOTICE : Finished + * </PRE> + * </CODE> + * \endhtmlonly + * + */ Index: src/libcwd/documentation/namespaces.doc diff -u src/libcwd/documentation/namespaces.doc:1.1.2.1 src/libcwd/documentation/namespaces.doc:removed --- src/libcwd/documentation/namespaces.doc:1.1.2.1 Fri Oct 26 15:58:03 2001 +++ src/libcwd/documentation/namespaces.doc Tue Nov 13 19:01:18 2001 @@ -1,41 +0,0 @@ -/** \namespace libcw - * - * \brief namespace for libcw. - * - * The library libcwd is a spin-off of the larger libcw project. - * The header files of both are put in the same directory, called libcw (for example, /usr/include/libcw). - * - * The d in libcwd stands for Debugging. The cw in libcw stand for the initials of the designer/developer of - * this life-span project. - * - * For historical reasons, the namespace of libcwd is called libcw::debug rather than \c libcwd. - * libcwd itself does not declare anything else in namespace libcw than its own '%debug' namespace. - * - * \sa libcw::debug - */ -namespace libcw { - - /** \namespace libcw::debug - * - * \brief namespace for libcwd. - * - * This namespace contains all user accessible classes, functions and variables.\n - * Things defined in this namespace belong to the libcwd API and will be supported through-out version 1.x. - */ - namespace debug { - - /** \namespace libcw::debug::channels - * - * \brief The default DEBUGCHANNELS namespace. - * - * This macro should contain the namespace where your application defines the \link namespace_dc dc \endlink namespace; - * If you want to define additional %debug %channels, next to the ones already \link libcw::debug::channels::dc provided \endlink - * by libcwd, then the macro DEBUGCHANNELS must be defined in the custom \link custom_debug_h debug.h \endlink - * header file of your application (or library) prior to including <libcw/debug.h>. - * - * \sa \link custom_debug_h Custom debug channels \endlink - */ - namespace channels { - } - } -} Index: src/libcwd/documentation/namespaces.dox diff -u /dev/null src/libcwd/documentation/namespaces.dox:1.1.2.1 --- /dev/null Tue Nov 13 19:01:18 2001 +++ src/libcwd/documentation/namespaces.dox Tue Nov 13 19:01:07 2001 @@ -0,0 +1,41 @@ +/** \namespace libcw + * + * \brief namespace for libcw. + * + * The library libcwd is a spin-off of the larger libcw project. + * The header files of both are put in the same directory, called libcw (for example, /usr/include/libcw). + * + * The d in libcwd stands for Debugging. The cw in libcw stand for the initials of the designer/developer of + * this life-span project. + * + * For historical reasons, the namespace of libcwd is called libcw::debug rather than \c libcwd. + * libcwd itself does not declare anything else in namespace libcw than its own '%debug' namespace. + * + * \sa libcw::debug + */ +namespace libcw { + + /** \namespace libcw::debug + * + * \brief namespace for libcwd. + * + * This namespace contains all user accessible classes, functions and variables.\n + * Things defined in this namespace belong to the libcwd API and will be supported through-out version 1.x. + */ + namespace debug { + + /** \namespace libcw::debug::channels + * + * \brief The default DEBUGCHANNELS namespace. + * + * This macro should contain the namespace where your application defines the \link preparation dc \endlink namespace; + * If you want to define additional %debug %channels, next to the ones already \link libcw::debug::channels::dc provided \endlink + * by libcwd, then the macro DEBUGCHANNELS must be defined in the custom \link preparation debug.h \endlink + * header file of your application (or library) prior to including <libcw/debug.h>. + * + * \sa \ref preparation + */ + namespace channels { + } + } +} Index: src/libcwd/documentation/nested.dox diff -u /dev/null src/libcwd/documentation/nested.dox:1.1.2.1 --- /dev/null Tue Nov 13 19:01:18 2001 +++ src/libcwd/documentation/nested.dox Tue Nov 13 19:01:07 2001 @@ -0,0 +1,89 @@ +/** \page nested_debug_calls Nested debug calls + * + * \section inside Calling functions inside Dout + * + * Consider the following code: + * + * \code + * int foobar(void) __attribute__ ((const)); + * + * int foobar(void) + * { + * Dout( dc::notice, "Entering foobar()" ); + * Dout( dc::notice, "Leaving foobar()" ); + * return 1; + * } + * + * int main(void) + * { + * Dout( dc::kernel, "The value of foobar() = " << foobar() + * << ", aint that nice?" ); + * return foobar(); + * } + * \endcode + * + * This code would start a new debug message before the previous debug message is finished. + * Libcwd detects this and will output: + * + * \exampleoutput <PRE> + * NOTICE: Entering foobar() + * NOTICE: Leaving foobar() + * KERNEL: The value of foobar() = 2, aint that nice?</PRE> + * \endexampleoutput + * + * Note the indentation and the fact that the printing of the label KERNEL was delayed. + * + * \section using_continued Using continued_cf, dc::continued and dc::finish + * + * In the previous section <CODE>foobar()</CODE> was a const function: it didn't matter + * whether or not it was called for the functionality of the application. But when + * it does matter, then one might want to do something like this: + * + * \code + * Dout( dc::kernel|flush_cf|continued_cf, "Generating tables... " ); + * generate_tables(); + * Dout( dc::finish, "done" ); + * \endcode + * + * If generate_tables() would not print debug messages, then the output will look like: + * + * \exampleoutput <PRE> + * KERNEL: Generating tables... done</PRE> + * \endexampleoutput + * + * When it does generated debug output, then the <unfinished> and <continued> labels are printed also: + * + * \exampleoutput <PRE> + * KERNEL: Generating tables... <unfinished> + * NOTICE: Inside generate_tables() + * KERNEL: <continued> done</PRE> + * \endexampleoutput + * + * Finally, it is also possible to split a debug line into more then two parts by using the special dc::continued debug channel. + * + * \code + * Dout( dc::notice|flush_cf|continued_cf, "Generating tables." ); + * for(int i = 0; i < 8; ++i) + * { + * generate_table(i); + * Dout( dc::continued, '.' ); + * } + * Dout( dc::finish, " done" ); + * \endcode + * + * When generate_table(i) doesn't print debug messages, then the output will look like: + * + * \exampleoutput <PRE> + * NOTICE: Generating tables......... done</PRE> + * \endexampleoutput + * + * When it does generate debug output, then each dot would be surrounded by a <continued> .<unfinished> : + * + * \exampleoutput <PRE> + * NOTICE: Generating tables.<unfinished> + * TABLE : Inside generate_table(0) + * NOTICE: <continued> .<unfinished></PRE> + * \endexampleoutput + * + * etc. + */ Index: src/libcwd/documentation/preparation.dox diff -u /dev/null src/libcwd/documentation/preparation.dox:1.1.2.1 --- /dev/null Tue Nov 13 19:01:18 2001 +++ src/libcwd/documentation/preparation.dox Tue Nov 13 19:01:07 2001 @@ -0,0 +1,45 @@ +/** \page preparation Preparation + * + * This page describes the preparations that you need to perform + * before starting to use libcwd in your applications source code. + * + * \subsection installation Step 1: Installing libcwd + * + * Binairy distributions should be installed the usual way. + * + * If you are installing libcwd from source then please read the + * \htmlonly<A HREF="../external/INSTALL">\endhtmlonly + * INSTALL\htmlonly</A>\endhtmlonly + * file that is included in the source distribution.<BR> + * See also: \ref configuration + * + * \subsection header_files Step 2: Creating the custom header files + * + * You need to add two custom header files to your application.<BR> + * The recommended names are "%debug.h" and "sys.h". + * + * You can use the following templates for a quick start: + * + * \par sys.h example template + * \include sys.h + * \htmlonly «<A HREF="../external/sys.h">download</A>»\endhtmlonly + * + * \par debug.h example template + * \include debug.h + * \htmlonly «<A HREF="../external/debug.h">download</A>»\endhtmlonly + * + * This %debug.h file is for applications, for more detailed information and for information + * for library developers who want to use libbcwd, please also read \ref custom_debug_h. + * + * \subsection custom_debug_cc Step 3: Creating the custom source file + * + * If you added one or more custom %debug %channels to your namespace + * <CODE>DEBUGCHANNELS</CODE> in your custom "%debug.h", then of course you + * also need to add the definition somewhere. + * You can do that anywhere, or you could add a special source file for it. + * + * \par debug.cc example template + * \include debug.cc + * \htmlonly «<A HREF="../external/debug.cc">download</A>»\endhtmlonly + */ + Index: src/libcwd/documentation/reference.dox diff -u /dev/null src/libcwd/documentation/reference.dox:1.1.2.1 --- /dev/null Tue Nov 13 19:01:18 2001 +++ src/libcwd/documentation/reference.dox Tue Nov 13 19:01:07 2001 @@ -0,0 +1,56 @@ +/*! \page reference Reference Manual + +\section Writing_debug_output Writing debug output + +\subsection The_Debug_Object The Debug Object +<ul> + <li> Class: \ref libcw::debug::debug_ct + <li> Default debug object: \link libcw::debug::libcw_do libcw_do \endlink + <li> Writing debug output to libcw_do: \ref Dout + <li> Custom debug objects: \ref custom_do +</ul> + +\subsection Debug_Channel_objects Debug Channel objects +<ul> + <li> Class: \ref libcw::debug::channel_ct + <li> Pre-defined channels: \ref default_dc + <li> Custom channels: \ref preparation +</ul> + +\subsection Format_of_the_debug_output Format of the debug output +<ul> + <li> \ref debug_ct_formatting +</ul> + +\subsection Debug_output_Control_Flags Debug output Control Flags +<ul> + <li> Overview: \ref control_flags +</ul> + +\subsection Fatal_debug_output Fatal debug output +<ul> + <li> Macro: \ref DoutFatal + <li> Pre-defined channels: \ref dc::fatal, \ref dc::core +</ul> + +\subsection Nested_debug_calls Nested debug calls +<ul> + <li> \ref nested_debug_calls +</ul> + +\subsection Special_functions Special functions +<ul> + <li> \ref ForAllDebugObjects ( ) + <li> \ref ForAllDebugChannels ( ) + <li> \ref Debug ( \link libcw::debug::check_configuration list_channels_on() \endlink ) + <li> \ref Debug ( \link libcw::debug::list_channels_on list_channels_on \endlink (\link libcw::debug::libcw_do libcw_do \endlink) ) + <li> \ref Debug ( \link libcw::debug::list_allocations_on list_allocations_on \endlink (\link libcw::debug::libcw_do libcw_do \endlink) ) + <li> \ref Debug ( \link libcw::debug::make_all_allocations_invisible_except make_all_allocations_invisible_except(ptr) \endlink ) +</ul> + +\section Memory_allocation_debugging_support Memory allocation debug support + +\section Runtime_debug_symbols_handling Runtime debug symbols handling + +*/ + Index: src/libcwd/documentation/scripts/load_style_sheets.js diff -u src/libcwd/documentation/scripts/load_style_sheets.js:1.1.2.1 src/libcwd/documentation/scripts/load_style_sheets.js:1.1.2.2 --- src/libcwd/documentation/scripts/load_style_sheets.js:1.1.2.1 Fri Oct 26 15:58:03 2001 +++ src/libcwd/documentation/scripts/load_style_sheets.js Tue Nov 13 19:01:07 2001 @@ -16,8 +16,13 @@ write("<LINK REL=StyleSheet HREF=\"" + rootpath + "styles/tag-cw.css\" TYPE=\"text/css\">"); if (is_nav) { - write("<LINK REL=StyleSheet HREF=\"" + rootpath + "styles/ns/main.css\" TYPE=\"text/css\">"); - if (is_unix) - write("<LINK REL=StyleSheet HREF=\"" + rootpath + "styles/ns/linux/main.css\" TYPE=\"text/css\">"); + if (is_nav5up) + write("<LINK REL=StyleSheet HREF=\"" + rootpath + "styles/ns5/main.css\" TYPE=\"text/css\">"); + else + { + write("<LINK REL=StyleSheet HREF=\"" + rootpath + "styles/ns4/main.css\" TYPE=\"text/css\">"); + if (is_unix) + write("<LINK REL=StyleSheet HREF=\"" + rootpath + "styles/ns4/linux/main.css\" TYPE=\"text/css\">"); + } } } Index: src/libcwd/documentation/styles/main.css diff -u src/libcwd/documentation/styles/main.css:1.1.2.1 src/libcwd/documentation/styles/main.css:1.1.2.2 --- src/libcwd/documentation/styles/main.css:1.1.2.1 Fri Oct 26 15:58:03 2001 +++ src/libcwd/documentation/styles/main.css Tue Nov 13 19:01:07 2001 @@ -31,43 +31,43 @@ * Style Sheet for the libcw documentation */ -BODY { background: rgb(247, 252, 248); margin-top: 10; } -BODY, .normal { color: black; } +BODY { color: black; background-color: rgb(247, 252, 248); margin-top: 10px; } +BODY, .normal { color: black; background-color: rgb(247, 252, 248); } BODY, .normal, TD, TH { font-family: verdana; font-size: 10pt; } -A:link, A:visited, A:active { text-decoration: underline; font-weight: normal; } -A:link { color: blue; } -A:visited, A:active { color: #2727b2; } +/* Images and links */ +a:link img, a:visited img { + border-style : none; +} +a img { + color: transparent; background: transparent; text-decoration: none; +} +address img { + float: right; +} +address { + padding-top: 0.5em; + padding-right: 1em; + padding-left: 1em; + padding-bottom: 0.5em; + margin-top: 3em; + border-top: 2px solid black; + background-color: #eee; + clear: both; +} + +.image-link:link { text-decoration: none; } +.image-link:visited { text-decoration: none; } +.image-link:active { text-decoration: none; } + /* Heading fonts and sizes */ H1, H2, H3, H4, H5 { font-family: helvetica; } -H1 { font-size: 26pt; text-align: center; } -H2 { font-size: 20pt } -H3 { font-size: 16pt } -H4 { font-size: 14pt } -H5 { font-size: 13pt } - -H1.function, H2.function, H3.function, H4.function, H5.function, H6.function { font-family: courier } - -H1.function { font-size: 12pt } -H2.function { font-size: 12pt } -H3.function { font-size: 12pt } -H4.function { font-size: 12pt } -H5.function { font-size: 12pt } -H6.function { font-size: 12pt } - -.H1code { font-size: 24pt } -.H2code { font-size: 18pt } -.H3code { font-size: 15pt } -.H4code { font-size: 13pt } -.H5code { font-size: 12pt } -.H6code { font-size: 10pt } - /* Special classes */ .table { @@ -77,8 +77,6 @@ margin-top: 3px; margin-bottom: 3px } - -A.image-link:link, A.image-link:visited, A.image-link:active { text-decoration: none } .code, .example-code, .nld, .output, .example-output { font-family: courier; Index: src/libcwd/documentation/styles/ns4/linux/main.css diff -u /dev/null src/libcwd/documentation/styles/ns4/linux/main.css:1.1.2.1 --- /dev/null Tue Nov 13 19:01:18 2001 +++ src/libcwd/documentation/styles/ns4/linux/main.css Tue Nov 13 19:01:07 2001 @@ -0,0 +1,20 @@ +/* Incremental style sheet for netscape navigator on linux */ + +/* Netscape table bug workaround. Also use <BODY><DIV class="normal"> ... </DIV><TABLE></TABLE><DIV class="normal"> ... </DIV></BODY> */ +BODY, .normal, TD, TH { + font-family: helvetica; + font-size: 14pt; +} +/* Same for doxygen code fragments: */ +DIV.fragment { font-size: 14pt } +CODE { font-size: 14pt } + +/* At least try to make it look the same as on IE */ +HR { + line-height: 1.86ex; /* 2 times font-size 13/font-size 14 */ +} + +.code, .example-code, .nld, .output, .example-output { + font-family: courier; + font-size: 14pt; +} Index: src/libcwd/documentation/styles/ns4/main.css diff -u /dev/null src/libcwd/documentation/styles/ns4/main.css:1.1.2.1 --- /dev/null Tue Nov 13 19:01:18 2001 +++ src/libcwd/documentation/styles/ns4/main.css Tue Nov 13 19:01:07 2001 @@ -0,0 +1,9 @@ +/* Incremental style sheet for netscape navigator */ + +/* At least try to make it look the same as on IE */ +HR { + line-height: 2ex; /* 2 times font-size IE/font-size our */ + vertical-align: middle; +} + +DIV.fragment { padding-top: 0.7em; padding-bottom: 0em } Index: src/libcwd/documentation/styles/ns5/main.css diff -u /dev/null src/libcwd/documentation/styles/ns5/main.css:1.1.2.1 --- /dev/null Tue Nov 13 19:01:18 2001 +++ src/libcwd/documentation/styles/ns5/main.css Tue Nov 13 19:01:07 2001 @@ -0,0 +1,30 @@ +/* Incremental style sheet for mozilla */ + +/* At least try to make it look the same as on IE */ +HR { + line-height: 2ex; /* 2 times font-size IE/font-size our */ + vertical-align: middle; +} + +DIV.fragment { padding-top: 0em; padding-bottom: 0em } + +/* Incremental style sheet for mozilla on linux */ + +/* Netscape table bug workaround. Also use <BODY><DIV class="normal"> ... </DIV><TABLE></TABLE><DIV class="normal"> ... </DIV></BODY> */ +BODY, .normal, TD, TH { + font-family: helvetica; + font-size: 14pt; +} +/* Same for doxygen code fragments: */ +DIV.fragment { font-size: 14pt } +CODE { font-size: 14pt } + +/* At least try to make it look the same as on IE */ +HR { + line-height: 1.86ex; /* 2 times font-size 13/font-size 14 */ +} + +.code, .example-code, .nld, .output, .example-output { + font-family: courier; + font-size: 14pt; +} Index: src/libcwd/example-project/.cvsignore diff -u src/libcwd/example-project/.cvsi... [truncated message content] |
From: Carlo W. <li...@us...> - 2001-11-14 03:58:50
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-10-14 03:58:49 UTC Modified files: Tag: branch-threading libcwd/documentation/mainpage.dox Log message: Bug fix: don't use < and >. ---------------------- diff included ---------------------- Index: src/libcwd/documentation/mainpage.dox diff -u src/libcwd/documentation/mainpage.dox:1.1.2.1 src/libcwd/documentation/mainpage.dox:1.1.2.2 --- src/libcwd/documentation/mainpage.dox:1.1.2.1 Tue Nov 13 19:01:07 2001 +++ src/libcwd/documentation/mainpage.dox Tue Nov 13 19:58:39 2001 @@ -19,27 +19,27 @@ * \htmlonly * <CODE> * <PRE> - * MALLOC : malloc(72) = <unfinished> + * MALLOC : malloc(72) = <unfinished> * BFD : address 0x402ad017 corresponds to dl-open.c:114 - * MALLOC : <continued> 0x81c1330 + * MALLOC : <continued> 0x81c1330 * BFD : Loading debug info from ./module.so (0x4031f000) ... done (206 symbols) - * MALLOC : malloc(310) = <unfinished> + * MALLOC : malloc(310) = <unfinished> * BFD : address 0x40325943 corresponds to module.cc:16 - * MALLOC : <continued> 0x81bfb68 - * MALLOC : malloc(300) = <unfinished> + * MALLOC : <continued> 0x81bfb68 + * MALLOC : malloc(300) = <unfinished> * BFD : address 0x40325490 corresponds to module.cc:7 - * MALLOC : <continued> 0x817c490 + * MALLOC : <continued> 0x817c490 * MALLOC : Allocated memory: 1518 bytes in 10 blocks. * malloc 0x817c490 module.cc:7 void*; (sz = 300) Allocated inside static_test_symbol * malloc 0x81bfb68 module.cc:16 void*; (sz = 310) Allocated inside global_test_symbol - * malloc 0x81c1330 dl-open.c:114 <unknown type>; (sz = 72) - * malloc 0x81f52a8 dl-version.c:287 <unknown type>; (sz = 96) - * malloc 0x804f410 dl-deps.c:495 <unknown type>; (sz = 52) - * malloc 0x81c1290 dl-object.c:107 <unknown type>; (sz = 140) - * malloc 0x81c0d30 dl-object.c:41 <unknown type>; (sz = 24) - * malloc 0x81c05f8 dl-object.c:40 <unknown type>; (sz = 496) - * malloc 0x81f5288 dl-load.c:164 <unknown type>; (sz = 12) - * malloc 0x81c00a0 dlerror.c:108 <unknown type>; (sz = 16) + * malloc 0x81c1330 dl-open.c:114 <unknown type>; (sz = 72) + * malloc 0x81f52a8 dl-version.c:287 <unknown type>; (sz = 96) + * malloc 0x804f410 dl-deps.c:495 <unknown type>; (sz = 52) + * malloc 0x81c1290 dl-object.c:107 <unknown type>; (sz = 140) + * malloc 0x81c0d30 dl-object.c:41 <unknown type>; (sz = 24) + * malloc 0x81c05f8 dl-object.c:40 <unknown type>; (sz = 496) + * malloc 0x81f5288 dl-load.c:164 <unknown type>; (sz = 12) + * malloc 0x81c00a0 dlerror.c:108 <unknown type>; (sz = 16) * NOTICE : Finished * </PRE> * </CODE> ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-11-14 15:40:23
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-10-14 15:40:21 UTC Modified files: Tag: branch-threading libcwd/documentation/styles/ns5/main.css Log message: Use 13pt instead of 14pt. ---------------------- diff included ---------------------- Index: src/libcwd/documentation/styles/ns5/main.css diff -u src/libcwd/documentation/styles/ns5/main.css:1.1.2.1 src/libcwd/documentation/styles/ns5/main.css:1.1.2.2 --- src/libcwd/documentation/styles/ns5/main.css:1.1.2.1 Tue Nov 13 19:01:07 2001 +++ src/libcwd/documentation/styles/ns5/main.css Wed Nov 14 07:40:11 2001 @@ -1,23 +1,17 @@ /* Incremental style sheet for mozilla */ -/* At least try to make it look the same as on IE */ -HR { - line-height: 2ex; /* 2 times font-size IE/font-size our */ - vertical-align: middle; -} - DIV.fragment { padding-top: 0em; padding-bottom: 0em } /* Incremental style sheet for mozilla on linux */ /* Netscape table bug workaround. Also use <BODY><DIV class="normal"> ... </DIV><TABLE></TABLE><DIV class="normal"> ... </DIV></BODY> */ BODY, .normal, TD, TH { - font-family: helvetica; - font-size: 14pt; + font-family: helvetica, sans-serif; + font-size: 13pt; } /* Same for doxygen code fragments: */ -DIV.fragment { font-size: 14pt } -CODE { font-size: 14pt } +DIV.fragment { font-size: 13pt } +CODE { font-size: 13pt } /* At least try to make it look the same as on IE */ HR { @@ -25,6 +19,6 @@ } .code, .example-code, .nld, .output, .example-output { - font-family: courier; - font-size: 14pt; + font-family: courier, monospace; + font-size: 13pt; } ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-11-17 00:14:40
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-10-17 00:14:39 UTC Modified files: Tag: branch-threading libcwd/bfd.cc libcwd/debugmalloc.cc libcwd/documentation/doxygen.config libcwd/include/libcw/debugmalloc.h Added files: Tag: branch-threading libcwd/include/ios_base_Init.h libcwd/include/libcw/class_alloc.h libcwd/include/libcw/class_marker.h libcwd/include/libcw/class_memblk_types.h Log message: Work in progress. ---------------------- diff included ---------------------- Index: src/libcwd/bfd.cc diff -u src/libcwd/bfd.cc:1.85.2.28 src/libcwd/bfd.cc:1.85.2.29 --- src/libcwd/bfd.cc:1.85.2.28 Tue Nov 13 19:01:06 2001 +++ src/libcwd/bfd.cc Fri Nov 16 16:14:28 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.85.2.28 2001/11/14 03:01:06 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.85.2.29 2001/11/17 00:14:28 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -46,6 +46,7 @@ #include <cstdio> // Needed for vsnprintf. #include <algorithm> #include "debug.h" +#include "ios_base_Init.h" #ifdef CWDEBUG_DLOPEN_DEFINED #undef dlopen #undef dlclose Index: src/libcwd/debugmalloc.cc diff -u src/libcwd/debugmalloc.cc:1.61.2.42 src/libcwd/debugmalloc.cc:1.61.2.43 --- src/libcwd/debugmalloc.cc:1.61.2.42 Tue Nov 13 19:01:06 2001 +++ src/libcwd/debugmalloc.cc Fri Nov 16 16:14:28 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.61.2.42 2001/11/14 03:01:06 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.61.2.43 2001/11/17 00:14:28 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -153,6 +153,7 @@ #include <iostream> #include <iomanip> #include "debug.h" +#include "ios_base_Init.h" #include <libcw/cwprint.h> // MULTI THREADING @@ -1540,7 +1541,7 @@ size_t memsize = const_dm_alloc_ct::get_memsize(); unsigned long memblks = const_dm_alloc_ct::get_memblks(); RELEASE_READ_LOCK - o << "Allocated memory: " << memsize << " bytes in " << memblks << " blocks."; + o << "Allocated memory: " << memsize << " bytes in " << memblks << " blocks"; return o; } Index: src/libcwd/documentation/doxygen.config diff -u src/libcwd/documentation/doxygen.config:1.1.2.3 src/libcwd/documentation/doxygen.config:1.1.2.4 --- src/libcwd/documentation/doxygen.config:1.1.2.3 Tue Nov 13 19:01:07 2001 +++ src/libcwd/documentation/doxygen.config Fri Nov 16 16:14:29 2001 @@ -73,7 +73,8 @@ ../include/libcw/class_fatal_channel.h \ ../include/libcw/class_continued_channel.h \ ../include/libcw/class_channel_set.h \ - . + . \ + ../include/libcw/debugmalloc.h FILE_PATTERNS = *.dox RECURSIVE = NO EXCLUDE = Index: src/libcwd/include/ios_base_Init.h diff -u /dev/null src/libcwd/include/ios_base_Init.h:1.1.2.1 --- /dev/null Fri Nov 16 16:14:39 2001 +++ src/libcwd/include/ios_base_Init.h Fri Nov 16 16:14:29 2001 @@ -0,0 +1,30 @@ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/Attic/ios_base_Init.h,v 1.1.2.1 2001/11/17 00:14:29 libcw Exp $ +// +// Copyright (C) 2000 - 2001, 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. +// + +#ifndef IOS_BASE_INIT_H +#define IOS_BASE_INIT_H + +namespace libcw { + namespace debug { + namespace _private_ { + +#ifdef __GLIBCPP__ +extern bool WST_ios_base_initialized; +extern bool inside_ios_base_Init_Init(void); +#endif + + } // namespace _private_ + } // namespace debug +} // namespace libcw + +#endif // IOS_BASE_INIT__H Index: src/libcwd/include/libcw/class_alloc.h diff -u /dev/null src/libcwd/include/libcw/class_alloc.h:1.1.2.1 --- /dev/null Fri Nov 16 16:14:39 2001 +++ src/libcwd/include/libcw/class_alloc.h Fri Nov 16 16:14:29 2001 @@ -0,0 +1,81 @@ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_alloc.h,v 1.1.2.1 2001/11/17 00:14:29 libcw Exp $ +// +// Copyright (C) 2000 - 2001, 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. +// + +#ifndef LIBCW_CLASS_ALLOC_H +#define LIBCW_CLASS_ALLOC_H + +#ifndef LIBCW_DEBUG_CONFIG_H +#include <libcw/debug_config.h> +#endif + +#ifndef LIBCW_CLASS_MEMBLK_TYPES_H +#include <libcw/class_memblk_types.h> // Needed for memblk_types_nt. +#endif +#ifndef LIBCW_LOCKABLE_AUTO_PTR_H +#include <libcw/lockable_auto_ptr.h> // Needed for lockable_auto_ptr<char, true>. +#endif +#if defined(DEBUGUSEBFD) && !defined(LIBCW_CLASS_LOCATION_H) +#include <libcw/class_location.h> // Needed for location_ct. +#endif +#ifndef LIBCW_CSTDDEF +#define LIBCW_CSTDDEF +#include <cstddef> // Needed for size_t. +#endif + +namespace libcw { + namespace debug { + +// Forward declaration +class type_info_ct; + +//=================================================================================================== +// +// The class which describes allocated memory blocks. +// + +/** + * \brief An object of type alloc_ct contains information about one allocated memory block. + */ +class alloc_ct { +protected: + void const* a_start; // Duplicate of (original) memblk_key_ct + size_t a_size; // Duplicate of (original) memblk_key_ct + memblk_types_nt a_memblk_type; // A flag which indicates the type of allocation + type_info_ct const* type_info_ptr; // Type info of related object + lockable_auto_ptr<char, true> a_description; // A label describing this memblk +#ifdef DEBUGUSEBFD + location_ct M_location; // Source file, function and line number from where + // the allocator was called from +#endif +public: + alloc_ct(void const* s, size_t sz, memblk_types_nt type, type_info_ct const& ti) : + a_start(s), a_size(sz), a_memblk_type(type), type_info_ptr(&ti) { } + /** \brief The allocated size in bytes. */ + size_t size(void) const { return a_size; } + /** \brief A pointer to the start of the allocated memory block. */ + void const* start(void) const { return a_start; } + memblk_types_nt memblk_type(void) const { return a_memblk_type; } + type_info_ct const& type_info(void) const { return *type_info_ptr; } + char const* description(void) const { return a_description.get(); } +#ifdef DEBUGUSEBFD + location_ct& location_reference(void) { return M_location; } + location_ct const& location(void) const { return M_location; } +#endif +protected: + virtual ~alloc_ct() {} +}; + + } //namespace debug +} // namespace libcw + +#endif // LIBCW_CLASS_ALLOC_H Index: src/libcwd/include/libcw/class_marker.h diff -u /dev/null src/libcwd/include/libcw/class_marker.h:1.1.2.1 --- /dev/null Fri Nov 16 16:14:39 2001 +++ src/libcwd/include/libcw/class_marker.h Fri Nov 16 16:14:29 2001 @@ -0,0 +1,33 @@ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_marker.h,v 1.1.2.1 2001/11/17 00:14:29 libcw Exp $ +// +// Copyright (C) 2000 - 2001, 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. +// + +#ifndef LIBCW_CLASS_MARKER_H +#define LIBCW_CLASS_MARKER_H + +namespace libcw { + namespace debug { + +class marker_ct { +private: + void register_marker(char const* label); +public: + marker_ct(char const* label) { register_marker(label); } + marker_ct(void) { register_marker("An allocation marker"); } + ~marker_ct(void); +}; + + } //namespace debug +} // namespace libcw + +#endif // LIBCW_CLASS_MARKER_H + Index: src/libcwd/include/libcw/class_memblk_types.h diff -u /dev/null src/libcwd/include/libcw/class_memblk_types.h:1.1.2.1 --- /dev/null Fri Nov 16 16:14:39 2001 +++ src/libcwd/include/libcw/class_memblk_types.h Fri Nov 16 16:14:29 2001 @@ -0,0 +1,69 @@ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_memblk_types.h,v 1.1.2.1 2001/11/17 00:14:29 libcw Exp $ +// +// Copyright (C) 2000 - 2001, 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. +// + +#ifndef LIBCW_CLASS_MEMBLK_TYPES_H +#define LIBCW_CLASS_MEMBLK_TYPES_H + +#ifndef LIBCW_DEBUG_CONFIG_H +#include <libcw/debug_config.h> +#endif +#ifndef LIBCW_IOSFWD +#define LIBCW_IOSFWD +#include <iosfwd> // Needed for ostream. +#endif + +namespace libcw { + namespace debug { + +//=================================================================================================== +// Flags used to mark the type of `memblk': +// + +// If you change this, then also edit `expected_from' in debugmalloc.cc! +enum memblk_types_nt { + memblk_type_new, // Allocated with `new' + memblk_type_deleted, // Deleted with `delete' + memblk_type_new_array, // Allocated with `new[]' + memblk_type_deleted_array, // Deleted with `delete[]' + memblk_type_malloc, // Allocated with `malloc' + memblk_type_realloc, // Reallocated with `realloc' + memblk_type_freed, // Freed with `free' +#ifdef DEBUGMARKER + memblk_type_marker, // A memory allocation "marker" + memblk_type_deleted_marker, // A deleted memory allocation "marker" +#endif + memblk_type_external // Externally allocated with `malloc' (no magic numbers!) +}; + +class memblk_types_ct { +private: + memblk_types_nt memblk_type; +public: + memblk_types_ct(memblk_types_nt mbt) : memblk_type(mbt) { } + memblk_types_nt operator()(void) const { return memblk_type; } +}; + +extern ::std::ostream& operator<<(::std::ostream& os, memblk_types_ct); + +__inline__ +::std::ostream& +operator<<(::std::ostream& os, memblk_types_nt memblk_type) +{ + return os << memblk_types_ct(memblk_type); +} + + } // namespace debug +} // namespace libcw + +#endif // LIBCW_CLASS_MEMBLK_TYPES_H + Index: src/libcwd/include/libcw/debugmalloc.h diff -u src/libcwd/include/libcw/debugmalloc.h:1.28.2.30 src/libcwd/include/libcw/debugmalloc.h:1.28.2.31 --- src/libcwd/include/libcw/debugmalloc.h:1.28.2.30 Tue Nov 13 19:01:08 2001 +++ src/libcwd/include/libcw/debugmalloc.h Fri Nov 16 16:14:29 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debugmalloc.h,v 1.28.2.30 2001/11/14 03:01:08 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debugmalloc.h,v 1.28.2.31 2001/11/17 00:14:29 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -11,6 +11,10 @@ // packaging of this file. // +/** \file libcw/debugmalloc.h + * \brief An internal header file, don't include directly. + */ + #ifndef LIBCW_DEBUGMALLOC_H #define LIBCW_DEBUGMALLOC_H @@ -18,126 +22,57 @@ #error "Don't include <libcw/debugmalloc.h> directly, include the appropriate \"debug.h\" instead." #endif +#include <libcw/debug_config.h> +#ifndef DEBUGMALLOC +#error "nonsense!" +#endif #ifdef DEBUGMALLOC +/** \interface foobar + * \brief test interface + */ + #ifndef LIBCW_CSTDDEF #define LIBCW_CSTDDEF -#include <cstddef> // Needed for size_t +#include <cstddef> // Needed for size_t. #endif - -namespace libcw { - namespace debug { - namespace _private_ { - -#ifdef __GLIBCPP__ -extern bool WST_ios_base_initialized; -bool inside_ios_base_Init_Init(void); +#ifndef LIBCW_CLASS_ALLOC_H +#include <libcw/class_alloc.h> #endif - - } // namespace _private_ - } // namespace debug -} // namespace libcw - +#ifndef LIBCW_LOCKABLE_AUTO_PTR_H #include <libcw/lockable_auto_ptr.h> +#endif +#ifndef LIBCW_PRIVATE_SET_ALLOC_CHECKING_H #include <libcw/private_set_alloc_checking.h> -#ifdef DEBUGUSEBFD -#include <libcw/class_location.h> #endif +#ifndef LIBCW_CLASS_MEMBLK_TYPES_H +#include <libcw/class_memblk_types.h> +#endif +#if defined(DEBUGMARKER) && !defined(LIBCW_CLASS_MARKER_H) +#include <libcw/class_marker.h> +#endif namespace libcw { namespace debug { // Forward declaration class type_info_ct; - -//=================================================================================================== -// Flags used to mark the type of `memblk': -// - -// If you change this, then also edit `expected_from' in debugmalloc.cc! -enum memblk_types_nt { - memblk_type_new, // Allocated with `new' - memblk_type_deleted, // Deleted with `delete' - memblk_type_new_array, // Allocated with `new[]' - memblk_type_deleted_array, // Deleted with `delete[]' - memblk_type_malloc, // Allocated with `malloc' - memblk_type_realloc, // Reallocated with `realloc' - memblk_type_freed, // Freed with `free' -#ifdef DEBUGMARKER - memblk_type_marker, // A memory allocation "marker" - memblk_type_deleted_marker, // A deleted memory allocation "marker" -#endif - memblk_type_external // Externally allocated with `malloc' (no magic numbers!) -}; - -class dm_alloc_ct; - -class memblk_types_ct { -private: - memblk_types_nt memblk_type; -public: - memblk_types_ct(memblk_types_nt mbt) : memblk_type(mbt) { } - memblk_types_nt operator()(void) const { return memblk_type; } -}; - -extern ::std::ostream& operator<<(::std::ostream& os, memblk_types_ct); - -__inline__ -::std::ostream& -operator<<(::std::ostream& os, memblk_types_nt memblk_type) -{ - return os << memblk_types_ct(memblk_type); -} - -//=================================================================================================== -// -// The class which describes allocated memory blocks. -// - -class alloc_ct { -protected: - void const* a_start; // Duplicate of (original) memblk_key_ct - size_t a_size; // Duplicate of (original) memblk_key_ct - memblk_types_nt a_memblk_type; // A flag which indicates the type of allocation - type_info_ct const* type_info_ptr; // Type info of related object - lockable_auto_ptr<char, true> a_description; // A label describing this memblk -#ifdef DEBUGUSEBFD - location_ct M_location; // Source file, function and line number from where - // the allocator was called from -#endif -public: - alloc_ct(void const* s, size_t sz, memblk_types_nt type, type_info_ct const& ti) : - a_start(s), a_size(sz), a_memblk_type(type), type_info_ptr(&ti) { } - size_t size(void) const { return a_size; } - void const* start(void) const { return a_start; } - memblk_types_nt memblk_type(void) const { return a_memblk_type; } - type_info_ct const& type_info(void) const { return *type_info_ptr; } - char const* description(void) const { return a_description.get(); } -#ifdef DEBUGUSEBFD - location_ct& location_reference(void) { return M_location; } - location_ct const& location(void) const { return M_location; } -#endif -protected: - virtual ~alloc_ct() {} -}; - -#ifdef DEBUGMARKER -class marker_ct { -private: - void register_marker(char const* label); -public: - marker_ct(char const* label) - { - register_marker(label); - } - marker_ct(void) - { - register_marker("An allocation marker"); - } - ~marker_ct(void); -}; -#endif +/** \interface malloc_report debug.h libcw/debug.h + * \brief writing total ammount of allocated memory to an ostream. + * + * \par Example: + * \n + * \code + * Dout(dc::malloc, malloc_report << '.'); + * \endcode + * + * will output something like + * + * \outputexample + * Allocated 4350 bytes in 7 blocks. + * \endoutputexample + */ class debugmalloc_report_ct { friend ::std::ostream& operator<<(::std::ostream& o, debugmalloc_report_ct); }; ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-11-17 00:31:10
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-10-17 00:31:09 UTC Modified files: Tag: branch-threading libcwd/documentation/doxygen.config libcwd/include/libcw/debugmalloc.h Log message: Bug fix (thanks Eric). ---------------------- diff included ---------------------- Index: src/libcwd/documentation/doxygen.config diff -u src/libcwd/documentation/doxygen.config:1.1.2.4 src/libcwd/documentation/doxygen.config:1.1.2.5 --- src/libcwd/documentation/doxygen.config:1.1.2.4 Fri Nov 16 16:14:29 2001 +++ src/libcwd/documentation/doxygen.config Fri Nov 16 16:30:59 2001 @@ -147,8 +147,8 @@ MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = +INCLUDE_PATH = ../include +INCLUDE_FILE_PATTERNS = *.h PREDEFINED = CWDEBUG \ LIBCW_DOXYGEN \ __inline__=inline \ Index: src/libcwd/include/libcw/debugmalloc.h diff -u src/libcwd/include/libcw/debugmalloc.h:1.28.2.31 src/libcwd/include/libcw/debugmalloc.h:1.28.2.32 --- src/libcwd/include/libcw/debugmalloc.h:1.28.2.31 Fri Nov 16 16:14:29 2001 +++ src/libcwd/include/libcw/debugmalloc.h Fri Nov 16 16:30:59 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debugmalloc.h,v 1.28.2.31 2001/11/17 00:14:29 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/debugmalloc.h,v 1.28.2.32 2001/11/17 00:30:59 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -22,15 +22,11 @@ #error "Don't include <libcw/debugmalloc.h> directly, include the appropriate \"debug.h\" instead." #endif +#ifndef LIBCW_DEBUG_CONFIG_H #include <libcw/debug_config.h> -#ifndef DEBUGMALLOC -#error "nonsense!" #endif -#ifdef DEBUGMALLOC -/** \interface foobar - * \brief test interface - */ +#ifdef DEBUGMALLOC #ifndef LIBCW_CSTDDEF #define LIBCW_CSTDDEF ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-11-20 04:32:53
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-10-20 04:32:50 UTC Modified files: Tag: branch-threading libcwd/debug.cc libcwd/debugmalloc.cc libcwd/demangle3.cc libcwd/documentation/custom-debug.h.dox libcwd/documentation/downloading.dox libcwd/documentation/doxygen.config libcwd/documentation/mainpage.dox libcwd/documentation/nested.dox libcwd/documentation/preparation.dox 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_debug.h libcwd/include/libcw/class_debug_string.h libcwd/include/libcw/class_location.h libcwd/include/libcw/class_marker.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/max_label_len.h libcwd/include/libcw/pc_mangled_function_name.h libcwd/include/libcw/sysd.ho.in libcwd/include/libcw/type_info.h Added files: Tag: branch-threading libcwd/documentation/deallocation_pointer_validation.dox libcwd/documentation/location.dox libcwd/documentation/memory_leak_checking.dox libcwd/documentation/doxygen-examples/markers.cc libcwd/include/libcw/enum_memblk_types.h Removed files: Tag: branch-threading libcwd/include/libcw/class_memblk_types.h Log message: Work in progress on the doxygen documentation. ---------------------- diff included ---------------------- Index: src/libcwd/debug.cc diff -u src/libcwd/debug.cc:1.46.2.37 src/libcwd/debug.cc:1.46.2.38 --- src/libcwd/debug.cc:1.46.2.37 Tue Nov 13 19:01:06 2001 +++ src/libcwd/debug.cc Mon Nov 19 20:32:39 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.46.2.37 2001/11/14 03:01:06 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.46.2.38 2001/11/20 04:32:39 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -995,7 +995,6 @@ * \brief List all %debug %channels to a given %debug stream object. * * \par Example: - * \n * * \code * Dout( list_channels_on(libcw_do) ); // libcw_do is the (default) debug stream object of libcwd. Index: src/libcwd/debugmalloc.cc diff -u src/libcwd/debugmalloc.cc:1.61.2.43 src/libcwd/debugmalloc.cc:1.61.2.44 --- src/libcwd/debugmalloc.cc:1.61.2.43 Fri Nov 16 16:14:28 2001 +++ src/libcwd/debugmalloc.cc Mon Nov 19 20:32:39 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.61.2.43 2001/11/17 00:14:28 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.61.2.44 2001/11/20 04:32:39 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -469,9 +469,9 @@ from_free // memblk_type_external }; -std::ostream& operator<<(std::ostream& os, memblk_types_ct memblk_type) +std::ostream& operator<<(std::ostream& os, memblk_types_nt memblk_type) { - switch(memblk_type()) + switch(memblk_type) { case memblk_type_new: os << "memblk_type_new"; @@ -1550,7 +1550,6 @@ * \brief List all current allocations to a given %debug stream object. * * \par Example: - * \n * * \code * Debug( list_allocations_on(libcw_do) ); // libcw_do is the (default) debug stream object of libcwd. @@ -1620,24 +1619,6 @@ __libcwd_tsd.internal = 0; } -/** \interface make_all_allocations_invisible_except debug.h libcw/debug.h - * - * \brief Make all current allocations invisible except the given pointer. - * - * All allocations, except the given pointer, are made invisible; they won't show up - * anymore in the \link list_allocations_on Memory Allocation Overview \endlink. - * - * If you want to make \em all allocations invisible, just pass \c NULL as parameter. - * - * \par Example: - * \n - * - * \code - * Debug( make_all_allocations_invisible_except(NULL) ); - * \endcode - * - * \sa list_allocations_on - */ void make_all_allocations_invisible_except(void const* ptr) { LIBCWD_TSD_DECLARATION Index: src/libcwd/demangle3.cc diff -u src/libcwd/demangle3.cc:1.8.2.15 src/libcwd/demangle3.cc:1.8.2.16 --- src/libcwd/demangle3.cc:1.8.2.15 Sat Oct 20 20:14:01 2001 +++ src/libcwd/demangle3.cc Mon Nov 19 20:32:39 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/demangle3.cc,v 1.8.2.15 2001/10/21 03:14:01 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/demangle3.cc,v 1.8.2.16 2001/11/20 04:32:39 libcw Exp $ // // Copyright (C) 2001, by // @@ -11,19 +11,28 @@ // packaging of this file. // +/*! +\addtogroup demangle + +Libcwd comes with its own demangler functions. + +demangle_type() writes the \em mangled type name \p input +to the string \p output; \p input should be the mangled name +as returned by <CODE>typeid(OBJECT).name()</CODE> (using gcc-2.95.1 or higher). + +demangle_symbol() writes the \em mangled symbol name \p input +to the string \p output; \p input should be the mangled name +as returned by <CODE>asymbol::name</CODE> (\c asymbol is a structure defined +by libbfd), which is what is returned by \ref location_ct::mangled_function_name() +and pc_mangled_function_name(). + +The direct use of these functions should be avoided, instead use the +function \ref type_info_of. + +*/ + // -// void demangle_type(char const* in, std::string& out); -// -// where, `in' is a mangled type name as returned by typeid(OBJECT).name(), -// `in' does not have to be null terminated. When `in' is NULL then the string "(null)" is returned. -// -// void demangle_symbol(char const* in, std::string& out); -// -// where, `in' is a mangled symbol name as returned by asymbol::name (where asymbol is defined by libbfd), -// which is the same as `location_st::func'. Note that `in' must be null terminated. When `in' is NULL -// then the string "(null)" is returned. -// -// Currently this file has been tested with gcc-3.0. +// This file has been tested with gcc-3.0. // // The description of how the mangling is done in the new ABI was found on // http://www.codesourcery.com/cxx-abi/abi.html#mangling Index: src/libcwd/documentation/custom-debug.h.dox diff -u src/libcwd/documentation/custom-debug.h.dox:1.1.2.1 src/libcwd/documentation/custom-debug.h.dox:1.1.2.2 --- src/libcwd/documentation/custom-debug.h.dox:1.1.2.1 Tue Nov 13 19:01:07 2001 +++ src/libcwd/documentation/custom-debug.h.dox Mon Nov 19 20:32:39 2001 @@ -1,140 +1,143 @@ // Work around for bug in doxygen. #define debug somethingelse -/** \page custom_debug_h The Custom debug.h file - * - * \section debug_channels_and_namespace Debug channels and namespace - * - * \subsection applications Applications - * - * User applications have less strict requirements than libraries, because nobody else will link with it. - * The developer of an application directly controls and checks and resolves name collisions when needed. - * If you are writing an end-application then you are still urged to create a header file - * called %debug.h and use \em that in your source files, instead of including <libcw/debug.h> directly. - * You will benefit greatly from this in terms on flexibility (trust me). - * - * \sa \ref preparation - * - * \subsection libraries Libraries - * - * Libraries that use libcwd should not put their debug channels in libcw::debug::channels::dc. - * The correct way to declare new debug channels is by putting them in a namespace of the library and - * providing new macros for writing debug output. - * Also end applications will benefit by using this method (in terms of flexibility). - * - * The following code would define a debug channel \c warp in the namespace \c libexample: - * - * \code - * namespace libexample { - * namespace channels { - * namespace dc { - * ::libcw::debug::channel_ct warp("WARP"); - * } - * } - * } - * \endcode - * - * Then provide a debug header file (%debug.h) with the following: - * - * \code - * #ifndef LIBEXAMPLE_DEBUG_H - * #define LIBEXAMPLE_DEBUG_H - * - * #ifndef DEBUGCHANNELS - * #define DEBUGCHANNELS ::libexample::channels - * #endif - * #include <libcw/debug.h> - * - * namespace libexample { - * namespace channels { - * namespace dc { - * using namespace libcw::debug::channels::dc; - * extern libcw::debug::channel_ct warp; - * } - * } - * } - * - * // Define private debug output macros for use in header files of the library, - * // there is no reason to do this for normal applications. - * #ifdef CWDEBUG - * #define LibExampleDout(cntrl, data) \ - * LibcwDout(libexample::channels, libcw::debug::libcw_do, cntrl, data) - * #define LibExampleDoutFatal(cntrl, data) \ - * LibcwDoutFatal(libexample::channels, libcw::debug::libcw_do, cntrl, data) - * #else - * #define LibExampleDout(cntrl, data) - * #define LibExampleDoutFatal(cntrl, data) LibcwDoutFatal(::std, , cntrl, data) - * #endif - * - * #endif // LIBEXAMPLE_DEBUG_H - * \endcode - * - * This will make your debug channels available in the usual way (by using Dout and friends. - * LibExampleDout and friends are only for use in the header files of `libexample' itself) avoiding any linker name collisions. - * - * \subsection header_files_of_libraries Header files of libraries - * - * Don't use Dout etc. in header files of libraries, instead use (for example) LibExampleDout etc., as shown above. - * It is advisable not to include any %debug.h in your headerfiles. - * Instead, add the following lines to each header file that needs debugging: - * - * \code - * #ifndef LIBEXAMPLE_DEBUG_H - * #error "You need to include the appropriate debug.h in the source file, before including this header file." - * #endif - * \endcode - * - * Don't use "libexample/%debug.h" in this error message because someone else might write a library that is using your library and needs - * a different %debug.h to be included in end applications. - * - * \subsection debug_channel_name_collisions Debug channel name collisions - * - * The reason that libcwd uses the convention to put debug channels in the namespace dc is to avoid collisions between debug channel - * names of libraries. - * There are two types of name collisions possible: you upgrade or start to use a library which uses a debug channel - * that you had already defined, in that case you might need to change the name of your own channel, or you link with two or more - * libraries that both use libcwd and that defined the same debug channel, in that case you will have to make your own debug - * namespace as shown above and choose a new name for one of the channels. - * - * For example, suppose you link with two libraries: lib1 and lib2 who use the above convention and defined their own namespaces called - * lib1 and lib2, but both defined a debug channel called foobar. - * Then you can rename these channels as follows. - * Make a debug header file that contains: - * - * \code - * #ifndef DEBUGCHANNELS - * #define DEBUGCHANNELS ::application::channels - * #endif - * #include <lib1/debug.h> - * #include <lib2/debug.h> - * namespace application { - * namespace channels { - * namespace dc { - * using namespace ::lib1::channels::dc; - * using namespace ::lib2::channels::dc; - * static libcw::debug::channel_ct& foobar1(::lib1::channels::dc::foobar) __attribute__ ((unused)); - * static libcw::debug::channel_ct& foobar2(::lib2::channels::dc::foobar) __attribute__ ((unused)); - * } - * } - * } - * \endcode - * - * \htmlonly - * <DIV class="normal"> - * \endhtmlonly - * The hiding mechanism of the above `cascading' of debug channel declarations of libraries works as follows. - * The debug macros use a using-directive to include the scope DEBUGCHANNELS. - * Because all debug channels are specified as <CODE>dc::channelname</CODE> - * (and there is no <CODE>using namespace someother::dc</CODE> in name space DEBUGCHANNELS!), the namespace \c dc is uniquely defined. - * For instance, in the case of the above example, when writing <CODE>dc::%notice</CODE> the \c dc will be unambiguously resolved to - * <CODE>application::debug::channels::dc</CODE>, because it is the only \c dc name space in DEBUGCHANNELS - * (<CODE>application::debug::channels</CODE>). - * The C++ standard states: "During the lookup of a name qualified by a namespace name, declarations that would otherwise be made - * visible by a using-directive can be hidden by declarations with the same name in the namespace containing the using-directive;". - * This allows us to put a list of using-directives in <CODE>application::debug::channels::dc</CODE> and then hide any collision by - * redefining it in <CODE>application::debug::channels::dc</CODE> itself, either as new debug channel, or as reference to one of the - * %debug %channels of the library of choice. - * \htmlonly - * </DIV> - * \endhtmlonly - */ +/*! + +\page custom_debug_h The Custom debug.h file + +\section debug_channels_and_namespace Debug channels and namespace + +\subsection applications Applications + +User applications have less strict requirements than libraries, because nobody else will link with it. +The developer of an application directly controls and checks and resolves name collisions when needed. +If you are writing an end-application then you are still urged to create a header file +called %debug.h and use \em that in your source files, instead of including <libcw/debug.h> directly. +You will benefit greatly from this in terms on flexibility (trust me). + +\sa \ref preparation + +\subsection libraries Libraries + +Libraries that use libcwd should not put their debug channels in libcw::debug::channels::dc. +The correct way to declare new debug channels is by putting them in a namespace of the library and +providing new macros for writing debug output. +Also end applications will benefit by using this method (in terms of flexibility). + +The following code would define a debug channel \c warp in the namespace \c libexample: + +\code +namespace libexample { + namespace channels { + namespace dc { + ::libcw::debug::channel_ct warp("WARP"); + } + } +} +\endcode + +Then provide a debug header file (%debug.h) with the following: + +\code +#ifndef LIBEXAMPLE_DEBUG_H +#define LIBEXAMPLE_DEBUG_H + +#ifndef DEBUGCHANNELS +#define DEBUGCHANNELS ::libexample::channels +#endif +#include <libcw/debug.h> + +namespace libexample { + namespace channels { + namespace dc { + using namespace libcw::debug::channels::dc; + extern libcw::debug::channel_ct warp; + } + } +} + +// Define private debug output macros for use in header files of the library, +// there is no reason to do this for normal applications. +#ifdef CWDEBUG +#define LibExampleDout(cntrl, data) \ + LibcwDout(libexample::channels, libcw::debug::libcw_do, cntrl, data) +#define LibExampleDoutFatal(cntrl, data) \ + LibcwDoutFatal(libexample::channels, libcw::debug::libcw_do, cntrl, data) +#else +#define LibExampleDout(cntrl, data) +#define LibExampleDoutFatal(cntrl, data) LibcwDoutFatal(::std, , cntrl, data) +#endif + +#endif // LIBEXAMPLE_DEBUG_H +\endcode + +This will make your debug channels available in the usual way (by using Dout and friends. +LibExampleDout and friends are only for use in the header files of `libexample' itself) avoiding any linker name collisions. + +\subsection header_files_of_libraries Header files of libraries + +Don't use Dout etc. in header files of libraries, instead use (for example) LibExampleDout etc., as shown above. +It is advisable not to include any %debug.h in your headerfiles. +Instead, add the following lines to each header file that needs debugging: + +\code +#ifndef LIBEXAMPLE_DEBUG_H +#error "You need to include the appropriate debug.h in the source file, before including this header file." +#endif +\endcode + +Don't use "libexample/%debug.h" in this error message because someone else might write a library that is using your library and needs +a different %debug.h to be included in end applications. + +\subsection debug_channel_name_collisions Debug channel name collisions + +The reason that libcwd uses the convention to put debug channels in the namespace dc is to avoid collisions between debug channel +names of libraries. +There are two types of name collisions possible: you upgrade or start to use a library which uses a debug channel +that you had already defined, in that case you might need to change the name of your own channel, or you link with two or more +libraries that both use libcwd and that defined the same debug channel, in that case you will have to make your own debug +namespace as shown above and choose a new name for one of the channels. + +For example, suppose you link with two libraries: lib1 and lib2 who use the above convention and defined their own namespaces called +lib1 and lib2, but both defined a debug channel called foobar. +Then you can rename these channels as follows. +Make a debug header file that contains: + +\code +#ifndef DEBUGCHANNELS +#define DEBUGCHANNELS ::application::channels +#endif +#include <lib1/debug.h> +#include <lib2/debug.h> +namespace application { + namespace channels { + namespace dc { + using namespace ::lib1::channels::dc; + using namespace ::lib2::channels::dc; + static libcw::debug::channel_ct& foobar1(::lib1::channels::dc::foobar) __attribute__ ((unused)); + static libcw::debug::channel_ct& foobar2(::lib2::channels::dc::foobar) __attribute__ ((unused)); + } + } +} +\endcode + +\htmlonly +<DIV class="normal"> +\endhtmlonly +The hiding mechanism of the above `cascading' of debug channel declarations of libraries works as follows. +The debug macros use a using-directive to include the scope DEBUGCHANNELS. +Because all debug channels are specified as <CODE>dc::channelname</CODE> +(and there is no <CODE>using namespace someother::dc</CODE> in name space DEBUGCHANNELS!), the namespace \c dc is uniquely defined. +For instance, in the case of the above example, when writing <CODE>dc::%notice</CODE> the \c dc will be unambiguously resolved to +<CODE>application::debug::channels::dc</CODE>, because it is the only \c dc name space in DEBUGCHANNELS +(<CODE>application::debug::channels</CODE>). +The C++ standard states: "During the lookup of a name qualified by a namespace name, declarations that would otherwise be made +visible by a using-directive can be hidden by declarations with the same name in the namespace containing the using-directive;". +This allows us to put a list of using-directives in <CODE>application::debug::channels::dc</CODE> and then hide any collision by +redefining it in <CODE>application::debug::channels::dc</CODE> itself, either as new debug channel, or as reference to one of the +%debug %channels of the library of choice. +\htmlonly +</DIV> +\endhtmlonly + +*/ Index: src/libcwd/documentation/deallocation_pointer_validation.dox diff -u /dev/null src/libcwd/documentation/deallocation_pointer_validation.dox:1.1.2.1 --- /dev/null Mon Nov 19 20:32:50 2001 +++ src/libcwd/documentation/deallocation_pointer_validation.dox Mon Nov 19 20:32:39 2001 @@ -0,0 +1,47 @@ +/*! + +\page deallocation_pointer_validation De-allocation pointer validation + +A pointer passed to a de-allocation (or re-allocation) function is checked to be valid; +it should be previously returned by a corresponding (re-)allocation function and not +have been de-allocated before. +Table 1. shows the relationships between allocation and de-allocation functions. + +\htmlonly +<h5 ALIGN=CENTER>Table 1. De-allocation functions and their corresponding allocation functions</h5> +<center> +<table BGCOLOR=Wheat BORDERCOLOR=#503c2c WIDTH=577 BORDER=1 CELLPADDING=4 CELLSPACING=0> +<tr> +<td BGCOLOR="#a98061"><font COLOR="#ffffff">De- or re-allocation function</font></td> +<td BGCOLOR="#a98061"><font COLOR="#ffffff">Allocation function</font></td> +</tr> +<tr> +<td><span class="code">delete</span></td> +<td><span class="code">new</span></td> +</tr> +<tr> +<td><span class="code">delete []</span></td> +<td><span class="code">new []</span></td> +</tr> +<tr> +<td><span class="code">free()</span></td> +<td><span class="code">malloc()</span>, <span class="code">calloc()</span> or <span class="code">realloc()</span></td> +</tr> +<tr> +<td><span class="code">realloc()</span></td> +<td><span class="code">malloc()</span>, <span class="code">calloc()</span> or <span class="code">realloc()</span></td> +</tr> +</table> +</center> +\endhtmlonly + +The application will terminate with an informative message and a core dump when +a pointer is de-allocated that was not previously allocated with the corresponding allocation function. + +Note: When libcwd was configured with \link enable_libcwd_magic --disable-libcwd-magic \endlink +then the check whether or not the de-allocated memory block was allocated with the corresponding +allocation function is \em not performed when the memory block is \ref invisible. +The reason for this is that invisible memory blocks are simply not stored in the internal data structure: +No information is known about them. + +*/ Index: src/libcwd/documentation/downloading.dox diff -u src/libcwd/documentation/downloading.dox:1.1.2.1 src/libcwd/documentation/downloading.dox:1.1.2.2 --- src/libcwd/documentation/downloading.dox:1.1.2.1 Tue Nov 13 19:01:07 2001 +++ src/libcwd/documentation/downloading.dox Mon Nov 19 20:32:39 2001 @@ -1,4 +1,7 @@ -/** \page downloading Downloading - * - * For now, download libcwd from sourceforge at http://sourceforge.net/project/showfiles.php?group_id=354 - */ +/*! + +\page downloading Downloading + +For now, download libcwd from sourceforge at http://sourceforge.net/project/showfiles.php?group_id=354 + +*/ Index: src/libcwd/documentation/doxygen-examples/markers.cc diff -u /dev/null src/libcwd/documentation/doxygen-examples/markers.cc:1.1.2.1 --- /dev/null Mon Nov 19 20:32:50 2001 +++ src/libcwd/documentation/doxygen-examples/markers.cc Mon Nov 19 20:32:39 2001 @@ -0,0 +1,68 @@ +#include <libcw/sysd.h> +#include <libcw/debug.h> + +// A dummy class +class A { + int i; + int j; + char k; +}; + +int main(int argc, char* argv[]) +{ + // Don't show allocations that are allocated before main() + Debug( make_all_allocations_invisible_except(NULL) ); + + // Select channels + ForAllDebugChannels( if (debugChannel.is_on()) debugChannel.off() ); + Debug( dc::notice.on() ); + Debug( dc::malloc.on() ); + Debug( dc::warning.on() ); + // Debug( dc::bfd.on() ); + + // Write debug output to cout + Debug( libcw_do.set_ostream(&cout) ); + + // Turn debug object on + Debug( libcw_do.on() ); + + // Allocate new object + A* a1 = new A; + AllocTag(a1, "First created"); + +#ifdef DEBUGMARKER + // Create marker + libcw::debug::marker_ct* marker = new libcw::debug::marker_ct("A test marker"); +#endif + + // Allocate more objects + A* a2 = new A[10]; + AllocTag(a2, "Created after the marker"); + int* p = new int[30]; + AllocTag(p, "Created after the marker"); + + // Show Memory Allocation Overview + Debug( list_allocations_on(libcw_do) ); + + Dout(dc::notice, "Moving the int array outside of the marker..."); +#ifdef DEBUGMARKER + Debug( move_outside(marker, p) ); +#endif + + // Show Memory Allocation Overview + Debug( list_allocations_on(libcw_do) ); + +#ifdef DEBUGMARKER + // Delete the marker + delete marker; +#endif + +#ifdef DEBUGMALLOC + Dout(dc::notice, "Finished successfully."); +#else + DoutFatal(dc::fatal, "Please define DEBUGMALLOC."); +#endif + return 0; +} + + Index: src/libcwd/documentation/doxygen.config diff -u src/libcwd/documentation/doxygen.config:1.1.2.5 src/libcwd/documentation/doxygen.config:1.1.2.6 --- src/libcwd/documentation/doxygen.config:1.1.2.5 Fri Nov 16 16:30:59 2001 +++ src/libcwd/documentation/doxygen.config Mon Nov 19 20:32:39 2001 @@ -19,9 +19,6 @@ STRIP_FROM_PATH = /home/carlo/c++/libcw_branch-threading/src/libcwd/include/ \ /home/carlo/c++/libcw_branch-threading/src/libcwd/ INTERNAL_DOCS = NO -CLASS_DIAGRAMS = YES -SOURCE_BROWSER = NO -INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES CASE_SENSE_NAMES = YES SHORT_NAMES = NO @@ -56,36 +53,32 @@ #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = ../include/libcw/buf2str.h \ - ../include/libcw/char2str.h \ - ../include/libcw/cwprint.h \ - ../include/libcw/debug.h \ - ../debug.cc \ - ../include/libcw/class_debug.h \ - ../include/libcw/control_flag.h \ - ../include/libcw/class_channel.h \ - ../include/libcw/debug_config.h \ +INPUT = ../debug.cc \ ../debugmalloc.cc \ - ../include/libcw/macro_ForAllDebugChannels.h \ - ../include/libcw/macro_ForAllDebugObjects.h \ ../bfd.cc \ - ../include/libcw/class_debug_string.h \ - ../include/libcw/class_fatal_channel.h \ - ../include/libcw/class_continued_channel.h \ - ../include/libcw/class_channel_set.h \ . \ - ../include/libcw/debugmalloc.h -FILE_PATTERNS = *.dox + ../include/libcw \ + ../demangle3.cc +FILE_PATTERNS = *.dox \ + *.h RECURSIVE = NO EXCLUDE = EXCLUDE_PATTERNS = EXAMPLE_PATH = external \ doxygen-examples EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO IMAGE_PATH = INPUT_FILTER = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +#--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = NO @@ -165,10 +158,12 @@ #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES HAVE_DOT = YES CLASS_GRAPH = YES COLLABORATION_GRAPH = YES TEMPLATE_RELATIONS = YES +HIDE_UNDOC_RELATIONS = YES INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES GRAPHICAL_HIERARCHY = YES Index: src/libcwd/documentation/location.dox diff -u /dev/null src/libcwd/documentation/location.dox:1.1.2.1 --- /dev/null Mon Nov 19 20:32:50 2001 +++ src/libcwd/documentation/location.dox Mon Nov 19 20:32:39 2001 @@ -0,0 +1,46 @@ +/*! + +\page Source_file_and_line_number_information Source file and line number information + +\section BFD_library The BFD library + +Libcwd attempts to determine the source file and line number where memory is allocated. +It does this by directly reading the .stabs section of the ELF32 object files. +If you are using an Operating System that isn't ELF then you need to enable the use of libbfd for +this to work by configuring libcwd with \link enable_libcwd_libbfd --enable-libcwd-libbfd \endlink. +If you don't have an ELF system and you don't have libbfd installed and are not able to install it +yourself (note: you also need libiberty and libdl) then you can disable it +using \link enable_libcwd_location --disable-libcwd-location \endlink. +There is a seperate \link BFD chapter \endlink that deals with libcwd and <EM>location</EM> support. +This paragraph describes the effect of disabling source file and line number location support in +relation to the memory allocation debugging support. + +\section With_location_support With location support + +With \link enable_libcwd_location --enable-libcwd-location \endlink, libcwd +will write the source file and line number information about where memory allocations are done to the +\link Debug_Channel_objects debug channel \endlink \link libcw::debug::channels::dc::bfd dc::bfd \endlink. + +For example, + +\exampleoutput <PRE> +MALLOC : operator new (size = 4) = <unfinished> +BFD : 0x804bc9b is at (deb.cc:179) +MALLOC : <continued> 0x8137220</PRE> +\endexampleoutput + +which means that <CODE>operator new</CODE> was called +at address 0x804bc9b corresponding to line 179 of source file <TT>deb.cc</TT>. + +Source file and line number information is also shown in the \link Allocated_memory_Overview Allocated memory Overview \endlink +and when a memory block is freed. + +\section Without_location_support Without location support + +Without support the source file and line number information will not be available. +%Debug channel \link libcw::debug::channels::dc::bfd dc::bfd \endlink doesn't exist and +the Allocated memory Overview will lack the source file location in column three. +Finally, there will be no \link libcw::debug::alloc_ct::location alloc_ct::location() \endlink method. + +*/ + Index: src/libcwd/documentation/mainpage.dox diff -u src/libcwd/documentation/mainpage.dox:1.1.2.2 src/libcwd/documentation/mainpage.dox:1.1.2.3 --- src/libcwd/documentation/mainpage.dox:1.1.2.2 Tue Nov 13 19:58:39 2001 +++ src/libcwd/documentation/mainpage.dox Mon Nov 19 20:32:39 2001 @@ -1,48 +1,50 @@ -/*! \mainpage An Object Oriented Debugging library - * - * \section intro Introduction - * - * Libcwd is a full-featured debugging support library for C++ developers. - * It includes ostream-based debug output with custom debug channels - * and devices, powerful memory allocation debugging support, as - * well as run-time support for printing source-%file:line-number information - * and demangled type names. - * - * \section mainpage_links Links - * - * \li \ref downloading - * \li \ref preparation - * \li \ref reference - * - * \section output_example Example output - * - * \htmlonly - * <CODE> - * <PRE> - * MALLOC : malloc(72) = <unfinished> - * BFD : address 0x402ad017 corresponds to dl-open.c:114 - * MALLOC : <continued> 0x81c1330 - * BFD : Loading debug info from ./module.so (0x4031f000) ... done (206 symbols) - * MALLOC : malloc(310) = <unfinished> - * BFD : address 0x40325943 corresponds to module.cc:16 - * MALLOC : <continued> 0x81bfb68 - * MALLOC : malloc(300) = <unfinished> - * BFD : address 0x40325490 corresponds to module.cc:7 - * MALLOC : <continued> 0x817c490 - * MALLOC : Allocated memory: 1518 bytes in 10 blocks. - * malloc 0x817c490 module.cc:7 void*; (sz = 300) Allocated inside static_test_symbol - * malloc 0x81bfb68 module.cc:16 void*; (sz = 310) Allocated inside global_test_symbol - * malloc 0x81c1330 dl-open.c:114 <unknown type>; (sz = 72) - * malloc 0x81f52a8 dl-version.c:287 <unknown type>; (sz = 96) - * malloc 0x804f410 dl-deps.c:495 <unknown type>; (sz = 52) - * malloc 0x81c1290 dl-object.c:107 <unknown type>; (sz = 140) - * malloc 0x81c0d30 dl-object.c:41 <unknown type>; (sz = 24) - * malloc 0x81c05f8 dl-object.c:40 <unknown type>; (sz = 496) - * malloc 0x81f5288 dl-load.c:164 <unknown type>; (sz = 12) - * malloc 0x81c00a0 dlerror.c:108 <unknown type>; (sz = 16) - * NOTICE : Finished - * </PRE> - * </CODE> - * \endhtmlonly - * - */ +/*! + +\mainpage An Object Oriented Debugging library + +\section intro Introduction + +Libcwd is a full-featured debugging support library for C++ developers. +It includes ostream-based debug output with custom debug channels +and devices, powerful memory allocation debugging support, as +well as run-time support for printing source-%file:line-number information +and demangled type names. + +\section mainpage_links Links + +\li \ref downloading +\li \ref preparation +\li \ref reference + +\section output_example Example output + +\htmlonly +<CODE> +<PRE> +MALLOC : malloc(72) = <unfinished> +BFD : address 0x402ad017 corresponds to dl-open.c:114 +MALLOC : <continued> 0x81c1330 +BFD : Loading debug info from ./module.so (0x4031f000) ... done (206 symbols) +MALLOC : malloc(310) = <unfinished> +BFD : address 0x40325943 corresponds to module.cc:16 +MALLOC : <continued> 0x81bfb68 +MALLOC : malloc(300) = <unfinished> +BFD : address 0x40325490 corresponds to module.cc:7 +MALLOC : <continued> 0x817c490 +MALLOC : Allocated memory: 1518 bytes in 10 blocks. +malloc 0x817c490 module.cc:7 void*; (sz = 300) Allocated inside static_test_symbol +malloc 0x81bfb68 module.cc:16 void*; (sz = 310) Allocated inside global_test_symbol +malloc 0x81c1330 dl-open.c:114 <unknown type>; (sz = 72) +malloc 0x81f52a8 dl-version.c:287 <unknown type>; (sz = 96) +malloc 0x804f410 dl-deps.c:495 <unknown type>; (sz = 52) +malloc 0x81c1290 dl-object.c:107 <unknown type>; (sz = 140) +malloc 0x81c0d30 dl-object.c:41 <unknown type>; (sz = 24) +malloc 0x81c05f8 dl-object.c:40 <unknown type>; (sz = 496) +malloc 0x81f5288 dl-load.c:164 <unknown type>; (sz = 12) +malloc 0x81c00a0 dlerror.c:108 <unknown type>; (sz = 16) +NOTICE : Finished +</PRE> +</CODE> +\endhtmlonly + +*/ Index: src/libcwd/documentation/memory_leak_checking.dox diff -u /dev/null src/libcwd/documentation/memory_leak_checking.dox:1.1.2.1 --- /dev/null Mon Nov 19 20:32:50 2001 +++ src/libcwd/documentation/memory_leak_checking.dox Mon Nov 19 20:32:39 2001 @@ -0,0 +1,46 @@ +/*! + +\page memory_leak_checking Memory leak checking + +Libcwd does a weak attempt to support debugging of memory leaks. +I hope to greatly improve this in the future. + +It is possible to mark allocations that are done till that moment, and then later check for memory +leaks by expecting no other memory allocations than those that already existed before the mark. +This is done by creating a marker_ct object. +The check for memory leaks is done when the marker is removed again. +This can be done recursively. + +A \em marker is created by passing it a description: + +\code +#ifdef DEBUGMARKER + marker_ct* marker = marker_ct("Description of the marker"); +#endif +\endcode + +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). +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. +This is done with the function + +\code +namespace libcw { + namespace debug { + void move_outside(marker_ct* marker, void const* ptr); + } +} +\endcode + +which would move the memory allocation pointed to by ptr outside the test region of \c marker. + +A complete example program with output is given here: + +\include markers.cc + +*/ + Index: src/libcwd/documentation/nested.dox diff -u src/libcwd/documentation/nested.dox:1.1.2.1 src/libcwd/documentation/nested.dox:1.1.2.2 --- src/libcwd/documentation/nested.dox:1.1.2.1 Tue Nov 13 19:01:07 2001 +++ src/libcwd/documentation/nested.dox Mon Nov 19 20:32:39 2001 @@ -1,89 +1,92 @@ -/** \page nested_debug_calls Nested debug calls - * - * \section inside Calling functions inside Dout - * - * Consider the following code: - * - * \code - * int foobar(void) __attribute__ ((const)); - * - * int foobar(void) - * { - * Dout( dc::notice, "Entering foobar()" ); - * Dout( dc::notice, "Leaving foobar()" ); - * return 1; - * } - * - * int main(void) - * { - * Dout( dc::kernel, "The value of foobar() = " << foobar() - * << ", aint that nice?" ); - * return foobar(); - * } - * \endcode - * - * This code would start a new debug message before the previous debug message is finished. - * Libcwd detects this and will output: - * - * \exampleoutput <PRE> - * NOTICE: Entering foobar() - * NOTICE: Leaving foobar() - * KERNEL: The value of foobar() = 2, aint that nice?</PRE> - * \endexampleoutput - * - * Note the indentation and the fact that the printing of the label KERNEL was delayed. - * - * \section using_continued Using continued_cf, dc::continued and dc::finish - * - * In the previous section <CODE>foobar()</CODE> was a const function: it didn't matter - * whether or not it was called for the functionality of the application. But when - * it does matter, then one might want to do something like this: - * - * \code - * Dout( dc::kernel|flush_cf|continued_cf, "Generating tables... " ); - * generate_tables(); - * Dout( dc::finish, "done" ); - * \endcode - * - * If generate_tables() would not print debug messages, then the output will look like: - * - * \exampleoutput <PRE> - * KERNEL: Generating tables... done</PRE> - * \endexampleoutput - * - * When it does generated debug output, then the <unfinished> and <continued> labels are printed also: - * - * \exampleoutput <PRE> - * KERNEL: Generating tables... <unfinished> - * NOTICE: Inside generate_tables() - * KERNEL: <continued> done</PRE> - * \endexampleoutput - * - * Finally, it is also possible to split a debug line into more then two parts by using the special dc::continued debug channel. - * - * \code - * Dout( dc::notice|flush_cf|continued_cf, "Generating tables." ); - * for(int i = 0; i < 8; ++i) - * { - * generate_table(i); - * Dout( dc::continued, '.' ); - * } - * Dout( dc::finish, " done" ); - * \endcode - * - * When generate_table(i) doesn't print debug messages, then the output will look like: - * - * \exampleoutput <PRE> - * NOTICE: Generating tables......... done</PRE> - * \endexampleoutput - * - * When it does generate debug output, then each dot would be surrounded by a <continued> .<unfinished> : - * - * \exampleoutput <PRE> - * NOTICE: Generating tables.<unfinished> - * TABLE : Inside generate_table(0) - * NOTICE: <continued> .<unfinished></PRE> - * \endexampleoutput - * - * etc. - */ +/*! + +\page nested_debug_calls Nested debug calls + +\section inside Calling functions inside Dout + +Consider the following code: + +\code +int foobar(void) __attribute__ ((const)); + +int foobar(void) +{ + Dout( dc::notice, "Entering foobar()" ); + Dout( dc::notice, "Leaving foobar()" ); + return 1; +} + +int main(void) +{ + Dout( dc::kernel, "The value of foobar() = " << foobar() + << ", aint that nice?" ); + return foobar(); +} +\endcode + +This code would start a new debug message before the previous debug message is finished. +Libcwd detects this and will output: + +\exampleoutput <PRE> +NOTICE: Entering foobar() +NOTICE: Leaving foobar() +KERNEL: The value of foobar() = 2, aint that nice?</PRE> +\endexampleoutput + +Note the indentation and the fact that the printing of the label KERNEL was delayed. + +\section using_continued Using continued_cf, dc::continued and dc::finish + +In the previous section <CODE>foobar()</CODE> was a const function: it didn't matter +whether or not it was called for the functionality of the application. But when +it does matter, then one might want to do something like this: + +\code +Dout( dc::kernel|flush_cf|continued_cf, "Generating tables... " ); +generate_tables(); +Dout( dc::finish, "done" ); +\endcode + +If generate_tables() would not print debug messages, then the output will look like: + +\exampleoutput <PRE> +KERNEL: Generating tables... done</PRE> +\endexampleoutput + +When it does generated debug output, then the <unfinished> and <continued> labels are printed also: + +\exampleoutput <PRE> +KERNEL: Generating tables... <unfinished> +NOTICE: Inside generate_tables() +KERNEL: <continued> done</PRE> +\endexampleoutput + +Finally, it is also possible to split a debug line into more then two parts by using the special dc::continued debug channel. + +\code +Dout( dc::notice|flush_cf|continued_cf, "Generating tables." ); +for(int i = 0; i < 8; ++i) +{ + generate_table(i); + Dout( dc::continued, '.' ); +} +Dout( dc::finish, " done" ); +\endcode + +When generate_table(i) doesn't print debug messages, then the output will look like: + +\exampleoutput <PRE> +NOTICE: Generating tables......... done</PRE> +\endexampleoutput + +When it does generate debug output, then each dot would be surrounded by a <continued> .<unfinished> : + +\exampleoutput <PRE> +NOTICE: Generating tables.<unfinished> +TABLE : Inside generate_table(0) +NOTICE: <continued> .<unfinished></PRE> +\endexampleoutput + +etc. + +*/ Index: src/libcwd/documentation/preparation.dox diff -u src/libcwd/documentation/preparation.dox:1.1.2.1 src/libcwd/documentation/preparation.dox:1.1.2.2 --- src/libcwd/documentation/preparation.dox:1.1.2.1 Tue Nov 13 19:01:07 2001 +++ src/libcwd/documentation/preparation.dox Mon Nov 19 20:32:39 2001 @@ -1,45 +1,47 @@ -/** \page preparation Preparation - * - * This page describes the preparations that you need to perform - * before starting to use libcwd in your applications source code. - * - * \subsection installation Step 1: Installing libcwd - * - * Binairy distributions should be installed the usual way. - * - * If you are installing libcwd from source then please read the - * \htmlonly<A HREF="../external/INSTALL">\endhtmlonly - * INSTALL\htmlonly</A>\endhtmlonly - * file that is included in the source distribution.<BR> - * See also: \ref configuration - * - * \subsection header_files Step 2: Creating the custom header files - * - * You need to add two custom header files to your application.<BR> - * The recommended names are "%debug.h" and "sys.h". - * - * You can use the following templates for a quick start: - * - * \par sys.h example template - * \include sys.h - * \htmlonly «<A HREF="../external/sys.h">download</A>»\endhtmlonly - * - * \par debug.h example template - * \include debug.h - * \htmlonly «<A HREF="../external/debug.h">download</A>»\endhtmlonly - * - * This %debug.h file is for applications, for more detailed information and for information - * for library developers who want to use libbcwd, please also read \ref custom_debug_h. - * - * \subsection custom_debug_cc Step 3: Creating the custom source file - * - * If you added one or more custom %debug %channels to your namespace - * <CODE>DEBUGCHANNELS</CODE> in your custom "%debug.h", then of course you - * also need to add the definition somewhere. - * You can do that anywhere, or you could add a special source file for it. - * - * \par debug.cc example template - * \include debug.cc - * \htmlonly «<A HREF="../external/debug.cc">download</A>»\endhtmlonly - */ +/*! +\page preparation Preparation + +This page describes the preparations that you need to perform +before starting to use libcwd in your applications source code. + +\subsection installation Step 1: Installing libcwd + +Binairy distributions should be installed the usual way. + +If you are installing libcwd from source then please read the +\htmlonly<A HREF="../external/INSTALL">\endhtmlonly +INSTALL\htmlonly</A>\endhtmlonly +file that is included in the source distribution.<BR> +See also: \ref configuration + +\subsection header_files Step 2: Creating the custom header files + +You need to add two custom header files to your application.<BR> +The recommended names are "%debug.h" and "sys.h". + +You can use the following templates for a quick start: + +\par sys.h example template +\include sys.h +\htmlonly «<A HREF="../external/sys.h">download</A>»\endhtmlonly + +\par debug.h example template +\include debug.h +\htmlonly «<A HREF="../external/debug.h">download</A>»\endhtmlonly + +This %debug.h file is for applications, for more detailed information and for information +for library developers who want to use libbcwd, please also read \ref custom_debug_h. + +\subsection custom_debug_cc Step 3: Creating the custom source file + +If you added one or more custom %debug %channels to your namespace +<CODE>DEBUGCHANNELS</CODE> in your custom "%debug.h", then of course you +also need to add the definition somewhere. +You can do that anywhere, or you could add a special source file for it. + +\par debug.cc example template +\include debug.cc +\htmlonly «<A HREF="../external/debug.cc">download</A>»\endhtmlonly + +*/ Index: src/libcwd/include/libcw/buf2str.h diff -u src/libcwd/include/libcw/buf2str.h:1.5.2.7 src/libcwd/include/libcw/buf2str.h:1.5.2.8 --- src/libcwd/include/libcw/buf2str.h:1.5.2.7 Fri Oct 26 15:58:03 2001 +++ src/libcwd/include/libcw/buf2str.h Mon Nov 19 20:32:39 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/buf2str.h,v 1.5.2.7 2001/10/26 22:58:03 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/buf2str.h,v 1.5.2.8 2001/11/20 04:32:39 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -47,13 +47,12 @@ * \c \a, \c \b, \c \t, \c \n, \c \f, \c \r, \c \e or \c \\. * * \par Example: - * \code * + * \code * char const* buf = "\e[31m;Hello\e[0m;\n"; * size_t size = strlen(buf); * * Dout(dc::notice, "The buffer contains: \"" << buf2str(buf, size) << '"'); - * * \endcode * * \sa libcw::debug::char2str Index: src/libcwd/include/libcw/char2str.h diff -u src/libcwd/include/libcw/char2str.h:1.5.2.7 src/libcwd/include/libcw/char2str.h:1.5.2.8 --- src/libcwd/include/libcw/char2str.h:1.5.2.7 Fri Oct 26 15:58:03 2001 +++ src/libcwd/include/libcw/char2str.h Mon Nov 19 20:32:39 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/char2str.h,v 1.5.2.7 2001/10/26 22:58:03 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/char2str.h,v 1.5.2.8 2001/11/20 04:32:39 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -39,12 +39,11 @@ * \c \f, \c \r, \c \e or \c \\. * * \par Example: - * \code * + * \code * char c = '\f'; * * Dout(dc::notice, "The variable c contains: '" << char2str(c) << '\''); - * * \endcode * * \sa libcw::debug::buf2str Index: src/libcwd/include/libcw/class_alloc.h diff -u src/libcwd/include/libcw/class_alloc.h:1.1.2.1 src/libcwd/include/libcw/class_alloc.h:1.1.2.2 --- src/libcwd/include/libcw/class_alloc.h:1.1.2.1 Fri Nov 16 16:14:29 2001 +++ src/libcwd/include/libcw/class_alloc.h Mon Nov 19 20:32:39 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_alloc.h,v 1.1.2.1 2001/11/17 00:14:29 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_alloc.h,v 1.1.2.2 2001/11/20 04:32:39 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -19,7 +19,7 @@ #endif #ifndef LIBCW_CLASS_MEMBLK_TYPES_H -#include <libcw/class_memblk_types.h> // Needed for memblk_types_nt. +#include <libcw/enum_memblk_types.h> // Needed for memblk_types_nt. #endif #ifndef LIBCW_LOCKABLE_AUTO_PTR_H #include <libcw/lockable_auto_ptr.h> // Needed for lockable_auto_ptr<char, true>. @@ -60,19 +60,61 @@ public: alloc_ct(void const* s, size_t sz, memblk_types_nt type, type_info_ct const& ti) : a_start(s), a_size(sz), a_memblk_type(type), type_info_ptr(&ti) { } - /** \brief The allocated size in bytes. */ + + /** + * \brief The allocated size in bytes. + */ size_t size(void) const { return a_size; } - /** \brief A pointer to the start of the allocated memory block. */ + + /** + * \brief A pointer to the start of the allocated memory block. + */ void const* start(void) const { return a_start; } + + /** + * \brief A flag indicating the type of allocation. + * + * <CODE>memblk_type_marker</CODE> and <CODE>memblk_type_deleted_marker</CODE> + * only exist when libcwd was configured with \ref enable_libcwd_marker. + */ memblk_types_nt memblk_type(void) const { return a_memblk_type; } + + /** + * \brief A reference to the type info of the pointer to the allocated memory block. + * + * \returns a reference to the static \ref type_info_ct object that is returned by a call to \ref type_info_of(p1). + * Where \p p1 is the first parameter that was passed to \ref AllocTag(). + */ type_info_ct const& type_info(void) const { return *type_info_ptr; } + + /** + * \brief A pointer to a description of the allocated memory block. + * + * This is a character string that is the result of writing the second parameter of \ref AllocTag() to an ostrstream. + */ char const* description(void) const { return a_description.get(); } + #ifdef DEBUGUSEBFD + /** + * \brief The source file location that the allocator was called from. + * + * \returns a non-const \ref location_ct reference corresponding to the place where the allocation was done. + * Class\ref location_ct describes a source file and line number location and in which function that location resides. + * \sa \ref Source_file_and_line_number_information + */ location_ct& location_reference(void) { return M_location; } + + /** + * \brief The source file location that the allocator was called from. + * + * \returns a const \ref location_ct reference corresponding to the place where the allocation was done. + * Class \ref location_ct describes a source file and line number location and in which function that location resides. + * \sa \ref Source_file_and_line_number_information + */ location_ct const& location(void) const { return M_location; } #endif protected: - virtual ~alloc_ct() {} + virtual ~alloc_ct() { } }; } //namespace debug Index: src/libcwd/include/libcw/class_channel.h diff -u src/libcwd/include/libcw/class_channel.h:1.1.2.4 src/libcwd/include/libcw/class_channel.h:1.1.2.5 --- src/libcwd/include/libcw/class_channel.h:1.1.2.4 Tue Nov 13 19:01:08 2001 +++ src/libcwd/include/libcw/class_channel.h Mon Nov 19 20:32:39 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_channel.h,v 1.1.2.4 2001/11/14 03:01:08 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_channel.h,v 1.1.2.5 2001/11/20 04:32:39 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -53,7 +53,6 @@ * that these %channels actually represent. * * \par Example: - * \n * * \code * Dout( dc::notice, "Libcw is a great library" ); @@ -146,7 +145,14 @@ // Accessors // + /** + * \brief Pointer to the label of the %debug channel. + */ char const* get_label(void) const; + + /** + * \brief Returns `true' if the channel is active. + */ bool is_on(void) const; #ifdef _REENTRANT bool is_on(LIBCWD_TSD_PARAM) const; Index: src/libcwd/include/libcw/class_debug.h diff -u src/libcwd/include/libcw/class_debug.h:1.1.2.6 src/libcwd/include/libcw/class_debug.h:1.1.2.7 --- src/libcwd/include/libcw/class_debug.h:1.1.2.6 Tue Nov 13 19:01:08 2001 +++ src/libcwd/include/libcw/class_debug.h Mon Nov 19 20:32:39 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_debug.h,v 1.1.2.6 2001/11/14 03:01:08 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_debug.h,v 1.1.2.7 2001/11/20 04:32:39 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -163,7 +163,6 @@ * The suffix field could become for example ": EAGAIN (Try again)\\n". * * \par Example: - * \n * * \code * Debug( libcw_do.margin.assign("*** ", 4) ); @@ -347,7 +346,6 @@ * * \anchor eval_example * \par Example: - * \n * * \code * int i = 0; Index: src/libcwd/include/libcw/class_debug_string.h diff -u src/libcwd/include/libcw/class_debug_string.h:1.1.2.4 src/libcwd/include/libcw/class_debug_string.h:1.1.2.5 --- src/libcwd/include/libcw/class_debug_string.h:1.1.2.4 Fri Oct 26 15:58:03 2001 +++ src/libcwd/include/libcw/class_debug_string.h Mon Nov 19 20:32:39 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_debug_string.h,v 1.1.2.4 2001/10/26 22:58:03 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_debug_string.h,v 1.1.2.5 2001/11/20 04:32:39 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -34,6 +34,12 @@ struct debug_string_stack_element_ct; +/** \class debug_string_ct "debug.h" "debug.h" + * \brief A string class used for the %debug output margin and marker. + * + * This type is used for the public attributes \link libcw::debug::debug_ct::margin debug_ct::margin \endlink + * and \link libcw::debug::debug_ct::marker debug_ct::marker \endlink of the %debug object class. + */ class debug_string_ct { private: char* M_str; // Pointer to malloc-ed (zero terminated) string. @@ -59,18 +65,29 @@ debug_string_ct(debug_string_ct const& ds); public: + /** \brief The size of the string. */ size_t size(void) const; + /** \brief The capacity of the string. */ size_t capacity(void) const; + /** \brief Reserve memory for the string in advance. */ void reserve(size_t); + /** \brief A zero terminated char const pointer. */ char const* c_str(void) const; + /** \brief Assign \a str with size \a len to the string. */ void assign(char const* str, size_t len); + /** \brief Append \a str with size \a len to the string. */ void append(char const* str, size_t len); + /** \brief Prepend \a str with size \a len to the string. */ void prepend(char const* str, size_t len); + /** \brief Assign \s to the string. */ void assign(std::string const& s); + /** \brief Append \s to the string. */ void append(std::string const& s); + /** \brief Prepend \s to the string. */ void prepend(std::string const& s); }; +// Used for the margin and marker stacks. struct debug_string_stack_element_ct { public: debug_string_stack_element_ct* next; Index: src/libcwd/include/libcw/class_location.h diff -u src/libcwd/include/libcw/class_location.h:1.1.2.3 src/libcwd/include/libcw/class_location.h:1.1.2.4 --- src/libcwd/include/libcw/class_location.h:1.1.2.3 Fri Oct 26 15:58:03 2001 +++ src/libcwd/include/libcw/class_location.h Mon Nov 19 20:32:39 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_location.h,v 1.1.2.3 2001/10/26 22:58:03 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_location.h,v 1.1.2.4 2001/11/20 04:32:39 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -32,15 +32,18 @@ namespace libcw { namespace debug { +/** \brief This constant (pointer) is returned by location_ct::mangled_function_name() when no function is known. */ extern char const* const unknown_function_c; -// -// class location_ct -// -// The normal usage of this class is to print file-name:line-number information as follows: -// Dout(dc::notice, "Called from " << -// location_ct((char*)__builtin_return_address(0) + libcw::builtin_return_address_offset) ); -// +/** + * \brief A source file location. + * + * 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) ); + * \endcode + */ class location_ct { protected: char* M_filepath; // Allocated in `M_pc_location' using new [], or NULL when unknown. @@ -51,7 +54,7 @@ void M_pc_location(void const* addr LIBCWD_COMMA_TSD_PARAM); public: - // Constructor + /** \brief Construct a location for address \p addr. */ location_ct(void const* addr); // Construct a location object for address `addr'. #ifdef _REENTRANT @@ -59,7 +62,7 @@ // Idem, but with passing the TSD. #endif - // Destructor + /** \brief Destructor. */ ~location_ct(); // Provided, but deprecated (I honestly think you never need them): @@ -67,34 +70,43 @@ location_ct(location_ct const& location); // Copy constructor location_ct& operator=(location_ct const& location); // Assignment operator - void pc_location(void const* addr); - // Set this location object to a different address. + /** \brief Point this location to a different program counter address. */ + void pc_location(void const* pc); + /** \brief Reset this location object (frees memory). */ void clear(void); - // Reset this location object (frees memory). + /** + * \brief Move \p prototype to this location object; + * \p prototype must be known and the current object unknown; + * \p prototype is clear()-ed afterwards. + */ void move(location_ct& prototype); - // Move `prototype' to this location (must be created with the default constructor) and clear - // `prototype'. `prototype' must be known and this object not. public: // Accessors + /** + * \brief Returns <CODE>false</CODE> if no source-%file:line-number information is known for this location + * (or when it is uninitialized or clear()-ed). + */ bool is_known(void) const; - // Returns false if no source-file:line-number information is known for this location - // (or when it is uninitialized or cleared). + /** + * \brief Return the source file name (without path). We don't allow to retrieve a pointer + * to M_filepath; that is dangerous as the memory that it is pointing to could be deleted. + */ std::string file(void) const; - // Return the source file name (without path). We don't allow to retrieve a pointer - // to M_filepath; that is dangerous as the memory that it is pointing to could be deleted. + /** \brief Return the line number; only valid if is_known() returns true. */ unsigned int line(void) const; - // Return the line number; only valid if is_known() returns true. + /** \brief Return the mangled function name or `unknown_function_c' when no function could be found. + * + * Two other strings that can be returned are "<uninitialized location_ct>" and + * "<cleared location_ct>", the idea is to never print that: you should know it when a + * location object is in these states. + */ char const* mangled_function_name(void) const; - // Return the mangled function name or `unknown_function_c' when no function could be found. - // Two other strings that can be returned are "<uninitialized location_ct>" and - // "<cleared location_ct>", the idea is to never print that: you should know it when a - // location object is in these states. // Printing void print_filepath_on(std::ostream& os) const; Index: src/libcwd/include/libcw/class_marker.h diff -u src/libcwd/include/libcw/class_marker.h:1.1.2.1 src/libcwd/include/libcw/class_marker.h:1.1.2.2 --- src/libcwd/include/libcw/class_marker.h:1.1.2.1 Fri Nov 16 16:14:29 2001 +++ src/libcwd/include/libcw/class_marker.h Mon Nov 19 20:32:39 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_marker.h,v 1.1.2.1 2001/11/17 00:14:29 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_marker.h,v 1.1.2.2 2001/11/20 04:32:39 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -17,12 +17,18 @@ namespace libcw { namespace debug { +/** + * \brief A memory allocation marker. + */ class marker_ct { private: void register_marker(char const* label); public: + /** \brief Construct a marker with label \p label. */ marker_ct(char const* label) {... [truncated message content] |
From: Carlo W. <li...@us...> - 2001-11-21 02:23:29
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-10-21 02:23:28 UTC Modified files: Tag: branch-threading libcwd/bfd.cc libcwd/demangle3.cc libcwd/documentation/doxygen.config libcwd/include/libcw/demangle.h Log message: Work in progress. ---------------------- diff included ---------------------- Index: src/libcwd/bfd.cc diff -u src/libcwd/bfd.cc:1.85.2.29 src/libcwd/bfd.cc:1.85.2.30 --- src/libcwd/bfd.cc:1.85.2.29 Fri Nov 16 16:14:28 2001 +++ src/libcwd/bfd.cc Tue Nov 20 18:23:17 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.85.2.29 2001/11/17 00:14:28 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.85.2.30 2001/11/21 02:23:17 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -101,7 +101,11 @@ /* \{ */ /** The BFD channel. */ - channel_ct bfd("BFD"); + channel_ct bfd +#ifndef HIDE_FROM_DOXYGEN + ("BFD") +#endif + ; /** \} */ } Index: src/libcwd/demangle3.cc diff -u src/libcwd/demangle3.cc:1.8.2.16 src/libcwd/demangle3.cc:1.8.2.17 --- src/libcwd/demangle3.cc:1.8.2.16 Mon Nov 19 20:32:39 2001 +++ src/libcwd/demangle3.cc Tue Nov 20 18:23:17 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/demangle3.cc,v 1.8.2.16 2001/11/20 04:32:39 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/demangle3.cc,v 1.8.2.17 2001/11/21 02:23:17 libcw Exp $ // // Copyright (C) 2001, by // @@ -12,7 +12,7 @@ // /*! -\addtogroup demangle +\defgroup demangle demangle_type() and demangle_symbol() Libcwd comes with its own demangler functions. @@ -1993,6 +1993,7 @@ extern void demangle_symbol(char const* input, _private_::internal_string& output); extern void demangle_type(char const* input, _private_::internal_string& output); +/** \ingroup demangle */ void demangle_symbol(char const* input, std::string& output) { LIBCWD_TSD_DECLARATION @@ -2007,6 +2008,7 @@ _private_::set_alloc_checking_on(LIBCWD_TSD); } +/** \ingroup demangle */ void demangle_type(char const* input, std::string& output) { LIBCWD_TSD_DECLARATION Index: src/libcwd/documentation/doxygen.config diff -u src/libcwd/documentation/doxygen.config:1.1.2.6 src/libcwd/documentation/doxygen.config:1.1.2.7 --- src/libcwd/documentation/doxygen.config:1.1.2.6 Mon Nov 19 20:32:39 2001 +++ src/libcwd/documentation/doxygen.config Tue Nov 20 18:23:18 2001 @@ -39,7 +39,7 @@ shellcommand=\htmlonly\n<SPAN\nclass=shell-command>\n\endhtmlonly\n \ endshellcommand=\htmlonly\n</SPAN>\n\endhtmlonly ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 +MAX_INITIALIZER_LINES = 0 OPTIMIZE_OUTPUT_FOR_C = NO SHOW_USED_FILES = YES #--------------------------------------------------------------------------- @@ -97,7 +97,7 @@ GENERATE_CHI = NO BINARY_TOC = NO TOC_EXPAND = NO -DISABLE_INDEX = YES +DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = NO TREEVIEW_WIDTH = 250 Index: src/libcwd/include/libcw/demangle.h diff -u src/libcwd/include/libcw/demangle.h:1.5.2.4 src/libcwd/include/libcw/demangle.h:1.5.2.5 --- src/libcwd/include/libcw/demangle.h:1.5.2.4 Mon Nov 19 20:32:40 2001 +++ src/libcwd/include/libcw/demangle.h Tue Nov 20 18:23:18 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/demangle.h,v 1.5.2.4 2001/11/20 04:32:40 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/demangle.h,v 1.5.2.5 2001/11/21 02:23:18 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -10,10 +10,6 @@ // version 1.0 as appearing in the file LICENSE.QPL included in the // packaging of this file. // - -// 3.1 -/** \defgroup demangle demangle_type() and demangle_symbol() - */ #ifndef LIBCW_DEMANGLE_H #define LIBCW_DEMANGLE_H ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-12-02 01:01:46
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-11-02 01:01:42 UTC Modified files: Tag: branch-threading libcwd/NEWS libcwd/bfd.cc libcwd/debug.cc libcwd/debugmalloc.cc libcwd/demangle3.cc libcwd/documentation/custom-debug.h.dox libcwd/documentation/custom_do.dox libcwd/documentation/deallocation_pointer_validation.dox libcwd/documentation/doxygen.config libcwd/documentation/location.dox libcwd/documentation/mainpage.dox libcwd/documentation/memory_leak_checking.dox libcwd/documentation/nested.dox libcwd/documentation/preparation.dox 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_set.h libcwd/include/libcw/class_continued_channel.h libcwd/include/libcw/class_debug.h libcwd/include/libcw/class_debug_string.h libcwd/include/libcw/class_fatal_channel.h libcwd/include/libcw/class_location.h 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_ForAllDebugChannels.h libcwd/include/libcw/macro_ForAllDebugObjects.h libcwd/include/libcw/macro_Libcwd_macros.h libcwd/include/libcw/max_label_len.h libcwd/include/libcw/pc_mangled_function_name.h libcwd/include/libcw/private_TSD.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_threading.h libcwd/include/libcw/strerrno.h libcwd/include/libcw/sysd.ho.in libcwd/include/libcw/type_info.h Added files: Tag: branch-threading libcwd/documentation/alloc_intro.dox libcwd/documentation/allocated_memory_overview.dox libcwd/documentation/debug_channels.dox libcwd/documentation/magic.dox libcwd/documentation/modules.dox libcwd/documentation/why_macro.dox libcwd/documentation/images/libcw_magic.gif libcwd/include/libcw/macro_AllocTag.h Removed files: Tag: branch-threading libcwd/documentation/reference.dox Log message: Work in progress. The structure of the documentation is reasonable now. Most documentation is transfered. ---------------------- diff included ---------------------- Index: src/libcwd/NEWS diff -u src/libcwd/NEWS:1.45.2.8 src/libcwd/NEWS:1.45.2.9 --- src/libcwd/NEWS:1.45.2.8 Thu Oct 11 21:15:49 2001 +++ src/libcwd/NEWS Sat Dec 1 17:01:30 2001 @@ -11,12 +11,16 @@ API changes: - IMPORTANT: 'channel_ct const' -> 'channel_ct'. - Debug channels should no longer be declared constant. - Declarations like + IMPORTANT: Debug channels have globally been renamed to Debug + selectors. The word 'channel' had too much association with output + destinations (streams). + + IMPORTANT: 'channel_ct const' -> 'selector_ct'. + Debug selectors (previously channels) should no longer be declared + constant. Declarations like libcw::debug::channel_ct const my_channel("FOO"); will have to be changed to - libcw::debug::channel_ct my_channel("FOO"); + libcw::debug::selector_ct my_channel("FOO"); `long memblks()' has been renamed to `unsigned long mem_blocks()'. Index: src/libcwd/bfd.cc diff -u src/libcwd/bfd.cc:1.85.2.30 src/libcwd/bfd.cc:1.85.2.31 --- src/libcwd/bfd.cc:1.85.2.30 Tue Nov 20 18:23:17 2001 +++ src/libcwd/bfd.cc Sat Dec 1 17:01:30 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.85.2.30 2001/11/21 02:23:17 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.85.2.31 2001/12/02 01:01:30 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -97,7 +97,7 @@ // New debug channel namespace channels { namespace dc { - /** /addtogroup default_dc */ + /** \addtogroup group_default_dc */ /* \{ */ /** The BFD channel. */ @@ -1098,6 +1098,9 @@ } // namespace cwbfd + /** \addtogroup chapter_locations */ + /** \{ */ + char const* const unknown_function_c = "<unknown function>"; // @@ -1121,6 +1124,8 @@ return symbol->get_symbol()->name; } + /** \} */ // End of group 'chapter_locations'. + struct bfd_location_ct : public location_ct { friend _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, bfd_location_ct const& data); }; @@ -1374,6 +1379,14 @@ return *this; } + /** + * \brief Write \a location to ostream \a os. + * + * Write the contents of a location_ct object to an ostream in + * the form source-%file:line-number, or writes "<unknown location>" + * when the location is unknown. + * \ingroup chapter_locations + */ std::ostream& operator<<(std::ostream& os, location_ct const& location) { if (location.M_filepath) Index: src/libcwd/debug.cc diff -u src/libcwd/debug.cc:1.46.2.38 src/libcwd/debug.cc:1.46.2.39 --- src/libcwd/debug.cc:1.46.2.38 Mon Nov 19 20:32:39 2001 +++ src/libcwd/debug.cc Sat Dec 1 17:01:30 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.46.2.38 2001/11/20 04:32:39 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.46.2.39 2001/12/02 01:01:30 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -146,7 +146,7 @@ } /** - * \brief The default %debug stream object. + * \brief The default %debug object. * * The %debug object that is used by default by Dout and DoutFatal, the only %debug object used by libcwd itself. * \sa \ref custom_do @@ -162,7 +162,7 @@ namespace channels { namespace dc { - /** \defgroup default_dc Pre-defined debug channels + /** \addtogroup group_default_dc Pre-Defined Debug Channels * * These are the default %debug %channels pre-defined in libcwd. */ @@ -990,14 +990,14 @@ return tmp; } - /** \interface list_channels_on debug.h libcw/debug.h + /** \fn void list_channels_on(debug_ct const& debug_object) * - * \brief List all %debug %channels to a given %debug stream object. + * \brief List all %debug %channels to a given %debug object. * - * \par Example: + * <b>Example:</b> * * \code - * Dout( list_channels_on(libcw_do) ); // libcw_do is the (default) debug stream object of libcwd. + * Dout( list_channels_on(libcw_do) ); // libcw_do is the (default) debug object of libcwd. * \endcode * * Example of output: Index: src/libcwd/debugmalloc.cc diff -u src/libcwd/debugmalloc.cc:1.61.2.44 src/libcwd/debugmalloc.cc:1.61.2.45 --- src/libcwd/debugmalloc.cc:1.61.2.44 Mon Nov 19 20:32:39 2001 +++ src/libcwd/debugmalloc.cc Sat Dec 1 17:01:30 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.61.2.44 2001/11/20 04:32:39 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.61.2.45 2001/12/02 01:01:30 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -1535,7 +1535,7 @@ return memblks; } -std::ostream& operator<<(std::ostream& o, debugmalloc_report_ct) +std::ostream& operator<<(std::ostream& o, malloc_report_nt) { ACQUIRE_READ_LOCK size_t memsize = const_dm_alloc_ct::get_memsize(); @@ -1545,18 +1545,24 @@ return o; } -/** \interface list_allocations_on debug.h libcw/debug.h +/** \fn void list_allocations_on(debug_ct& debug_object) * - * \brief List all current allocations to a given %debug stream object. + * \brief List all current allocations to a given %debug object. * - * \par Example: + * With both, \link enable_libcwd_debugm DEBUGMALLOC \endlink and + * \link enable_libcwd_debug DEBUGDEBUG \endlink defined, it is possible + * to write the \ref chapter_overview "overview of allocated memory" to + * a \ref chapter_debug_object "Debug Object". + * The syntax to do this is: * * \code - * Debug( list_allocations_on(libcw_do) ); // libcw_do is the (default) debug stream object of libcwd. + * Debug( list_allocations_on(libcw_do) ); // libcw_do is the (default) debug object. * \endcode * - * output example here... + * which would print on \link libcw::debug::libcw_do libcw_do \endlink using + * \ref chapter_debug_channels "debug channel" \link libcw::debug::dc::malloc dc::malloc \endlink. * + * \sa \ref chapter_overview */ void list_allocations_on(debug_ct& debug_object) { Index: src/libcwd/demangle3.cc diff -u src/libcwd/demangle3.cc:1.8.2.17 src/libcwd/demangle3.cc:1.8.2.18 --- src/libcwd/demangle3.cc:1.8.2.17 Tue Nov 20 18:23:17 2001 +++ src/libcwd/demangle3.cc Sat Dec 1 17:01:31 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/demangle3.cc,v 1.8.2.17 2001/11/21 02:23:17 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/demangle3.cc,v 1.8.2.18 2001/12/02 01:01:31 libcw Exp $ // // Copyright (C) 2001, by // @@ -12,7 +12,8 @@ // /*! -\defgroup demangle demangle_type() and demangle_symbol() +\addtogroup group_demangle demangle_type() And demangle_symbol() +\ingroup chapter_type_info Libcwd comes with its own demangler functions. @@ -26,8 +27,7 @@ by libbfd), which is what is returned by \ref location_ct::mangled_function_name() and pc_mangled_function_name(). -The direct use of these functions should be avoided, instead use the -function \ref type_info_of. +The direct use of these functions should be avoided, instead use the function type_info_of(). */ @@ -1993,7 +1993,7 @@ extern void demangle_symbol(char const* input, _private_::internal_string& output); extern void demangle_type(char const* input, _private_::internal_string& output); -/** \ingroup demangle */ +/** \ingroup group_demangle */ void demangle_symbol(char const* input, std::string& output) { LIBCWD_TSD_DECLARATION @@ -2008,7 +2008,7 @@ _private_::set_alloc_checking_on(LIBCWD_TSD); } -/** \ingroup demangle */ +/** \ingroup group_demangle */ void demangle_type(char const* input, std::string& output) { LIBCWD_TSD_DECLARATION Index: src/libcwd/documentation/alloc_intro.dox diff -u /dev/null src/libcwd/documentation/alloc_intro.dox:1.1.2.1 --- /dev/null Sat Dec 1 17:01:44 2001 +++ src/libcwd/documentation/alloc_intro.dox Sat Dec 1 17:01:31 2001 @@ -0,0 +1,26 @@ +/*! + +\addtogroup chapter_allocations_intro + +Unless \link enable_libcwd_alloc --disable-libcwd-alloc \endlink was specified during configuration then +the following memory allocation and de-allocation debugging features are provided by libcwd: + +-# Checking if a pointer that is passed to a memory de-allocation function is valid; + and if this pointer was previously returned by a corresponding allocation function. +-# Finding the start, size, place of allocation in the source code and allocator type of an + allocated memory block when given a pointer which points inside of it. +-# Providing means to add type info and a description to the Allocated memory Overview (using <CODE>AllocTag()</CODE></a>). +-# Listing \ref chapter_overview "an overview of allocated memory" to a \ref chapter_debug_object "Debug Object". +-# Boundary checks of allocated blocks, by means of \ref chapter_magic_numbers "magic numbers" (see also \ref enable_libcwd_magic). + +Unfortunately it is impossible to support feature 3. in C++ without putting hooks in your code: + +- After every memory allocation, the returned pointer should be passed to <CODE>AllocTag()</CODE>, + passing information that needs to be included in the Allocated memory Overview (this is not needed, + though allowed, after a call to <CODE>%realloc()</CODE>). + +A missing <CODE>AllocTag()</CODE> will only have effect on the Allocated memory Overview, +showing <TT><unknown type></TT> instead of the type and a description of the allocated object. + +*/ + Index: src/libcwd/documentation/allocated_memory_overview.dox diff -u /dev/null src/libcwd/documentation/allocated_memory_overview.dox:1.1.2.1 --- /dev/null Sat Dec 1 17:01:44 2001 +++ src/libcwd/documentation/allocated_memory_overview.dox Sat Dec 1 17:01:31 2001 @@ -0,0 +1,206 @@ +/*! + +\addtogroup chapter_overview + +An example output, using libcw-0.2.5, is given below. +Please follow the links to get a short explanation. + +\htmlonly +<PRE class="output"> +MALLOC : Allocated memory: 3100 bytes in 14 blocks. +<A HREF="#AMO_allocator">malloc</A> 0x819f068 sock.cc:92 sockaddr_in []; (sz = 16) <A HREF="#AMO_description">sockbuf_dbct::addr</A> +malloc 0x819dea0 <A HREF="#AMO_location">dbstreambuf.h:582</A> char []; (sz = 512) dbstreambuf_ct::dbstreambuf_block_dct::block + 0x8122240 dbstreambuf.cc:68 dbstreambuf_ct::dbstreambuf_block_dct; (sz = 20) + 0x81400e8 <A HREF="#AMO_location">streambuf::streambuf(int)</A> <unknown type>; <A HREF="#AMO_size">(sz = 24)</A> + 0x8122400 sock.h:225 dbstreambuf_ct; (sz = 144) +malloc 0x8140678 dbstreambuf.h:582 char []; (sz = 2048) dbstreambuf_ct::dbstreambuf_block_dct::block + 0x81405c8 dbstreambuf.cc:68 dbstreambuf_ct::dbstreambuf_block_dct; (sz = 20) + 0x8140558 streambuf::streambuf(int) <unknown type>; (sz = 24) + 0x8140428 sock.h:225 dbstreambuf_ct; (sz = 144) + 0x8140320 reduce_tst.cc:263 sock_dtct<socket_input_ct, socket_ostream_ct>; (sz = 100) + <A HREF="#AMO_start">0x813fd80</A> select.cc:106 list_tct<sbll_list_ct, fd_dct>; (sz = 8) fd_dct::write_fd_list + 0x8122360 select.cc:104 <A HREF="#AMO_type">list_tct<sbll_list_ct, fd_dct></A>; (sz = 8) fd_dct::readwrite_fd_list + 0x81221e0 select.cc:102 list_tct<sbll_list_ct, fd_dct>; (sz = 8) fd_dct::read_fd_list + 0x80545c8 libcw_app.h:140 reduce_tst_app_ct; (sz = 24) The application object +</PRE> +\endhtmlonly + +\subsection AMO_allocator allocator type + +A label in the first column of the Allocated memory Overview indicates +with which type of allocator the memory block was allocated. +Table 3 lists the labels that are being used for each of the +allocator types (see \link libcw::debug::memblk_types_nt memblk_types_nt \endlink for their meaning). + +\htmlonly +<H5 ALIGN=CENTER>Table 3. The values of memblk_types_nt and the corresponding label in the Allocated memory Overview</H5> +<CENTER> +<TABLE BGCOLOR=Wheat BORDERCOLOR=#503c2c WIDTH=577 BORDER=1 CELLPADDING=4 CELLSPACING=0> + <TR> + <TD BGCOLOR="#a98061"><FONT COLOR="#ffffff">Type</FONT></TD> + <TD BGCOLOR="#a98061"><FONT COLOR="#ffffff">Label</FONT></TD> + </TR> + <TR> + <TD><CODE>memblk_type_new</CODE></TD> + <TD> </TD> + </TR> + <TR> + <TD><CODE>memblk_type_deleted</CODE></TD> + <TD><CODE>(deleted)</CODE></TD> + </TR> + <TR> + <TD><CODE>memblk_type_new_array</CODE></TD> + <TD><CODE>new[]</CODE></TD> + </TR> + <TR> + <TD><CODE>memblk_type_deleted_array</CODE></TD> + <TD><CODE>(deleted)</CODE></TD> + </TR> + <TR> + <TD><CODE>memblk_type_malloc</CODE></TD> + <TD><CODE>malloc</CODE></TD> + </TR> + <TR> + <TD><CODE>memblk_type_realloc</CODE></TD> + <TD><CODE>realloc</CODE></TD> + </TR> + <TR> + <TD><CODE>memblk_type_freed</CODE></TD> + <TD><CODE>(freed)</CODE></TD> + </TR> + <TR> + <TD><CODE>memblk_type_noheap</CODE></TD> + <TD><CODE>(NO HEAP)</CODE></TD> + </TR> + <TR> + <TD><CODE>memblk_type_removed</CODE></TD> + <TD><CODE>(No heap)</CODE></TD> + </TR> + <TR> + <TD><CODE>memblk_type_marker</CODE></TD> + <TD><CODE>(MARKER)</CODE></TD> + </TR> + <TR> + <TD><CODE>memblk_type_deleted_marker</CODE></TD> + <TD><CODE>(deleted)</CODE></TD> + </TR> +</TABLE> +</CENTER> +\endhtmlonly + +\subsection AMO_start start address + +The second column of the Allocated memory Overview gives the hexadecimal start address of the allocated memory block. +This is the value returned by the allocator (<CODE>malloc</CODE>, <CODE>new</CODE> etc). +Note that, when \ref enable_libcwd_magic "DEBUGMAGICMALLOC" is defined, 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 DEBUGMAGICMALLOC is defined, in your own program. + +\subsection AMO_location source file location + +The third column of the Allocated memory Overview gives the source file +location where the memory was allocated, or reallocated in the case of +of <CODE>realloc</CODE>. +The format is <TT><filename>:<line number></TT>. + +When the allocation is done in an object file without debug information +and no source file or line number is known, then instead the name of the +function in which the allocation was done is given. + +\subsection AMO_type type + +The fourth column of the Allocated memory Overview starts with the <TT>type</TT> of the allocated object +(i.e., the <CODE>class</CODE> name). +This information is only available when <CODE>AllocTag()</CODE> +was called correctly for this allocation. +Otherwise <TT><unknown type></TT> is shown instead. + +The given <TT>type</TT> is derived, but different, +from what \ref libcw::debug::type_info_ct::demangled_name "type_info_ct::demangled_name()" returns. +The <CODE>*</CODE> at the end of the type of the pointer is omitted when the +memory block was allocated with <CODE>new</CODE>, it is replaced with +<CODE>[<I>size</I>]</CODE> when the memory block was allocated with +<CODE>new[]</CODE> and it is replaced with <CODE>[]</CODE> when the memory +block was allocated with <CODE>malloc</CODE>. + +Examples were already given, but a summary is given in table 4 nonetheless. +The <I><length></I> that is given between square brackets is the <I>rounded down</I> value of the size +of the allocated memory block divided by the size of the object that is being pointed to. +This will always be accurate for an <CODE>operator new []</CODE> of course, +but its kinda fuzzy for an allocation with <CODE>malloc</CODE> et al. + +\htmlonly +<H5 ALIGN=CENTER>Table 4. The format of the <I>type</I> field in the Allocated memory Overview, as function of the allocator.</H5> +<CENTER> +<TABLE BGCOLOR=Wheat BORDERCOLOR=#503c2c BORDER=1 CELLPADDING=4 CELLSPACING=0> +<TR> + <TR> + <TD BGCOLOR="#a98061"> + <FONT COLOR="#ffffff">Allocator</FONT> + </TD> + <TD BGCOLOR="#a98061"> + <FONT COLOR="#ffffff">Type</FONT> + </TD> + <TD BGCOLOR="#a98061"> + <FONT COLOR="#ffffff">Format</FONT> + </TD> + </TR> + <TR> + <TD> + <CODE>malloc/calloc/realloc</CODE> + </TD> + <TD> + <CODE>void*</CODE> + </TD> + <TD> + <CODE>void*</CODE> + </TD> + </TR> + <TR> + <TD> + <CODE>malloc/calloc/realloc</CODE> + </TD> + <TD> + <CODE>int*</CODE> + </TD> + <TD> + <CODE>int [<I><length></I>]</CODE> + </TD> + </TR> + <TR> + <TD> + <CODE>new</CODE> + </TD> + <TD> + <CODE>MyClass*</CODE> + </TD> + <TD> + <CODE>MyClass</CODE> + </TD> + </TR> + <TR> + <TD> + <CODE>new []</CODE> + </TD> + <TD> + <CODE>MyClass*</CODE> + </TD> + <TD> + <CODE>MyClass [<I><length></I>]</CODE> + </TD> + </TR> +</TABLE> +</CENTER> +\endhtmlonly + +\subsection AMO_size size + +The number of allocated bytes is printed as +<TT>(sz = </TT><I><size></I><TT>)</TT>, +where <I><size></I> is the size of the returned memory block in bytes. + +\subsection AMO_description description + +Finally, the description that was passed along with <CODE>AllocTag()</CODE> is printed. + +*/ Index: src/libcwd/documentation/custom-debug.h.dox diff -u src/libcwd/documentation/custom-debug.h.dox:1.1.2.2 src/libcwd/documentation/custom-debug.h.dox:1.1.2.3 --- src/libcwd/documentation/custom-debug.h.dox:1.1.2.2 Mon Nov 19 20:32:39 2001 +++ src/libcwd/documentation/custom-debug.h.dox Sat Dec 1 17:01:31 2001 @@ -3,7 +3,7 @@ /*! -\page custom_debug_h The Custom debug.h file +\defgroup custom_debug_h The Custom debug.h file \section debug_channels_and_namespace Debug channels and namespace Index: src/libcwd/documentation/custom_do.dox diff -u src/libcwd/documentation/custom_do.dox:1.1.2.1 src/libcwd/documentation/custom_do.dox:1.1.2.2 --- src/libcwd/documentation/custom_do.dox:1.1.2.1 Tue Nov 13 19:01:07 2001 +++ src/libcwd/documentation/custom_do.dox Sat Dec 1 17:01:31 2001 @@ -5,7 +5,8 @@ Each %debug object is associated with one ostream. The default %debug output macros Dout and DoutFatal use the \em default debug object libcw::debug::libcw_do. Other %debug objects may be created as global objects; -it is convenient to define new macros for each (custom) %debug object using the generic macros LibcwDout and LibcwDoutFatal. +it is convenient to define new macros for each (custom) %debug object using the generic macros +\link libcw::debug::LibcwDout LibcwDout \endlink and \link libcw::debug::LibcwDoutFatal LibcwDoutFatal \endlink. For example, add something like the following to your own \link custom_debug_h "debug.h" \endlink file: @@ -19,5 +20,8 @@ #define MyDoutFatal(a, b) LibcwDoutFatal(::std,, a, b) #endif // !CWDEBUG \endcode + +\sa \ref chapter_debug_object +\sa \ref libcw::debug::libcw_do */ Index: src/libcwd/documentation/deallocation_pointer_validation.dox diff -u src/libcwd/documentation/deallocation_pointer_validation.dox:1.1.2.1 src/libcwd/documentation/deallocation_pointer_validation.dox:1.1.2.2 --- src/libcwd/documentation/deallocation_pointer_validation.dox:1.1.2.1 Mon Nov 19 20:32:39 2001 +++ src/libcwd/documentation/deallocation_pointer_validation.dox Sat Dec 1 17:01:31 2001 @@ -1,6 +1,6 @@ /*! -\page deallocation_pointer_validation De-allocation pointer validation +\addtogroup chapter_validation A pointer passed to a de-allocation (or re-allocation) function is checked to be valid; it should be previously returned by a corresponding (re-)allocation function and not @@ -40,7 +40,7 @@ Note: When libcwd was configured with \link enable_libcwd_magic --disable-libcwd-magic \endlink then the check whether or not the de-allocated memory block was allocated with the corresponding -allocation function is \em not performed when the memory block is \ref invisible. +allocation function is \em not performed when the memory block is \ref chapter_invisible "invisible". The reason for this is that invisible memory blocks are simply not stored in the internal data structure: No information is known about them. Index: src/libcwd/documentation/debug_channels.dox diff -u /dev/null src/libcwd/documentation/debug_channels.dox:1.1.2.1 --- /dev/null Sat Dec 1 17:01:44 2001 +++ src/libcwd/documentation/debug_channels.dox Sat Dec 1 17:01:31 2001 @@ -0,0 +1,76 @@ +/*! + +\addtogroup chapter_debug_channels + +Whenever debug output is written, one or more <i>debug channels</i> must be specified. +The debug output is then written to the ostream of the debug object +unless the debug object is turned off or when all specified <i>debug channels</i> are off. +Each <i>debug channel</i> can be turned \link libcw::debug::channel_ct::on on \endlink +and \link libcw::debug::channel_ct::off off \endlink independently. + +Libcwd has defined six <i>debug channels</i> in namespace \link libcw::debug::channels::dc channels::dc \endlink +(See \ref group_default_dc). +New <i>debug channels</i> can be defined by the user, which is as simple as creating +a new \link libcw::debug::channel_ct channel_ct \endlink object. + +Example, + +\code +namespace dc { + channel_ct mychan("MYLABEL"); +} +\endcode + +This declaration must be inside the namespace \ref DEBUGCHANNELS. + +Multiple <i>debug channels</i> can be given by using +<CODE>operator|</CODE> between the channel names. +This shouldn't be read as `or' but merely +be seen as the bit-wise OR operation on the bit-masks that these +channels actually represent. + +\sa chapter_control_flags + +<b>Example:</b> + +\code +Dout(dc::notice, "Libcw is a great library"); +\endcode + +gives as result + +\exampleoutput <PRE> +NOTICE: Libcw is a great library</PRE> +\endexampleoutput + +and + +\code +#ifdef CWDEBUG +namespace myapplication { + namespace debug { + namespace channels { // Assuming DEBUGCHANNELS is ::myapplication::debug::channels + + namespace dc { + libcw::debug::channel_ct hello("HELLO"); + } + + } // namespace DEBUGCHANNELS + } +} +#endif + +Dout(dc::hello, "Hello World!"); +Dout(dc::kernel|dc::io, "This is written when either the <i>kernel</i>" +"or <i>io</i> channel is turned on."); +\endcode + +gives as result + +\exampleoutput <PRE> +HELLO : Hello World! +KERNEL: This is written when either the kernel or io channel is turned on.</PRE> +\endexampleoutput + +*/ + Index: src/libcwd/documentation/doxygen.config diff -u src/libcwd/documentation/doxygen.config:1.1.2.7 src/libcwd/documentation/doxygen.config:1.1.2.8 --- src/libcwd/documentation/doxygen.config:1.1.2.7 Tue Nov 20 18:23:18 2001 +++ src/libcwd/documentation/doxygen.config Sat Dec 1 17:01:31 2001 @@ -22,7 +22,7 @@ STRIP_CODE_COMMENTS = YES CASE_SENSE_NAMES = YES SHORT_NAMES = NO -HIDE_SCOPE_NAMES = YES +HIDE_SCOPE_NAMES = NO VERBATIM_HEADERS = YES SHOW_INCLUDE_FILES = YES JAVADOC_AUTOBRIEF = NO Index: src/libcwd/documentation/images/libcw_magic.gif Index: src/libcwd/documentation/location.dox diff -u src/libcwd/documentation/location.dox:1.1.2.1 src/libcwd/documentation/location.dox:1.1.2.2 --- src/libcwd/documentation/location.dox:1.1.2.1 Mon Nov 19 20:32:39 2001 +++ src/libcwd/documentation/location.dox Sat Dec 1 17:01:31 2001 @@ -1,9 +1,9 @@ /*! -\page Source_file_and_line_number_information Source file and line number information +\addtogroup chapter_alloc_locations Memory allocation debugging and locations -\section BFD_library The BFD library - +\par The BFD library +\n Libcwd attempts to determine the source file and line number where memory is allocated. It does this by directly reading the .stabs section of the ELF32 object files. If you are using an Operating System that isn't ELF then you need to enable the use of libbfd for @@ -11,32 +11,30 @@ If you don't have an ELF system and you don't have libbfd installed and are not able to install it yourself (note: you also need libiberty and libdl) then you can disable it using \link enable_libcwd_location --disable-libcwd-location \endlink. -There is a seperate \link BFD chapter \endlink that deals with libcwd and <EM>location</EM> support. +There is a seperate page that deals with libcwd and \link chapter_locations location \endlink support. This paragraph describes the effect of disabling source file and line number location support in relation to the memory allocation debugging support. - -\section With_location_support With location support +\par With location support +\n With \link enable_libcwd_location --enable-libcwd-location \endlink, libcwd will write the source file and line number information about where memory allocations are done to the -\link Debug_Channel_objects debug channel \endlink \link libcw::debug::channels::dc::bfd dc::bfd \endlink. - +\link chapter_debug_channels debug channels \endlink \link libcw::debug::channels::dc::bfd dc::bfd \endlink. +<br><br> For example, - \exampleoutput <PRE> MALLOC : operator new (size = 4) = <unfinished> BFD : 0x804bc9b is at (deb.cc:179) MALLOC : <continued> 0x8137220</PRE> \endexampleoutput - which means that <CODE>operator new</CODE> was called at address 0x804bc9b corresponding to line 179 of source file <TT>deb.cc</TT>. - -Source file and line number information is also shown in the \link Allocated_memory_Overview Allocated memory Overview \endlink -and when a memory block is freed. - -\section Without_location_support Without location support +<br><br> +Source file and line number information is also shown in the +\ref chapter_overview "overview of allocated memory" and when a memory block is freed. +\par Without location support +\n Without support the source file and line number information will not be available. %Debug channel \link libcw::debug::channels::dc::bfd dc::bfd \endlink doesn't exist and the Allocated memory Overview will lack the source file location in column three. Index: src/libcwd/documentation/magic.dox diff -u /dev/null src/libcwd/documentation/magic.dox:1.1.2.1 --- /dev/null Sat Dec 1 17:01:44 2001 +++ src/libcwd/documentation/magic.dox Sat Dec 1 17:01:31 2001 @@ -0,0 +1,60 @@ +/*! + +\addtogroup chapter_magic_numbers Overflow/Underflow Protection (Red Zones) + +Memory corruption bugs are usually very hard to find because they often lead to a program +crash in a source line far from the point of the actual bug. +Buffer overruns are an important reason for memory corruption. +Libcwd tries to help with finding buffer overruns by means of so called <i>magic numbers</i>. + +When \ref enable_libcwd_magic is defined, magic numbers are added to +the beginning and the end of each allocated memory block. +In addition to these two magic numbers, extra memory is allocated to hold the allocated <i>size</i>, this is necessary +to find back the location of the magic number at the end with only a pointer to the beginning of the allocated memory block. +The total size of actually allocated memory is therefore larger than was requested. +The size of each field is equal to the size of a <CODE>size_t</CODE>. +Moreover, a few bytes might be allocated extra just in front of the last magic number in order to word align this number. + +<CODE>new</CODE> and <CODE>malloc</CODE> etc. return a pointer just beyond this <i>size</i> field, see figure 1. + +\htmlonly +<p STYLE="margin-left: 1.27cm"> <br> +<img width=340 height=165 src="../images/libcw_magic.gif" alt="Memory layout of magic numbers" border=0> +<br CLEAR=ALL> <br> +Figure 1. Memory layout of an allocated memory block with <CODE>DEBUGMAGICMALLOC</CODE> defined. +\endhtmlonly + +The magic numbers are checked when the memory is freed again. +Libcwd uses twelve different magic numbers for six pairs, existing each of +a <i>start</i> magic number and an <i>end</i> magic number. +The six pairs consist of two groups: for memory allocated by the user +and for memory allocated internally by libcwd as part of the debug malloc code itself. +Thus, each group consists of three pairs: for memory allocated with +<CODE>malloc</CODE>, <CODE>operator new</CODE> and <CODE>operator new[]</CODE> respectively. + +For example, the following code snippet: + +\code +int* p = new int[4]; +AllocTag(p, "Test array"); + +Debug( list_allocations_on(libcw_do) ); + +p[4] = 5; // Buffer overflow +delete[] p; +\endcode + +results in output like + +\exampleoutput <PRE> +MALLOC : operator new[] (size = 16) = 0x8116460 + +MALLOC : Allocated memory: 16 bytes in 1 blocks. +new[] 0x8116460 magic_tst.cc:174 int [4]; (sz = 16) Test array + +MALLOC : delete[] 0x8116460 magic_tst.cc:174 int [4]; (sz = 16) Test array <unfinished> +COREDUMP: delete[]: magic number corrupt! +Quit (core dumped)</PRE> +\endexampleoutput + +*/ Index: src/libcwd/documentation/mainpage.dox diff -u src/libcwd/documentation/mainpage.dox:1.1.2.3 src/libcwd/documentation/mainpage.dox:1.1.2.4 --- src/libcwd/documentation/mainpage.dox:1.1.2.3 Mon Nov 19 20:32:39 2001 +++ src/libcwd/documentation/mainpage.dox Sat Dec 1 17:01:31 2001 @@ -14,7 +14,7 @@ \li \ref downloading \li \ref preparation -\li \ref reference +\li \htmlonly <A href="modules.html">Reference manual</A> \endhtmlonly \section output_example Example output Index: src/libcwd/documentation/memory_leak_checking.dox diff -u src/libcwd/documentation/memory_leak_checking.dox:1.1.2.1 src/libcwd/documentation/memory_leak_checking.dox:1.1.2.2 --- src/libcwd/documentation/memory_leak_checking.dox:1.1.2.1 Mon Nov 19 20:32:39 2001 +++ src/libcwd/documentation/memory_leak_checking.dox Sat Dec 1 17:01:31 2001 @@ -1,6 +1,6 @@ /*! -\page memory_leak_checking Memory leak checking +\addtogroup chapter_markers Memory Allocation Markers: Memory Leak Checking Libcwd does a weak attempt to support debugging of memory leaks. I hope to greatly improve this in the future. Index: src/libcwd/documentation/modules.dox diff -u /dev/null src/libcwd/documentation/modules.dox:1.1.2.1 --- /dev/null Sat Dec 1 17:01:44 2001 +++ src/libcwd/documentation/modules.dox Sat Dec 1 17:01:31 2001 @@ -0,0 +1,46 @@ +/** \addtogroup chapter_writing Writing Debug Output */ +/** \{ */ +/** \addtogroup chapter_writing_intro Writing Debug Output: Introduction */ +/** \addtogroup chapter_destination Setting The Output Destination */ +/** \{ */ +/** \addtogroup chapter_debug_object The Output Device (Debug Object) */ +/** \addtogroup custom_do Custom Debug Objects */ +/** \} */ +/** \addtogroup chapter_debug_channels Controlling The Output Level (Debug Channels) */ +/** \{ */ +/** \addtogroup group_default_dc */ +/** \} */ +/** \addtogroup chapter_formatting Format Of The Debug Output */ +/** \addtogroup chapter_control_flags Control Flags */ +/** \addtogroup chapter_fatal_output Fatal Debug Output */ +/** \addtogroup chapter_nesting Nesting Debug Output */ +/** \addtogroup chapter_special Special Functions And Utilities */ +/** \} */ + +/** \addtogroup chapter_allocations Memory Allocation Debug Support */ +/** \{ */ +/** \addtogroup chapter_allocations_intro Memory Allocation Debug Support: Introduction */ +/** \addtogroup chapter_validation De-Allocation Pointer Validation */ +/** \addtogroup chapter_magic_numbers Overflow/Underflow Protection (Red Zones) */ +/** \addtogroup chapter_annotation Allocation Annotation */ +/** \addtogroup chapter_overview Overview Of Allocated Memory */ +/** \{ */ +/** \addtogroup chapter_invisible */ +/** \} */ +/** \addtogroup chapter_finding Finding (Information About) Memory Allocations */ +/** \addtogroup chapter_markers Memory Allocation Markers: Memory Leak Checking */ +/** \} */ + +/** \addtogroup chapter_symbols Program Symbols Access And Interpretation */ +/** \{ */ +/** \addtogroup chapter_symbols_intro Program Symbols Access And Interpretation: Introduction */ +/** \addtogroup chapter_locations Source File And Line Number Information */ +/** \addtogroup chapter_type_info Getting Type Information Of Types And Symbols */ +/** \} */ + +/** \addtogroup chapter_start Configuration, Installation And Getting Started */ +/** \{ */ +/** \addtogroup group_configuration Configuration Options And Macros */ +/** \addtogroup chapter_alloc_locations */ +/** \} */ + Index: src/libcwd/documentation/nested.dox diff -u src/libcwd/documentation/nested.dox:1.1.2.2 src/libcwd/documentation/nested.dox:1.1.2.3 --- src/libcwd/documentation/nested.dox:1.1.2.2 Mon Nov 19 20:32:39 2001 +++ src/libcwd/documentation/nested.dox Sat Dec 1 17:01:31 2001 @@ -1,11 +1,10 @@ /*! -\page nested_debug_calls Nested debug calls +\addtogroup chapter_nesting Nesting Debug Output -\section inside Calling functions inside Dout - +\par Calling functions inside Dout +\n Consider the following code: - \code int foobar(void) __attribute__ ((const)); @@ -23,46 +22,37 @@ return foobar(); } \endcode - This code would start a new debug message before the previous debug message is finished. Libcwd detects this and will output: - \exampleoutput <PRE> NOTICE: Entering foobar() NOTICE: Leaving foobar() KERNEL: The value of foobar() = 2, aint that nice?</PRE> \endexampleoutput - Note the indentation and the fact that the printing of the label KERNEL was delayed. -\section using_continued Using continued_cf, dc::continued and dc::finish - +\anchor using_continued +\par Using continued_cf, dc::continued and dc::finish +\n In the previous section <CODE>foobar()</CODE> was a const function: it didn't matter whether or not it was called for the functionality of the application. But when it does matter, then one might want to do something like this: - \code Dout( dc::kernel|flush_cf|continued_cf, "Generating tables... " ); generate_tables(); Dout( dc::finish, "done" ); \endcode - If generate_tables() would not print debug messages, then the output will look like: - \exampleoutput <PRE> KERNEL: Generating tables... done</PRE> \endexampleoutput - When it does generated debug output, then the <unfinished> and <continued> labels are printed also: - \exampleoutput <PRE> KERNEL: Generating tables... <unfinished> NOTICE: Inside generate_tables() KERNEL: <continued> done</PRE> \endexampleoutput - Finally, it is also possible to split a debug line into more then two parts by using the special dc::continued debug channel. - \code Dout( dc::notice|flush_cf|continued_cf, "Generating tables." ); for(int i = 0; i < 8; ++i) @@ -72,21 +62,16 @@ } Dout( dc::finish, " done" ); \endcode - When generate_table(i) doesn't print debug messages, then the output will look like: - \exampleoutput <PRE> NOTICE: Generating tables......... done</PRE> \endexampleoutput - When it does generate debug output, then each dot would be surrounded by a <continued> .<unfinished> : - \exampleoutput <PRE> NOTICE: Generating tables.<unfinished> TABLE : Inside generate_table(0) NOTICE: <continued> .<unfinished></PRE> \endexampleoutput - etc. */ Index: src/libcwd/documentation/preparation.dox diff -u src/libcwd/documentation/preparation.dox:1.1.2.2 src/libcwd/documentation/preparation.dox:1.1.2.3 --- src/libcwd/documentation/preparation.dox:1.1.2.2 Mon Nov 19 20:32:39 2001 +++ src/libcwd/documentation/preparation.dox Sat Dec 1 17:01:31 2001 @@ -13,8 +13,9 @@ \htmlonly<A HREF="../external/INSTALL">\endhtmlonly INSTALL\htmlonly</A>\endhtmlonly file that is included in the source distribution.<BR> -See also: \ref configuration +See also: \ref group_configuration +\anchor preparation_step2 \subsection header_files Step 2: Creating the custom header files You need to add two custom header files to your application.<BR> Index: src/libcwd/documentation/reference.dox diff -u src/libcwd/documentation/reference.dox:1.1.2.1 src/libcwd/documentation/reference.dox:removed --- src/libcwd/documentation/reference.dox:1.1.2.1 Tue Nov 13 19:01:07 2001 +++ src/libcwd/documentation/reference.dox Sat Dec 1 17:01:44 2001 @@ -1,56 +0,0 @@ -/*! \page reference Reference Manual - -\section Writing_debug_output Writing debug output - -\subsection The_Debug_Object The Debug Object -<ul> - <li> Class: \ref libcw::debug::debug_ct - <li> Default debug object: \link libcw::debug::libcw_do libcw_do \endlink - <li> Writing debug output to libcw_do: \ref Dout - <li> Custom debug objects: \ref custom_do -</ul> - -\subsection Debug_Channel_objects Debug Channel objects -<ul> - <li> Class: \ref libcw::debug::channel_ct - <li> Pre-defined channels: \ref default_dc - <li> Custom channels: \ref preparation -</ul> - -\subsection Format_of_the_debug_output Format of the debug output -<ul> - <li> \ref debug_ct_formatting -</ul> - -\subsection Debug_output_Control_Flags Debug output Control Flags -<ul> - <li> Overview: \ref control_flags -</ul> - -\subsection Fatal_debug_output Fatal debug output -<ul> - <li> Macro: \ref DoutFatal - <li> Pre-defined channels: \ref dc::fatal, \ref dc::core -</ul> - -\subsection Nested_debug_calls Nested debug calls -<ul> - <li> \ref nested_debug_calls -</ul> - -\subsection Special_functions Special functions -<ul> - <li> \ref ForAllDebugObjects ( ) - <li> \ref ForAllDebugChannels ( ) - <li> \ref Debug ( \link libcw::debug::check_configuration list_channels_on() \endlink ) - <li> \ref Debug ( \link libcw::debug::list_channels_on list_channels_on \endlink (\link libcw::debug::libcw_do libcw_do \endlink) ) - <li> \ref Debug ( \link libcw::debug::list_allocations_on list_allocations_on \endlink (\link libcw::debug::libcw_do libcw_do \endlink) ) - <li> \ref Debug ( \link libcw::debug::make_all_allocations_invisible_except make_all_allocations_invisible_except(ptr) \endlink ) -</ul> - -\section Memory_allocation_debugging_support Memory allocation debug support - -\section Runtime_debug_symbols_handling Runtime debug symbols handling - -*/ - Index: src/libcwd/documentation/why_macro.dox diff -u /dev/null src/libcwd/documentation/why_macro.dox:1.1.2.1 --- /dev/null Sat Dec 1 17:01:44 2001 +++ src/libcwd/documentation/why_macro.dox Sat Dec 1 17:01:31 2001 @@ -0,0 +1,122 @@ +/*! + +\page page_why_macro Design Consideration Concerning Macros + +This page describes why we use a macro in stead of an inline +function for <CODE>Dout()</CODE>. + +Good C++ code should not use macros, but <CODE>inline</CODE> functions which +have the advantage of type checking, overloading and easier debugging with a debugger. +It is therefore a very relevant question to ask why a macro was used for <CODE>Dout()</CODE>. + +Using a macro has also advantages: + +<OL> + <LI>It inlines the debug code even when we don't use optimization. + <LI>It allows us to use tricks that make the code run faster when debug code is included. + <LI>It allows us to omit variables in the program that are only used for debugging and which are written to a debug <CODE>ostream</CODE>. + <LI>It compiles faster when debugging is omitted. + <LI>No optimization is needed to really get rid of the debug code when debugging is omitted. +</OL> + +Points 1., 2. and 3. are the most important reasons that lead to the decision to use a macro. +Please note that the author of %libcw used the alternative for <B>two years</B> before finally was decided +to <B>rewrite</B> the debug facility, being convinced that it was better to do it the way it is done now. +While points 4. and 5. are trivial, the first three advantages might need some explanation: + +1. Usually a developer won't use compiler optimization because that makes debugging harder. +In most cases the debug code will be compiled and used <B>without</B> compiler optimization; including +the fact that <B>no</B> inlining is done at all. +Moreover, we expect to use a lot of inserter operators and without +optimization, each of these which will be called. +[ Note that when omitting debug code we can't get rid of the content of all +<CODE>%operator<<</CODE> functions because they might be used for +non-debug code too, so we'd need to use a trick and write to +something else than an <CODE>ostream</CODE> (lets say to a class <CODE>no_dstream</CODE>). +Each call to <CODE>template<class T> no_dstream %operator<<(T) { };</CODE> would actually be done(!), +without inlining (point 5. above) ]. + +2. Lets develop an example, step by step which is writing debug output. + +Lets start with writing some example debug output to <CODE>cerr</CODE>. + +\code +std::cerr << "i = " << i << "; j = " << j << "; s = " << s << std::endl; +\endcode + +This line calls seven functions, if we want to save cpu when we +<B>don't</B> want to write this output, then we need to test +whether the debugging output (for this specific channel) is turned +on or off <B>before</B> calling the <CODE>%operator<<()</CODE>'s. +After all, such an operator call can use a lot of cpu for arbitrary objects. + +We can not pass <CODE>"i = " << i << "; j = " << j << "; s = " << s << std::endl</CODE> +to an inline function without causing all <CODE>%operator<<</CODE> +functions to be called. +The only way, not using a macro, to achieve that no <CODE>%operator<<</CODE> is called is by not calling them +in the first place: We can't write to an <CODE>ostream</CODE>. +It is necessary to write to a new class (lets call that class <CODE>dstream</CODE>) which +checks if the debug channel we are writing to is turned on before +calling the <CODE>ostream %operator<<()</CODE>: + +\code +template<class T> + inline dstream& + operator<<(dstream& ds, T const& data) + { + if (on) + std::cerr << data; + } +\endcode + +Nevertheless, even with inlining (needing often the maximium optimization), most compilers would turn that into: + +\code +if (on) + std::cerr << "i = "; +if (on) + std::cerr << i; +if (on) + std::cerr << "; j = "; +if (on) + std::cerr << j; +if (on) + std::cerr << "; s = "; +if (on) + std::cerr << s; +if (on) + std::cerr << std::endl; +\endcode + +checking <CODE>on</CODE> seven times. + +With a macro we can easily achieve the best result, even without any optimization: + +\code +if (on) + std::cerr << "i = " << i << "; j = " << j << "; s = " << s << std::endl; +\endcode + +3. Sometimes a variable is specific to debug code and only being used for writing to a debug ostream. +When the debug is omitted and inline functions are used for the <CODE>Dout()</CODE> calls, then these +variables still need to exist: they are passed to the <CODE>Dout()</CODE> +function (or actually, to the <CODE>no_dstream %operator<<()</CODE>'s). +Using a macro allows one to really get rid of such variables by +surrounding them with <CODE>#ifdef CWDEBUG ... #endif</CODE> preprocessor directives. + +Example: + +\code + if (need_close) + { + Dout(dc::system|continued_cf, "close(" << __fd << ") = "); +#ifdef CWDEBUG + int ret = +#endif + ::close(__fd); + Dout(dc::finish|cond_error_cf(ret < 0), ret); + return false; + } +\endcode + +*/ Index: src/libcwd/include/libcw/bfd.h diff -u src/libcwd/include/libcw/bfd.h:1.20.2.16 src/libcwd/include/libcw/bfd.h:1.20.2.17 --- src/libcwd/include/libcw/bfd.h:1.20.2.16 Tue Oct 23 07:17:08 2001 +++ src/libcwd/include/libcw/bfd.h Sat Dec 1 17:01:31 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/bfd.h,v 1.20.2.16 2001/10/23 14:17:08 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/bfd.h,v 1.20.2.17 2001/12/02 01:01:31 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -10,6 +10,10 @@ // version 1.0 as appearing in the file LICENSE.QPL included in the // packaging of this file. // + +/** \file bfd.h + * Do not include this header file directly, instead include "\ref preparation_step2 "debug.h"". + */ #ifndef LIBCW_BFD_H #define LIBCW_BFD_H Index: src/libcwd/include/libcw/buf2str.h diff -u src/libcwd/include/libcw/buf2str.h:1.5.2.8 src/libcwd/include/libcw/buf2str.h:1.5.2.9 --- src/libcwd/include/libcw/buf2str.h:1.5.2.8 Mon Nov 19 20:32:39 2001 +++ src/libcwd/include/libcw/buf2str.h Sat Dec 1 17:01:31 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/buf2str.h,v 1.5.2.8 2001/11/20 04:32:39 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/buf2str.h,v 1.5.2.9 2001/12/02 01:01:31 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -46,7 +46,9 @@ * characters by either printing the character itself, the octal representation or one of * \c \a, \c \b, \c \t, \c \n, \c \f, \c \r, \c \e or \c \\. * - * \par Example: + * \sa libcw::debug::char2str + * + * <b>Example:</b> * * \code * char const* buf = "\e[31m;Hello\e[0m;\n"; @@ -54,8 +56,6 @@ * * Dout(dc::notice, "The buffer contains: \"" << buf2str(buf, size) << '"'); * \endcode - * - * \sa libcw::debug::char2str */ class buf2str { Index: src/libcwd/include/libcw/char2str.h diff -u src/libcwd/include/libcw/char2str.h:1.5.2.8 src/libcwd/include/libcw/char2str.h:1.5.2.9 --- src/libcwd/include/libcw/char2str.h:1.5.2.8 Mon Nov 19 20:32:39 2001 +++ src/libcwd/include/libcw/char2str.h Sat Dec 1 17:01:31 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/char2str.h,v 1.5.2.8 2001/11/20 04:32:39 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/char2str.h,v 1.5.2.9 2001/12/02 01:01:31 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -38,15 +38,15 @@ * sequence when needed using the octal representation or one of \c \a, \c \b, \c \t, \c \n, * \c \f, \c \r, \c \e or \c \\. * - * \par Example: + * \sa libcw::debug::buf2str + * + * <b>Example:</b> * * \code * char c = '\f'; * * Dout(dc::notice, "The variable c contains: '" << char2str(c) << '\''); * \endcode - * - * \sa libcw::debug::buf2str */ class char2str { Index: src/libcwd/include/libcw/class_alloc.h diff -u src/libcwd/include/libcw/class_alloc.h:1.1.2.2 src/libcwd/include/libcw/class_alloc.h:1.1.2.3 --- src/libcwd/include/libcw/class_alloc.h:1.1.2.2 Mon Nov 19 20:32:39 2001 +++ src/libcwd/include/libcw/class_alloc.h Sat Dec 1 17:01:31 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_alloc.h,v 1.1.2.2 2001/11/20 04:32:39 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_alloc.h,v 1.1.2.3 2001/12/02 01:01:31 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -11,6 +11,10 @@ // packaging of this file. // +/** \file class_alloc.h + * Do not include this header file directly, instead include "\ref preparation_step2 "debug.h"". + */ + #ifndef LIBCW_CLASS_ALLOC_H #define LIBCW_CLASS_ALLOC_H @@ -100,7 +104,7 @@ * * \returns a non-const \ref location_ct reference corresponding to the place where the allocation was done. * Class\ref location_ct describes a source file and line number location and in which function that location resides. - * \sa \ref Source_file_and_line_number_information + * \sa \ref chapter_alloc_locations */ location_ct& location_reference(void) { return M_location; } @@ -109,7 +113,7 @@ * * \returns a const \ref location_ct reference corresponding to the place where the allocation was done. * Class \ref location_ct describes a source file and line number location and in which function that location resides. - * \sa \ref Source_file_and_line_number_information + * \sa \ref chapter_alloc_locations */ location_ct const& location(void) const { return M_location; } #endif Index: src/libcwd/include/libcw/class_channel.h diff -u src/libcwd/include/libcw/class_channel.h:1.1.2.5 src/libcwd/include/libcw/class_channel.h:1.1.2.6 --- src/libcwd/include/libcw/class_channel.h:1.1.2.5 Mon Nov 19 20:32:39 2001 +++ src/libcwd/include/libcw/class_channel.h Sat Dec 1 17:01:31 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_channel.h,v 1.1.2.5 2001/11/20 04:32:39 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_channel.h,v 1.1.2.6 2001/12/02 01:01:31 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -11,6 +11,10 @@ // packaging of this file. // +/** \file class_channel.h + * Do not include this header file directly, instead include "\ref preparation_step2 "debug.h"". + */ + #ifndef LIBCW_CLASS_CHANNEL_H #define LIBCW_CLASS_CHANNEL_H @@ -43,8 +47,8 @@ * * Whenever %debug output is written, one or more %debug %channels must be specified (as first * parameter of the \ref Dout macro). - * The %debug output is then written to the \link debug_ct_device ostream \endlink of the - * \link libcw::debug::debug_ct debug object \endlink unless the %debug object + * The %debug output is then written to the \link chapter_destination ostream \endlink of the + * \link debug_ct debug object \endlink unless the %debug object * is turned off or when all specified %debug %channels are off. * Each %debug channel can be turned on and off independently. * @@ -52,7 +56,7 @@ * This shouldn't be read as `or' but merely be seen as the bit-wise OR operation on the bit-masks * that these %channels actually represent. * - * \par Example: + * <b>Example:</b> * * \code * Dout( dc::notice, "Libcw is a great library" ); Index: src/libcwd/include/libcw/class_channel_set.h diff -u src/libcwd/include/libcw/class_channel_set.h:1.1.2.3 src/libcwd/include/libcw/class_channel_set.h:1.1.2.4 --- src/libcwd/include/libcw/class_channel_set.h:1.1.2.3 Fri Oct 26 15:58:03 2001 +++ src/libcwd/include/libcw/class_channel_set.h Sat Dec 1 17:01:31 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_channel_set.h,v 1.1.2.3 2001/10/26 22:58:03 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_channel_set.h,v 1.1.2.4 2001/12/02 01:01:31 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -10,6 +10,10 @@ // version 1.0 as appearing in the file LICENSE.QPL included in the // packaging of this file. // + +/** \file class_channel_set.h + * Do not include this header file directly, instead include "\ref preparation_step2 "debug.h"". + */ #ifndef LIBCW_CLASS_CHANNEL_SET_H #define LIBCW_CLASS_CHANNEL_SET_H Index: src/libcwd/include/libcw/class_continued_channel.h diff -u src/libcwd/include/libcw/class_continued_channel.h:1.1.2.3 src/libcwd/include/libcw/class_continued_channel.h:1.1.2.4 --- src/libcwd/include/libcw/class_continued_channel.h:1.1.2.3 Fri Oct 26 15:58:03 2001 +++ src/libcwd/include/libcw/class_continued_channel.h Sat Dec 1 17:01:31 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_continued_channel.h,v 1.1.2.3 2001/10/26 22:58:03 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_continued_channel.h,v 1.1.2.4 2001/12/02 01:01:31 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -10,6 +10,10 @@ // version 1.0 as appearing in the file LICENSE.QPL included in the // packaging of this file. // + +/** \file class_continued_channel.h + * Do not include this header file directly, instead include "\ref preparation_step2 "debug.h"". + */ #ifndef LIBCW_CONTINUED_CHANNEL_H #define LIBCW_CONTINUED_CHANNEL_H Index: src/libcwd/include/libcw/class_debug.h diff -u src/libcwd/include/libcw/class_debug.h:1.1.2.7 src/libcwd/include/libcw/class_debug.h:1.1.2.8 --- src/libcwd/include/libcw/class_debug.h:1.1.2.7 Mon Nov 19 20:32:39 2001 +++ src/libcwd/include/libcw/class_debug.h Sat Dec 1 17:01:31 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_debug.h,v 1.1.2.7 2001/11/20 04:32:39 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_debug.h,v 1.1.2.8 2001/12/02 01:01:31 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -11,6 +11,10 @@ // packaging of this file. // +/** \file class_debug.h + * Do not include this header file directly, instead include "\ref preparation_step2 "debug.h"". + */ + #ifndef LIBCW_CLASS_DEBUG_H #define LIBCW_CLASS_DEBUG_H @@ -57,20 +61,19 @@ * * \brief The %Debug Stream class. * - * Libcwd declares a %debug class (debug_ct) which can be assigned an ostream to which %debug output - * will be written. Such a %debug object can dynamically be turned \link on() on \endlink and - * \link off() off \endlink. - * When the %debug object is turned off, no %debug output is written to its - * \link debug_ct_device ostream \endlink; in fact, the data that otherwise would be written is not - * even evaluated (see \ref eval_example "example" below). + * Libcwd declares a %debug class (debug_ct) which can be assigned an ostream to which %debug output will be written. + * Such a %debug object can dynamically be turned \link debug_ct::on on \endlink + * and \link debug_ct::off off \endlink. + * When the %debug object is turned off, no %debug output is written to its \link chapter_destination ostream \endlink; + * in fact, the data that otherwise would be written is not even evaluated (see \ref eval_example "example" below). * The %debug code can also completely be omitted, by not defining the macro CWDEBUG. * - * Libcwd defines and uses only one %debug object: \link libcw::debug::libcw_do libcw_do \endlink (the _do stands for %Debug Object). + * Libcwd defines and uses only one %debug object: \ref libcw_do (the _do stands for %Debug Object). * However, it is possible to \link custom_do create more \endlink %debug objects which would allow one to write %debug output to * two or more different output devices at the same time (for instance, the screen and a file). * * For each %debug object it is possible to set a margin and a marker string and to set the size of the current indentation. - * The methods used for setting or changing these prefix formatting attributes are listed in \ref debug_ct_formatting. + * The methods used for setting or changing these prefix formatting attributes are listed in \ref chapter_formatting. */ class debug_ct { public: // Direct access needed in macro LibcwDout(). Do not write to these. @@ -136,10 +139,8 @@ public: - /** \defgroup debug_ct_formatting Formatting methods and attributes of class debug_ct + /** \addtogroup chapter_formatting * - * \brief Public attributes of libcw::debug::debug_ct for setting or changing the format of the debug output. - * * All debug output is written in the following format: * * <margin> <label> <marker> <indentation> <data> <suffix> @@ -161,8 +162,10 @@ * Finally, the <suffix> field is by default a new-line, optionally followed by a flush. * The %debug control flag error_cf however, causes an error message to be inserted first. * The suffix field could become for example ": EAGAIN (Try again)\\n". + * + * \sa chapter_control_flags * - * \par Example: + * <b>Example:</b> * * \code * Debug( libcw_do.margin.assign("*** ", 4) ); @@ -214,7 +217,7 @@ // Manipulators and accessors for the above "format" attributes: // - /** \addtogroup debug_ct_formatting */ + /** \addtogroup chapter_formatting */ /* \{ */ /** \brief Set number of spaces to indent. */ @@ -247,12 +250,12 @@ // Other accessors // - /** \defgroup debug_ct_device libcw::debug::debug_ct ostream Manipulation Methods + /** \addtogroup chapter_destination * - * Basically, a %debug object (debug_ct) is a pointer to an ostream with a few extra attributes - * added to give it an internal state for \link libcw::debug::debug_ct::on() on \endlink (pass - * output on) and \link libcw::debug::debug_ct::off() off \endlink (don't pass output on) - * as well as some \link debug_ct_formatting formatting \endlink information of how to write the + * Basically, a %debug object (\link libcw::debug::debug_ct debug_ct \endlink) is a pointer to an ostream + * with a few extra attributes added to give it an internal state for \link libcw::debug::debug_ct::on() on \endlink + * (pass output on) and \link libcw::debug::debug_ct::off() off \endlink (don't pass output on) + * as well as some \link chapter_formatting formatting \endlink information of how to write the * data that is passed on to its ostream. * * The methods of \link libcw::debug::debug_ct debug_ct \endlink given here allow you to set @@ -321,7 +324,7 @@ // Manipulators: // - /** \addtogroup debug_ct_device */ + /** \addtogroup chapter_destination */ /* \{ */ /** @@ -345,7 +348,7 @@ * These pairs can be nested. * * \anchor eval_example - * \par Example: + * <b>Example:</b> * * \code * int i = 0; Index: src/libcwd/include/libcw/class_debug_string.h diff -u src/libcwd/include/libcw/class_debug_string.h:1.1.2.5 src/libcwd/include/libcw/class_debug_string.h:1.1.2.6 --- src/libcwd/include/libcw/class_debug_string.h:1.1.2.5 Mon Nov 19 20:32:39 2001 +++ src/libcwd/include/libcw/class_debug_string.h Sat Dec 1 17:01:31 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_debug_string.h,v 1.1.2.5 2001/11/20 04:32:39 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_debug_string.h,v 1.1.2.6 2001/12/02 01:01:31 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -11,6 +11,10 @@ // packaging of this file. // +/** \file cla... [truncated message content] |
From: Carlo W. <li...@us...> - 2001-12-06 06:01:30
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-11-06 06:01:27 UTC Modified files: Tag: branch-threading libcwd/bfd.cc libcwd/debug.cc libcwd/debugmalloc.cc libcwd/demangle.cc libcwd/demangle3.cc libcwd/elf32.cc libcwd/type_info.cc libcwd/documentation/alloc_intro.dox libcwd/documentation/allocated_memory_overview.dox libcwd/documentation/custom-debug.h.dox libcwd/documentation/custom_do.dox libcwd/documentation/deallocation_pointer_validation.dox libcwd/documentation/debug_channels.dox libcwd/documentation/doxygen.config libcwd/documentation/html.header libcwd/documentation/location.dox libcwd/documentation/magic.dox libcwd/documentation/mainpage.dox libcwd/documentation/memory_leak_checking.dox libcwd/documentation/modules.dox libcwd/documentation/nested.dox libcwd/documentation/preparation.dox 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_debug.h libcwd/include/libcw/class_debug_string.h libcwd/include/libcw/class_location.h libcwd/include/libcw/control_flag.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/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/pc_mangled_function_name.h libcwd/include/libcw/type_info.h libcwd/utils/exec_prog.cc Added files: Tag: branch-threading libcwd/documentation/control_flags.dox libcwd/documentation/debug_object.dox libcwd/documentation/destination.dox libcwd/documentation/fatal_output.dox libcwd/documentation/finding.dox libcwd/documentation/formatting.dox libcwd/documentation/invisible.dox libcwd/documentation/locations.dox libcwd/documentation/reference.dox libcwd/documentation/special.dox libcwd/documentation/symbols_intro.dox libcwd/documentation/type_info.dox libcwd/documentation/writing_intro.dox libcwd/include/cwd_debug.h Removed files: Tag: branch-threading libcwd/include/debug.h Log message: Work in progress (mostly on the documentation). Moved include/debug.h to include/cwd_debug.h because doxygen doesn't understand what a directory is. ---------------------- diff included ---------------------- Index: src/libcwd/bfd.cc diff -u src/libcwd/bfd.cc:1.85.2.31 src/libcwd/bfd.cc:1.85.2.32 --- src/libcwd/bfd.cc:1.85.2.31 Sat Dec 1 17:01:30 2001 +++ src/libcwd/bfd.cc Wed Dec 5 22:01:14 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.85.2.31 2001/12/02 01:01:30 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.85.2.32 2001/12/06 06:01:14 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -45,7 +45,7 @@ #endif #include <cstdio> // Needed for vsnprintf. #include <algorithm> -#include "debug.h" +#include "cwd_debug.h" #include "ios_base_Init.h" #ifdef CWDEBUG_DLOPEN_DEFINED #undef dlopen @@ -1098,7 +1098,7 @@ } // namespace cwbfd - /** \addtogroup chapter_locations */ + /** \addtogroup group_locations */ /** \{ */ char const* const unknown_function_c = "<unknown function>"; @@ -1124,7 +1124,7 @@ return symbol->get_symbol()->name; } - /** \} */ // End of group 'chapter_locations'. + /** \} */ // End of group 'group_locations'. struct bfd_location_ct : public location_ct { friend _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, bfd_location_ct const& data); @@ -1385,7 +1385,7 @@ * Write the contents of a location_ct object to an ostream in * the form source-%file:line-number, or writes "<unknown location>" * when the location is unknown. - * \ingroup chapter_locations + * \ingroup group_locations */ std::ostream& operator<<(std::ostream& os, location_ct const& location) { Index: src/libcwd/debug.cc diff -u src/libcwd/debug.cc:1.46.2.39 src/libcwd/debug.cc:1.46.2.40 --- src/libcwd/debug.cc:1.46.2.39 Sat Dec 1 17:01:30 2001 +++ src/libcwd/debug.cc Wed Dec 5 22:01:15 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.46.2.39 2001/12/02 01:01:30 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.46.2.40 2001/12/06 06:01:15 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -19,7 +19,7 @@ #include <sys/resource.h> // Needed for setrlimit() #include <algorithm> #include <new> -#include "debug.h" +#include "cwd_debug.h" #include <libcw/strerrno.h> #include "private_debug_stack.inl" @@ -149,7 +149,7 @@ * \brief The default %debug object. * * The %debug object that is used by default by Dout and DoutFatal, the only %debug object used by libcwd itself. - * \sa \ref custom_do + * \sa \ref chapter_custom_do */ debug_ct libcw_do; @@ -162,7 +162,9 @@ namespace channels { namespace dc { - /** \addtogroup group_default_dc Pre-Defined Debug Channels + /** + * \addtogroup group_default_dc Predefined Debug Channels + * \ingroup chapter_debug_channels * * These are the default %debug %channels pre-defined in libcwd. */ @@ -438,6 +440,12 @@ static char WST_dummy_laf[sizeof(laf_ct)] __attribute__((__aligned__)); } + /** + * \fn void core_dump(void) + * \ingroup group_special + * + * \brief Dump core of current thread. + */ void core_dump(void) { #ifdef LIBCWD_THREAD_SAFE @@ -969,6 +977,9 @@ } /** + * \fn channel_ct* find_channel(char const* label) + * \ingroup group_special + * * \brief Find %debug channel with label \a label. * * \return A pointer to the %debug channel object whose name starts with \a label. @@ -990,7 +1001,9 @@ return tmp; } - /** \fn void list_channels_on(debug_ct const& debug_object) + /** + * \fn void list_channels_on(debug_ct const& debug_object) + * \ingroup group_special * * \brief List all %debug %channels to a given %debug object. * Index: src/libcwd/debugmalloc.cc diff -u src/libcwd/debugmalloc.cc:1.61.2.45 src/libcwd/debugmalloc.cc:1.61.2.46 --- src/libcwd/debugmalloc.cc:1.61.2.45 Sat Dec 1 17:01:30 2001 +++ src/libcwd/debugmalloc.cc Wed Dec 5 22:01:15 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.61.2.45 2001/12/02 01:01:30 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.61.2.46 2001/12/06 06:01:15 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -152,7 +152,7 @@ #endif // LIBCWD_THREAD_SAFE #include <iostream> #include <iomanip> -#include "debug.h" +#include "cwd_debug.h" #include "ios_base_Init.h" #include <libcw/cwprint.h> @@ -1505,6 +1505,16 @@ // 'Accessor' functions // +/** + * \brief Test if a pointer points to the start of an allocated memory block. + * \ingroup book_allocations + * + * \returns \c true when \a ptr does \em not point to the start of an allocated memory block. + * No checks are performed on the type of allocator that was used: that is done when + * the memory block is actually deleted, see \ref chapter_validation. + * + * Unlike \ref find_alloc, \c test_delete also works for \ref group_invisible "invisible" memory blocks. + */ bool test_delete(void const* ptr) { ACQUIRE_READ_LOCK @@ -1519,6 +1529,10 @@ return res; } +/** + * \brief Returns the total number of allocated bytes. + * \ingroup book_allocations + */ size_t mem_size(void) { ACQUIRE_READ_LOCK @@ -1527,6 +1541,10 @@ return memsize; } +/** + * \brief Returns the total number of allocated memory blocks. + * \ingroup book_allocations + */ unsigned long mem_blocks(void) { ACQUIRE_READ_LOCK @@ -1535,6 +1553,12 @@ return memblks; } +/** + * \brief Allow writing of enum malloc_report_nt to an ostream. + * \ingroup chapter_overview + * + * \sa \ref malloc_report + */ std::ostream& operator<<(std::ostream& o, malloc_report_nt) { ACQUIRE_READ_LOCK @@ -1545,9 +1569,9 @@ return o; } -/** \fn void list_allocations_on(debug_ct& debug_object) - * +/** * \brief List all current allocations to a given %debug object. + * \ingroup chapter_overview * * With both, \link enable_libcwd_debugm DEBUGMALLOC \endlink and * \link enable_libcwd_debug DEBUGDEBUG \endlink defined, it is possible @@ -1561,8 +1585,6 @@ * * which would print on \link libcw::debug::libcw_do libcw_do \endlink using * \ref chapter_debug_channels "debug channel" \link libcw::debug::dc::malloc dc::malloc \endlink. - * - * \sa \ref chapter_overview */ void list_allocations_on(debug_ct& debug_object) { @@ -1603,6 +1625,22 @@ // 'Manipulator' functions // +/** + * \brief Make allocation pointed to by \a ptr invisible. + * \ingroup group_invisible + * + * The allocation pointed to by \a ptr is made invisible; it won't show up + * anymore in the \ref chapter_overview "overview of allocated memory". + * + * \sa \ref group_invisible + * \sa \ref chapter_overview + * + * <b>Example:</b> + * + * \code + * Debug( make_invisible(p) ); + * \endcode + */ void make_invisible(void const* ptr) { LIBCWD_TSD_DECLARATION @@ -1625,6 +1663,24 @@ __libcwd_tsd.internal = 0; } +/** + * \brief Make all current allocations invisible except the given pointer. + * \ingroup group_invisible + * + * All allocations, except the given pointer, are made invisible; they won't show up + * anymore in the \ref chapter_overview "overview of allocated memory". + * + * If you want to make \em all allocations invisible, just pass \c NULL as parameter. + * + * \sa \ref group_invisible + * \sa \ref chapter_overview + * + * <b>Example:</b> + * + * \code + * Debug( make_all_allocations_invisible_except(NULL) ); + * \endcode + */ void make_all_allocations_invisible_except(void const* ptr) { LIBCWD_TSD_DECLARATION @@ -1802,6 +1858,33 @@ } #endif // DEBUGMARKER +/** + * \brief Find information about a memory allocation. + * \ingroup group_finding + * + * Given a pointer, which points to the start of or inside an allocated memory block, + * it is possible to find information about this memory block using the libcwd function + * \c find_alloc. + * + * \returns a const pointer to an object of class alloc_ct. + * + * \sa \ref test_delete() + * + * <b>Example:</b> + * + * \code + * char* buf = new char [40]; + * AllocTag(buf, "A buffer"); + * libcw::debug::alloc_ct const* alloc = libcw::debug::find_alloc(&buf[10]); + * std::cout << '"' << alloc->description() << "\" is " << alloc->size() << " bytes.\n"; + * \endcode + * + * gives as output, + * + * \exampleoutput <PRE> + * "A buffer" is 40 bytes.</PRE> + * \endexampleoutput + */ alloc_ct const* find_alloc(void const* ptr) { #ifdef DEBUGDEBUGMALLOC Index: src/libcwd/demangle.cc diff -u src/libcwd/demangle.cc:1.20.2.9 src/libcwd/demangle.cc:1.20.2.10 --- src/libcwd/demangle.cc:1.20.2.9 Sat Oct 20 20:14:01 2001 +++ src/libcwd/demangle.cc Wed Dec 5 22:01:15 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/demangle.cc,v 1.20.2.9 2001/10/21 03:14:01 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/demangle.cc,v 1.20.2.10 2001/12/06 06:01:15 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -32,7 +32,7 @@ #if __GXX_ABI_VERSION == 0 #include <cctype> -#include "debug.h" +#include "cwd_debug.h" #include <libcw/demangle.h> #ifdef HAVE_LIMITS Index: src/libcwd/demangle3.cc diff -u src/libcwd/demangle3.cc:1.8.2.18 src/libcwd/demangle3.cc:1.8.2.19 --- src/libcwd/demangle3.cc:1.8.2.18 Sat Dec 1 17:01:31 2001 +++ src/libcwd/demangle3.cc Wed Dec 5 22:01:15 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/demangle3.cc,v 1.8.2.18 2001/12/02 01:01:31 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/demangle3.cc,v 1.8.2.19 2001/12/06 06:01:15 libcw Exp $ // // Copyright (C) 2001, by // @@ -12,8 +12,8 @@ // /*! -\addtogroup group_demangle demangle_type() And demangle_symbol() -\ingroup chapter_type_info +\addtogroup group_demangle demangle_type() and demangle_symbol() +\ingroup group_type_info Libcwd comes with its own demangler functions. @@ -41,7 +41,7 @@ #undef CPPFILTCOMPATIBLE #include "sys.h" -#include "debug.h" +#include "cwd_debug.h" #include <libcw/demangle.h> #include <libcw/private_assert.h> Index: src/libcwd/documentation/alloc_intro.dox diff -u src/libcwd/documentation/alloc_intro.dox:1.1.2.1 src/libcwd/documentation/alloc_intro.dox:1.1.2.2 --- src/libcwd/documentation/alloc_intro.dox:1.1.2.1 Sat Dec 1 17:01:31 2001 +++ src/libcwd/documentation/alloc_intro.dox Wed Dec 5 22:01:16 2001 @@ -1,6 +1,10 @@ /*! - -\addtogroup chapter_allocations_intro +\defgroup book_allocations_intro Memory Allocation Debug Support: Introduction +\ingroup book_allocations +*/ +/*! +\page page_allocations_intro +\ingroup book_allocations_intro Unless \link enable_libcwd_alloc --disable-libcwd-alloc \endlink was specified during configuration then the following memory allocation and de-allocation debugging features are provided by libcwd: Index: src/libcwd/documentation/allocated_memory_overview.dox diff -u src/libcwd/documentation/allocated_memory_overview.dox:1.1.2.1 src/libcwd/documentation/allocated_memory_overview.dox:1.1.2.2 --- src/libcwd/documentation/allocated_memory_overview.dox:1.1.2.1 Sat Dec 1 17:01:31 2001 +++ src/libcwd/documentation/allocated_memory_overview.dox Wed Dec 5 22:01:16 2001 @@ -1,6 +1,10 @@ /*! - -\addtogroup chapter_overview +\defgroup chapter_overview Overview Of Allocated Memory +\ingroup book_allocations +*/ +/*! +\page page_overview +\ingroup chapter_overview An example output, using libcw-0.2.5, is given below. Please follow the links to get a short explanation. Index: src/libcwd/documentation/control_flags.dox diff -u /dev/null src/libcwd/documentation/control_flags.dox:1.1.2.1 --- /dev/null Wed Dec 5 22:01:27 2001 +++ src/libcwd/documentation/control_flags.dox Wed Dec 5 22:01:16 2001 @@ -0,0 +1,8 @@ +/*! +\addtogroup group_control_flags Control Flags +\ingroup book_writing +*/ +/*! +\page page_control_flags +\ingroup group_control_flags +*/ Index: src/libcwd/documentation/custom-debug.h.dox diff -u src/libcwd/documentation/custom-debug.h.dox:1.1.2.3 src/libcwd/documentation/custom-debug.h.dox:1.1.2.4 --- src/libcwd/documentation/custom-debug.h.dox:1.1.2.3 Sat Dec 1 17:01:31 2001 +++ src/libcwd/documentation/custom-debug.h.dox Wed Dec 5 22:01:16 2001 @@ -2,8 +2,12 @@ #define debug somethingelse /*! - -\defgroup custom_debug_h The Custom debug.h file +\defgroup chapter_custom_debug_h The Custom debug.h File +\ingroup book_start +*/ +/*! +\page page_custom_debug_h +\ingroup chapter_custom_debug_h \section debug_channels_and_namespace Debug channels and namespace Index: src/libcwd/documentation/custom_do.dox diff -u src/libcwd/documentation/custom_do.dox:1.1.2.2 src/libcwd/documentation/custom_do.dox:1.1.2.3 --- src/libcwd/documentation/custom_do.dox:1.1.2.2 Sat Dec 1 17:01:31 2001 +++ src/libcwd/documentation/custom_do.dox Wed Dec 5 22:01:16 2001 @@ -1,14 +1,18 @@ /*! +\defgroup chapter_custom_do Custom Debug Objects +\ingroup group_destination +*/ +/*! +\page page_custom_do +\ingroup chapter_custom_do -\page custom_do Custom Debug Objects - Each %debug object is associated with one ostream. The default %debug output macros Dout and DoutFatal use the \em default debug object libcw::debug::libcw_do. Other %debug objects may be created as global objects; it is convenient to define new macros for each (custom) %debug object using the generic macros -\link libcw::debug::LibcwDout LibcwDout \endlink and \link libcw::debug::LibcwDoutFatal LibcwDoutFatal \endlink. +\ref LibcwDout and \ref LibcwDoutFatal. -For example, add something like the following to your own \link custom_debug_h "debug.h" \endlink file: +For example, add something like the following to your own \link chapter_custom_debug_h "debug.h" \endlink file: \code #ifdef CWDEBUG Index: src/libcwd/documentation/deallocation_pointer_validation.dox diff -u src/libcwd/documentation/deallocation_pointer_validation.dox:1.1.2.2 src/libcwd/documentation/deallocation_pointer_validation.dox:1.1.2.3 --- src/libcwd/documentation/deallocation_pointer_validation.dox:1.1.2.2 Sat Dec 1 17:01:31 2001 +++ src/libcwd/documentation/deallocation_pointer_validation.dox Wed Dec 5 22:01:16 2001 @@ -1,7 +1,11 @@ /*! +\defgroup chapter_validation De-Allocation Pointer Validation +\ingroup book_allocations +*/ +/*! +\page page_validation +\ingroup chapter_validation -\addtogroup chapter_validation - A pointer passed to a de-allocation (or re-allocation) function is checked to be valid; it should be previously returned by a corresponding (re-)allocation function and not have been de-allocated before. @@ -40,7 +44,7 @@ Note: When libcwd was configured with \link enable_libcwd_magic --disable-libcwd-magic \endlink then the check whether or not the de-allocated memory block was allocated with the corresponding -allocation function is \em not performed when the memory block is \ref chapter_invisible "invisible". +allocation function is \em not performed when the memory block is \ref group_invisible "invisible". The reason for this is that invisible memory blocks are simply not stored in the internal data structure: No information is known about them. Index: src/libcwd/documentation/debug_channels.dox diff -u src/libcwd/documentation/debug_channels.dox:1.1.2.1 src/libcwd/documentation/debug_channels.dox:1.1.2.2 --- src/libcwd/documentation/debug_channels.dox:1.1.2.1 Sat Dec 1 17:01:31 2001 +++ src/libcwd/documentation/debug_channels.dox Wed Dec 5 22:01:16 2001 @@ -1,6 +1,12 @@ /*! +\defgroup chapter_debug_channels Controlling The Output Level (Debug Channels) +\ingroup book_writing +*/ +/*! +\page page_debug_channels +\ingroup chapter_debug_channels -\addtogroup chapter_debug_channels +<hr> Whenever debug output is written, one or more <i>debug channels</i> must be specified. The debug output is then written to the ostream of the debug object @@ -29,7 +35,7 @@ be seen as the bit-wise OR operation on the bit-masks that these channels actually represent. -\sa chapter_control_flags +\sa group_control_flags <b>Example:</b> Index: src/libcwd/documentation/debug_object.dox diff -u /dev/null src/libcwd/documentation/debug_object.dox:1.1.2.1 --- /dev/null Wed Dec 5 22:01:28 2001 +++ src/libcwd/documentation/debug_object.dox Wed Dec 5 22:01:16 2001 @@ -0,0 +1,27 @@ +/*! +\defgroup chapter_debug_object The Output Device (Debug Object) +\ingroup book_writing +*/ +/*! +\page page_debug_object +\ingroup chapter_debug_object + +<hr> + +Libcwd declares a %debug class (\ref libcw::debug::debug_ct "debug_ct") which can be assigned an <code>ostream</code> + to which %debug output will be written. +Such a %debug object can dynamically be turned \link libcw::debug::debug_ct::on on \endlink +and \link libcw::debug::debug_ct::off off \endlink. +When the %debug object is turned off, no %debug output is written to its \link group_destination ostream \endlink; +in fact, the data that otherwise would be written is not even evaluated (see \ref eval_example "example"). +The %debug code can also completely be omitted, by not defining the macro CWDEBUG. + +Libcwd defines and uses only one %debug object: \ref libcw::debug::libcw_do "libcw_do" (the _do stands for %Debug Object). +However, it is possible to \link chapter_custom_do create more \endlink %debug objects which would allow one to write %debug output to +two or more different output devices at the same time (for instance, the screen and a file). + +For each %debug object it is possible to set a margin and a marker string and to set the size of the current indentation. +The methods used for setting or changing these prefix formatting attributes are listed in \ref group_formatting. + +*/ + Index: src/libcwd/documentation/destination.dox diff -u /dev/null src/libcwd/documentation/destination.dox:1.1.2.1 --- /dev/null Wed Dec 5 22:01:28 2001 +++ src/libcwd/documentation/destination.dox Wed Dec 5 22:01:16 2001 @@ -0,0 +1,20 @@ +/*! +\addtogroup group_destination Setting The Output Destination +\ingroup book_writing +*/ +/*! +\page page_destination +\ingroup group_destination + +<hr><h2>Detailed Description</h2> + +Basically, a %debug object (\link libcw::debug::debug_ct debug_ct \endlink) is a pointer to an ostream +with a few extra attributes added to give it an internal state for \link libcw::debug::debug_ct::on() on \endlink +(pass output on) and \link libcw::debug::debug_ct::off() off \endlink (don't pass output on) +as well as some \link group_formatting formatting \endlink information of how to write the +data that is passed on to its ostream. + +The methods of \link libcw::debug::debug_ct debug_ct \endlink given here allow you to set +or get this ostream (pointer). + +*/ Index: src/libcwd/documentation/doxygen.config diff -u src/libcwd/documentation/doxygen.config:1.1.2.8 src/libcwd/documentation/doxygen.config:1.1.2.9 --- src/libcwd/documentation/doxygen.config:1.1.2.8 Sat Dec 1 17:01:31 2001 +++ src/libcwd/documentation/doxygen.config Wed Dec 5 22:01:16 2001 @@ -7,7 +7,7 @@ PROJECT_NUMBER = "libcwd 0.99.16" OUTPUT_DIRECTORY = OUTPUT_LANGUAGE = English -EXTRACT_ALL = NO +EXTRACT_ALL = YES EXTRACT_PRIVATE = NO EXTRACT_STATIC = NO HIDE_UNDOC_MEMBERS = YES @@ -97,7 +97,7 @@ GENERATE_CHI = NO BINARY_TOC = NO TOC_EXPAND = NO -DISABLE_INDEX = NO +DISABLE_INDEX = YES ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = NO TREEVIEW_WIDTH = 250 Index: src/libcwd/documentation/fatal_output.dox diff -u /dev/null src/libcwd/documentation/fatal_output.dox:1.1.2.1 --- /dev/null Wed Dec 5 22:01:28 2001 +++ src/libcwd/documentation/fatal_output.dox Wed Dec 5 22:01:16 2001 @@ -0,0 +1,45 @@ +/*! +\defgroup chapter_fatal_output Fatal Debug Output +\ingroup book_writing +*/ +/*! +\page page_fatal_output +\ingroup chapter_fatal_output + +<hr> + +Often an application needs to be terminated when a fatal error occurs (whether or not CWDEBUG +is defined). Libcwd defines for these cases the macro DoutFatal. + +This allows you to write + +\code +if (error) + DoutFatal(dc::core|error_cf, "An error occurred"); +\endcode + +instead of the equivalent + +\code +if (error) +{ + Dout(dc::core|error_cf, "An error occurred"); + std::cerr << "An error occurred" << std::endl; + exit(254); +} +\endcode + +The big difference with Dout is that DoutFatal is not replaced with white space when +the macro CWDEBUG is not defined. + +There are two %debug %channels that can be used together with DoutFatal: +\link libcw::debug::channels::dc::fatal dc::fatal \endlink and +\link libcw::debug::channels::dc::core dc::core \endlink. +The first terminates by calling <CODE>exit(254)</CODE>, +the second terminates by raising SIGABORT, causing the application to core dump. + +\sa \ref group_default_dc + \n \ref group_control_flags + \n \link chapter_custom_do Defining your own debug objects \endlink + +*/ Index: src/libcwd/documentation/finding.dox diff -u /dev/null src/libcwd/documentation/finding.dox:1.1.2.1 --- /dev/null Wed Dec 5 22:01:28 2001 +++ src/libcwd/documentation/finding.dox Wed Dec 5 22:01:16 2001 @@ -0,0 +1,9 @@ +/*! +\addtogroup group_finding Finding (Information About) Memory Allocations +\ingroup book_allocations +*/ +/*! +\page page_finding +\ingroup group_finding +*/ + Index: src/libcwd/documentation/formatting.dox diff -u /dev/null src/libcwd/documentation/formatting.dox:1.1.2.1 --- /dev/null Wed Dec 5 22:01:28 2001 +++ src/libcwd/documentation/formatting.dox Wed Dec 5 22:01:16 2001 @@ -0,0 +1,56 @@ +/*! +\addtogroup group_formatting Format Of The Debug Output +\ingroup book_writing +*/ +/*! +\page page_formatting +\ingroup group_formatting + +<hr><h2>Detailed Description</h2> + +All debug output is written in the following format: + +<margin> <label> <marker> <indentation> <data> <suffix> + +The <margin> field can for instance be used to print the ID of the process or thread +(useful when writing %debug messages from more than one process or thread to the same ostream device). + +The <marker> field can be used to identify regions (for example with a vertical line) depending on the current context. + +The <indentation> field consists of spaces and is intended to make %debug output better readable by grouping lines of %debug output +as an easier alternative than using the marker field for that purpose. + +The <label> field exists of the channel label (as passed to the constructor of a \link libcw::debug::channel_ct channel_ct \endlink) +padded by spaces to make this field constant in width (it is padded to the length of the longest existing channel label), +followed by the marker, which is by default a colon plus a final space; for example "NOTICE : ". + +The <data> field represents the second field of the \ref Dout macro, written to the %debug ostream with the operator<< inserters. + +Finally, the <suffix> field is by default a new-line, optionally followed by a flush. +The %debug control flag error_cf however, causes an error message to be inserted first. +The suffix field could become for example ": EAGAIN (Try again)\\n". + +\sa group_control_flags + +<b>Example:</b> + +\code +Debug( libcw_do.margin.assign("*** ", 4) ); +Debug( libcw_do.marker.assign(": | ", 4) ); +Dout(dc::notice, "This line is not indented"); +Debug( libcw_do.set_indent(4) ); +Dout(dc::notice, "This line is indented 4 spaces"); +Debug( libcw_do.inc_indent(2) ); +Dout(dc::notice, "This line is indented 6 spaces"); +\endcode + +Outputs + +<PRE class="example-output"> +*** NOTICE : | This line is not indented +*** NOTICE : | This line is indented 4 spaces +*** NOTICE : | This line is indented 6 spaces +</PRE> + +*/ + Index: src/libcwd/documentation/html.header diff -u src/libcwd/documentation/html.header:1.1.2.1 src/libcwd/documentation/html.header:1.1.2.2 --- src/libcwd/documentation/html.header:1.1.2.1 Fri Oct 26 15:58:03 2001 +++ src/libcwd/documentation/html.header Wed Dec 5 22:01:16 2001 @@ -16,10 +16,12 @@ <center> <a class="qindex" href="index.html">Main Page</a> +<a class="qindex" href="reference.html">Reference Manual</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="annotated.html">Compound List</a> -<a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> +<a class="qindex" href="functions.html">Compound Members</a> +<a class="qindex" href="globals.html">File Members</a> </center> <HR SIZE=1 NOSHADE> Index: src/libcwd/documentation/invisible.dox diff -u /dev/null src/libcwd/documentation/invisible.dox:1.1.2.1 --- /dev/null Wed Dec 5 22:01:28 2001 +++ src/libcwd/documentation/invisible.dox Wed Dec 5 22:01:16 2001 @@ -0,0 +1,20 @@ +/*! +\addtogroup group_invisible Invisible Allocations +\ingroup chapter_overview +*/ +/*! +\page page_invisible +\ingroup group_invisible + +<hr><h2>Detailed Description</h2> + +Allocated memory blocks can be made invisible: They won't show up in +the \ref chapter_overview "overview of allocated memory" anymore. +Even more, the corresponding \ref libcw::debug::alloc_ct "alloc_ct" is destroyed: +\ref libcw::debug::find_alloc "find_alloc" will not find them anymore. +There is no other effect, \ref libcw::debug::test_delete "test_delete" will still work +and they still can be deleted in the normal way. + +*/ + + Index: src/libcwd/documentation/location.dox diff -u src/libcwd/documentation/location.dox:1.1.2.2 src/libcwd/documentation/location.dox:1.1.2.3 --- src/libcwd/documentation/location.dox:1.1.2.2 Sat Dec 1 17:01:31 2001 +++ src/libcwd/documentation/location.dox Wed Dec 5 22:01:16 2001 @@ -1,9 +1,13 @@ /*! +\defgroup chapter_alloc_locations Memory Allocation Debugging And Locations +\ingroup book_start +*/ +/*! +\page page_alloc_locations +\ingroup chapter_alloc_locations -\addtogroup chapter_alloc_locations Memory allocation debugging and locations +\section section_The_BFD_library The BFD library -\par The BFD library -\n Libcwd attempts to determine the source file and line number where memory is allocated. It does this by directly reading the .stabs section of the ELF32 object files. If you are using an Operating System that isn't ELF then you need to enable the use of libbfd for @@ -11,30 +15,32 @@ If you don't have an ELF system and you don't have libbfd installed and are not able to install it yourself (note: you also need libiberty and libdl) then you can disable it using \link enable_libcwd_location --disable-libcwd-location \endlink. -There is a seperate page that deals with libcwd and \link chapter_locations location \endlink support. +There is a seperate page that deals with libcwd and \link group_locations location \endlink support. This paragraph describes the effect of disabling source file and line number location support in relation to the memory allocation debugging support. -\par With location support -\n +\section section_With_location_support With location support + With \link enable_libcwd_location --enable-libcwd-location \endlink, libcwd will write the source file and line number information about where memory allocations are done to the \link chapter_debug_channels debug channels \endlink \link libcw::debug::channels::dc::bfd dc::bfd \endlink. -<br><br> + For example, + \exampleoutput <PRE> MALLOC : operator new (size = 4) = <unfinished> BFD : 0x804bc9b is at (deb.cc:179) MALLOC : <continued> 0x8137220</PRE> \endexampleoutput + which means that <CODE>operator new</CODE> was called at address 0x804bc9b corresponding to line 179 of source file <TT>deb.cc</TT>. -<br><br> + Source file and line number information is also shown in the \ref chapter_overview "overview of allocated memory" and when a memory block is freed. + +\section section_Without_location_support Without location support -\par Without location support -\n Without support the source file and line number information will not be available. %Debug channel \link libcw::debug::channels::dc::bfd dc::bfd \endlink doesn't exist and the Allocated memory Overview will lack the source file location in column three. Index: src/libcwd/documentation/locations.dox diff -u /dev/null src/libcwd/documentation/locations.dox:1.1.2.1 --- /dev/null Wed Dec 5 22:01:28 2001 +++ src/libcwd/documentation/locations.dox Wed Dec 5 22:01:16 2001 @@ -0,0 +1,15 @@ +/*! +\addtogroup group_locations Source-file:Line-number Information +\ingroup book_symbols +*/ +/*! +\page page_locations +\ingroup group_locations + +<hr><h2>Detailed Description</h2> + +When libcwd was configured with \ref enable_libcwd_location "--enable-libcwd-location", +then libcw allows one to easily obtain source-file / line-number information of a given address +using the class \ref libcw::debug::location_ct "location_ct". + +*/ Index: src/libcwd/documentation/magic.dox diff -u src/libcwd/documentation/magic.dox:1.1.2.1 src/libcwd/documentation/magic.dox:1.1.2.2 --- src/libcwd/documentation/magic.dox:1.1.2.1 Sat Dec 1 17:01:31 2001 +++ src/libcwd/documentation/magic.dox Wed Dec 5 22:01:16 2001 @@ -1,6 +1,10 @@ /*! - -\addtogroup chapter_magic_numbers Overflow/Underflow Protection (Red Zones) +\defgroup chapter_magic_numbers Overflow/Underflow Protection (Red Zones) +\ingroup book_allocations +*/ +/*! +\page page_magic_numbers +\ingroup chapter_magic_numbers Memory corruption bugs are usually very hard to find because they often lead to a program crash in a source line far from the point of the actual bug. Index: src/libcwd/documentation/mainpage.dox diff -u src/libcwd/documentation/mainpage.dox:1.1.2.4 src/libcwd/documentation/mainpage.dox:1.1.2.5 --- src/libcwd/documentation/mainpage.dox:1.1.2.4 Sat Dec 1 17:01:31 2001 +++ src/libcwd/documentation/mainpage.dox Wed Dec 5 22:01:16 2001 @@ -14,7 +14,7 @@ \li \ref downloading \li \ref preparation -\li \htmlonly <A href="modules.html">Reference manual</A> \endhtmlonly +\li \ref reference \section output_example Example output Index: src/libcwd/documentation/memory_leak_checking.dox diff -u src/libcwd/documentation/memory_leak_checking.dox:1.1.2.2 src/libcwd/documentation/memory_leak_checking.dox:1.1.2.3 --- src/libcwd/documentation/memory_leak_checking.dox:1.1.2.2 Sat Dec 1 17:01:31 2001 +++ src/libcwd/documentation/memory_leak_checking.dox Wed Dec 5 22:01:16 2001 @@ -1,6 +1,10 @@ /*! - -\addtogroup chapter_markers Memory Allocation Markers: Memory Leak Checking +\defgroup chapter_markers Memory Allocation Markers: Memory Leak Checking +\ingroup book_allocations +*/ +/*! +\page page_markers +\ingroup chapter_markers Libcwd does a weak attempt to support debugging of memory leaks. I hope to greatly improve this in the future. Index: src/libcwd/documentation/modules.dox diff -u src/libcwd/documentation/modules.dox:1.1.2.1 src/libcwd/documentation/modules.dox:1.1.2.2 --- src/libcwd/documentation/modules.dox:1.1.2.1 Sat Dec 1 17:01:31 2001 +++ src/libcwd/documentation/modules.dox Wed Dec 5 22:01:16 2001 @@ -1,46 +1,8 @@ -/** \addtogroup chapter_writing Writing Debug Output */ -/** \{ */ -/** \addtogroup chapter_writing_intro Writing Debug Output: Introduction */ -/** \addtogroup chapter_destination Setting The Output Destination */ -/** \{ */ -/** \addtogroup chapter_debug_object The Output Device (Debug Object) */ -/** \addtogroup custom_do Custom Debug Objects */ -/** \} */ -/** \addtogroup chapter_debug_channels Controlling The Output Level (Debug Channels) */ -/** \{ */ -/** \addtogroup group_default_dc */ -/** \} */ -/** \addtogroup chapter_formatting Format Of The Debug Output */ -/** \addtogroup chapter_control_flags Control Flags */ -/** \addtogroup chapter_fatal_output Fatal Debug Output */ -/** \addtogroup chapter_nesting Nesting Debug Output */ -/** \addtogroup chapter_special Special Functions And Utilities */ -/** \} */ +/** \addtogroup book_writing Writing Debug Output */ -/** \addtogroup chapter_allocations Memory Allocation Debug Support */ -/** \{ */ -/** \addtogroup chapter_allocations_intro Memory Allocation Debug Support: Introduction */ -/** \addtogroup chapter_validation De-Allocation Pointer Validation */ -/** \addtogroup chapter_magic_numbers Overflow/Underflow Protection (Red Zones) */ -/** \addtogroup chapter_annotation Allocation Annotation */ -/** \addtogroup chapter_overview Overview Of Allocated Memory */ -/** \{ */ -/** \addtogroup chapter_invisible */ -/** \} */ -/** \addtogroup chapter_finding Finding (Information About) Memory Allocations */ -/** \addtogroup chapter_markers Memory Allocation Markers: Memory Leak Checking */ -/** \} */ +/** \addtogroup book_allocations Memory Allocation Debug Support */ -/** \addtogroup chapter_symbols Program Symbols Access And Interpretation */ -/** \{ */ -/** \addtogroup chapter_symbols_intro Program Symbols Access And Interpretation: Introduction */ -/** \addtogroup chapter_locations Source File And Line Number Information */ -/** \addtogroup chapter_type_info Getting Type Information Of Types And Symbols */ -/** \} */ +/** \addtogroup book_symbols Program Symbols Access And Interpretation */ -/** \addtogroup chapter_start Configuration, Installation And Getting Started */ -/** \{ */ -/** \addtogroup group_configuration Configuration Options And Macros */ -/** \addtogroup chapter_alloc_locations */ -/** \} */ +/** \addtogroup book_start Configuration, Installation And Getting Started */ Index: src/libcwd/documentation/nested.dox diff -u src/libcwd/documentation/nested.dox:1.1.2.3 src/libcwd/documentation/nested.dox:1.1.2.4 --- src/libcwd/documentation/nested.dox:1.1.2.3 Sat Dec 1 17:01:31 2001 +++ src/libcwd/documentation/nested.dox Wed Dec 5 22:01:16 2001 @@ -1,10 +1,15 @@ /*! +\defgroup chapter_nesting Nesting Debug Output +\ingroup book_writing +*/ +/*! +\page page_nesting +\ingroup chapter_nesting -\addtogroup chapter_nesting Nesting Debug Output +\section section_nesting_calling Calling functions inside Dout -\par Calling functions inside Dout -\n Consider the following code: + \code int foobar(void) __attribute__ ((const)); @@ -22,37 +27,46 @@ return foobar(); } \endcode + This code would start a new debug message before the previous debug message is finished. Libcwd detects this and will output: + \exampleoutput <PRE> NOTICE: Entering foobar() NOTICE: Leaving foobar() KERNEL: The value of foobar() = 2, aint that nice?</PRE> \endexampleoutput + Note the indentation and the fact that the printing of the label KERNEL was delayed. + +\section using_continued Using continued_cf, dc::continued and dc::finish -\anchor using_continued -\par Using continued_cf, dc::continued and dc::finish -\n In the previous section <CODE>foobar()</CODE> was a const function: it didn't matter whether or not it was called for the functionality of the application. But when it does matter, then one might want to do something like this: + \code Dout( dc::kernel|flush_cf|continued_cf, "Generating tables... " ); generate_tables(); Dout( dc::finish, "done" ); \endcode + If generate_tables() would not print debug messages, then the output will look like: + \exampleoutput <PRE> KERNEL: Generating tables... done</PRE> \endexampleoutput + When it does generated debug output, then the <unfinished> and <continued> labels are printed also: + \exampleoutput <PRE> KERNEL: Generating tables... <unfinished> NOTICE: Inside generate_tables() KERNEL: <continued> done</PRE> \endexampleoutput + Finally, it is also possible to split a debug line into more then two parts by using the special dc::continued debug channel. + \code Dout( dc::notice|flush_cf|continued_cf, "Generating tables." ); for(int i = 0; i < 8; ++i) @@ -62,16 +76,21 @@ } Dout( dc::finish, " done" ); \endcode + When generate_table(i) doesn't print debug messages, then the output will look like: + \exampleoutput <PRE> NOTICE: Generating tables......... done</PRE> \endexampleoutput + When it does generate debug output, then each dot would be surrounded by a <continued> .<unfinished> : + \exampleoutput <PRE> NOTICE: Generating tables.<unfinished> TABLE : Inside generate_table(0) NOTICE: <continued> .<unfinished></PRE> \endexampleoutput + etc. */ Index: src/libcwd/documentation/preparation.dox diff -u src/libcwd/documentation/preparation.dox:1.1.2.3 src/libcwd/documentation/preparation.dox:1.1.2.4 --- src/libcwd/documentation/preparation.dox:1.1.2.3 Sat Dec 1 17:01:31 2001 +++ src/libcwd/documentation/preparation.dox Wed Dec 5 22:01:16 2001 @@ -32,7 +32,7 @@ \htmlonly «<A HREF="../external/debug.h">download</A>»\endhtmlonly This %debug.h file is for applications, for more detailed information and for information -for library developers who want to use libbcwd, please also read \ref custom_debug_h. +for library developers who want to use libbcwd, please also read \ref chapter_custom_debug_h. \subsection custom_debug_cc Step 3: Creating the custom source file Index: src/libcwd/documentation/reference.dox diff -u /dev/null src/libcwd/documentation/reference.dox:1.1.2.3 --- /dev/null Wed Dec 5 22:01:28 2001 +++ src/libcwd/documentation/reference.dox Wed Dec 5 22:01:16 2001 @@ -0,0 +1,66 @@ +/*! + +\page reference Reference Manual: Table Of Contents + +<h2>Writing Debug Output</h2> +<ul> + <li>\ref book_writing_intro + <li>\ref group_destination + <li>\ref chapter_debug_object + <ul> + <li>\ref chapter_custom_do + </ul> + <li>\ref chapter_debug_channels + <ul> + <li>\ref group_default_dc + </ul> + <li>\ref group_control_flags + <li>\ref group_formatting + <li>\ref chapter_fatal_output + <li>\ref chapter_nesting + <li>\ref group_special +</ul> + +<h2>Memory Allocation Debug Support</h2> +<ul> + <li>\ref book_allocations_intro + <li>\ref chapter_validation + <li>\ref chapter_magic_numbers + <li>\ref group_annotation + <li>\ref chapter_overview + <ul> + <li>\ref group_invisible + </ul> + <li>\ref group_finding + <li>\ref chapter_markers +</ul> + +<h2>Program Symbols Access And Interpretation</h2> +<ul> + <li>\ref chapter_symbols_intro + <li>\ref group_locations + <li>\ref group_type_info + <ul> + <li>\ref group_demangle + </ul> +</ul> + +<h2>Configuration, Installation And Getting Started</h2> +<ul> + <li>\ref chapter_custom_debug_h + <li>\ref chapter_alloc_locations + <li>\ref group_configuration + <ul> + <li>\ref enable_libcwd_alloc + <li>\ref enable_libcwd_magic + <li>\ref enable_libcwd_location + <li>\ref enable_libcwd_libbfd + <li>\ref enable_libcwd_debug + <li>\ref enable_libcwd_debugoutput + <li>\ref enable_libcwd_debugm + <li>\ref enable_libcwd_marker + </ul> +</ul> + +*/ + Index: src/libcwd/documentation/special.dox diff -u /dev/null src/libcwd/documentation/special.dox:1.1.2.1 --- /dev/null Wed Dec 5 22:01:28 2001 +++ src/libcwd/documentation/special.dox Wed Dec 5 22:01:16 2001 @@ -0,0 +1,9 @@ +/*! +\addtogroup group_special Special Functions And Utilities +\ingroup book_writing +*/ +/*! +\page page_special +\ingroup group_special +*/ + Index: src/libcwd/documentation/symbols_intro.dox diff -u /dev/null src/libcwd/documentation/symbols_intro.dox:1.1.2.1 --- /dev/null Wed Dec 5 22:01:28 2001 +++ src/libcwd/documentation/symbols_intro.dox Wed Dec 5 22:01:16 2001 @@ -0,0 +1,12 @@ +/*! +\addtogroup chapter_symbols_intro Program Symbols Access And Interpretation: Introduction +\ingroup book_symbols +*/ +/*! +\page page_symbols_intro +\ingroup chapter_symbols_intro + +Fix me: add text. + +*/ + Index: src/libcwd/documentation/type_info.dox diff -u /dev/null src/libcwd/documentation/type_info.dox:1.1.2.1 --- /dev/null Wed Dec 5 22:01:28 2001 +++ src/libcwd/documentation/type_info.dox Wed Dec 5 22:01:16 2001 @@ -0,0 +1,9 @@ +/*! +\addtogroup group_type_info Getting Type Information Of Types And Symbols +\ingroup book_symbols +*/ +/*! +\page page_type_info +\ingroup group_type_info +*/ + Index: src/libcwd/documentation/writing_intro.dox diff -u /dev/null src/libcwd/documentation/writing_intro.dox:1.1.2.1 --- /dev/null Wed Dec 5 22:01:28 2001 +++ src/libcwd/documentation/writing_intro.dox Wed Dec 5 22:01:16 2001 @@ -0,0 +1,37 @@ +/*! +\defgroup book_writing_intro Writing Debug Output: Introduction +\ingroup book_writing +*/ +/*! +\page page_writing_into +\ingroup book_writing_intro + +\section section_writing_into_introduction Introduction + +Libcwd is an <code>ostream</code> oriented debug output facility. +The class libcw::debug::debug_ct represents a single <code>ostream</code>. + +Libcwd defines and uses only one such object, called a \ref chapter_debug_object "debug object", +being libcw::debug::libcw_do. + +Debug output is written using \ref page_why_macro "macros" (\ref Dout and \ref DoutFatal), +both of which are defined to use libcw::debug::libcw_do. +More general macros exist (\ref LibcwDout and \ref LibcwDoutFatal) that allow you +to use a different (\ref chapter_custom_do "custom") debug object. + +Both macros take two arguments, the first argument is used to specify +\ref chapter_debug_channels "debug channels" and \ref group_control_flags "control flags" +while the second argument should be a series of objects seperated by <code><<</code> +that you want to write to the <code>ostream</code>. + +For example, + +\code +Dout(dc::notice|blank_label_cf|flush_cf, "Total count: " << count << "; Average: " << average); +\endcode + +In this example <code>dc::notice</code> is one of the \ref group_default_dc "pre-defined" debug channels. +Debug channels are intended to control to amount of output of your application by switching +the channels on or off. + +*/ Index: src/libcwd/elf32.cc diff -u src/libcwd/elf32.cc:1.20.2.20 src/libcwd/elf32.cc:1.20.2.21 --- src/libcwd/elf32.cc:1.20.2.20 Sat Oct 20 20:14:01 2001 +++ src/libcwd/elf32.cc Wed Dec 5 22:01:15 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/elf32.cc,v 1.20.2.20 2001/10/21 03:14:01 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/elf32.cc,v 1.20.2.21 2001/12/06 06:01:15 libcw Exp $ // // Copyright (C) 2001, by // @@ -30,7 +30,7 @@ #include <set> #include <map> #include <vector> -#include "debug.h" +#include "cwd_debug.h" #include "elf32.h" #include <libcw/private_assert.h> Index: src/libcwd/include/cwd_debug.h diff -u /dev/null src/libcwd/include/cwd_debug.h:1.1.2.1 --- /dev/null Wed Dec 5 22:01:28 2001 +++ src/libcwd/include/cwd_debug.h Wed Dec 5 22:01:16 2001 @@ -0,0 +1,244 @@ +// Generated automatically from sys.ho.in by configure. +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/Attic/cwd_debug.h,v 1.1.2.1 2001/12/06 06:01:16 libcw Exp $ +// +// Copyright (C) 2001, 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. +// + +#ifndef DEBUG_H +#define DEBUG_H + +#include <libcw/debug.h> +#include <libcw/private_internal_string.h> +#include <iostream> + +extern "C" size_t strlen(const char *s) throw(); +#ifdef DEBUGDEBUG +extern "C" ssize_t write(int fd, const void *buf, size_t count) throw(); +#endif + +namespace libcw { + namespace debug { + +namespace _private_ { + +extern void no_alloc_print_int_to(std::ostream* os, unsigned long val, bool hexadecimal); + +//---------------------------------------------------------------------------------------------- +// struct no_alloc_ostream_ct +// +// A fake ostream that is used in DoutInternal and LIBCWD_Dout in order to write +// to an ostream without allocating memory through std::__default_allocator<true, 0> +// which could lead to a dead lock. + +struct no_alloc_ostream_ct { + std::ostream& M_os; + no_alloc_ostream_ct(std::ostream& os) : M_os(os) { } +}; + +} // namespace _private_ + +inline _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, char const* data) +{ + os.M_os.write(data, strlen(data)); + return os; +} + +inline _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, libcw::debug::_private_::internal_string const& data) +{ + os.M_os.write(data.data(), data.size()); + return os; +} + +inline _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, char data) +{ + os.M_os.put(data); + return os; +} + +inline _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, int data) +{ + _private_::no_alloc_print_int_to(&os.M_os, data, false); + return os; +} + +inline _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, unsigned int data) +{ + _private_::no_alloc_print_int_to(&os.M_os, data, false); + return os; +} + +inline _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, long data) +{ + _private_:: no_alloc_print_int_to(&os.M_os, data, false); + return os; +} + +inline _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, unsigned long data) +{ + _private_::no_alloc_print_int_to(&os.M_os, data, false); + return os; +} + +inline _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, void const* data) +{ + _private_::no_alloc_print_int_to(&os.M_os, reinterpret_cast<unsigned long>(data), true); + return os; +} + +#define LIBCWD_Dout( cntrl, data ) \ + do \ + { \ + if (libcw_do._off < 0) \ + { \ + bool on; \ + { \ + using namespace channels; \ + on = (libcw_do|cntrl).on; \ + } \ + if (on) \ + { \ + libcw_do.start(LIBCWD_TSD); \ + _private_::no_alloc_ostream_ct no_alloc_ostream(*libcw_do.current_oss); \ + no_alloc_ostream << data; \ + libcw_do.finish(LIBCWD_TSD); \ + } \ + } \ + } while(0) + +#define LIBCWD_DoutFatal( cntrl, data ) \ + do \ + { \ + { \ + using namespace dc_namespace; \ + libcw_do&cntrl; \ + } \ + libcw_do.start(LIBCWD_TSD); \ + _private_::no_alloc_ostream_ct no_alloc_ostream(*libcw_do.current_oss); \ + no_alloc_ostream << data; \ + libcw_do.fatal_finish(LIBCWD_TSD); \ + } while(0) + +#ifdef DEBUGDEBUG +namespace _private_ { + static class non_allocating_fake_ostream_using_write_ct { } const raw_write = { }; +} + +inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, char const* data) +{ + write(2, data, strlen(data)); + return raw_write; +} + +inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, void const* data) +{ + size_t dat = (size_t)data; + write(2, "0x", 2); + char c[11]; + char* p = &c[11]; + do + { + int d = (dat % 16); + *--p = ((d < 10) ? '0' : ('a' - 10)) + d; + dat /= 16; + } + while(dat > 0); + write(2, p, &c[11] - p); + return raw_write; +} + +inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, bool data) +{ + if (data) + write(2, "true", 4); + else + write(2, "false", 5); + return raw_write; +} + +inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, char data) +{ + char c[1]; + c[0] = data; + write(2, c, 1); + return raw_write; +} + +inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, unsigned long data) +{ + char c[11]; + char* p = &c[11]; + do + { + *--p = '0' + (data % 10); + data /= 10; + } + while(data > 0); + write(2, p, &c[11] - p); + return raw_write; +} + +inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, long data) +{ + if (data < 0) + { + write(2, "-", 1); + data = -data; + } + return operator<<(raw_write, (unsigned long)data); +} + +inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, int data) +{ + return operator<<(raw_write, (long)data); +} + +inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, unsigned int data) +{ + return operator<<(raw_write, static_cast<unsigned long>(data)); +} + +inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, libcw::debug::_private_::internal_string const& data) +{ + write(2, data.data(), data.size()); + return raw_write; +} + +#endif // DEBUGDEBUG + + } // namespace debug +} // namespace libcw + +#ifdef DEBUGDEBUG +// The difference between DEBUGDEBUG_CERR and FATALDEBUGDEBUG_CERR is that the latter is not suppressed +// when --disable-libcwd-debug-output is used because a fatal error occured anyway, so this can't +// disturb the testsuite. +#define FATALDEBUGDEBUG_CERR(x) \ + do { \ + if (1/*::libcw::debug::_private_::WST_ios_base_initialized FIXME: uncomment again*/) { \ + ::write(2, "DEBUGDEBUG: ", 12); \ + LIBCWD_TSD_DECLARATION \ + /* __libcwd_lcwc means library_call write counter. Used to avoid the 'scope of for changed' warning. */ \ + for (int __libcwd_lcwc = 0; __libcwd_lcwc < __libcwd_tsd.library_call; ++__libcwd_lcwc) \ + ::write(2, " ", 4); \ + ::libcw::debug::_private_::raw_write << x << '\n'; \ + } \ + } while(0) +#else // !DEBUGDEBUG +#define FATALDEBUGDEBUG_CERR(x) +#endif // !DEBUGDEBUG + +#ifdef DEBUGDEBUGOUTPUT +#define DEBUGDEBUG_CERR(x) FATALDEBUGDEBUG_CERR(x) +#else // !DEBUGDEBUGOUTPUT +#define DEBUGDEBUG_CERR(x) +#endif // !DEBUGDEBUGOUTPUT + +#endif // DEBUG_H Index: src/libcwd/include/debug.h diff -u src/libcwd/include/debug.h:1.1.2.4 src/libcwd/include/debug.h:removed --- src/libcwd/include/debug.h:1.1.2.4 Sat Oct 20 19:19:31 2001 +++ src/libcwd/include/debug.h Wed Dec 5 22:01:28 2001 @@ -1,244 +0,0 @@ -// Generated automatically from sys.ho.in by configure. -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/Attic/debug.h,v 1.1.2.4 2001/10/21 02:19:31 libcw Exp $ -// -// Copyright (C) 2001, 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. -// - -#ifndef DEBUG_H -#define DEBUG_H - -#include <libcw/debug.h> -#include <libcw/private_internal_string.h> -#include <iostream> - -extern "C" size_t strlen(const char *s) throw(); -#ifdef DEBUGDEBUG -extern "C" ssize_t write(int fd, const void *buf, size_t count) throw(); -#endif - -namespace libcw { - namespace debug { - -namespace _private_ { - -extern void no_alloc_print_int_to(std::ostream* os, unsigned long val, bool hexadecimal); - -//---------------------------------------------------------------------------------------------- -// struct no_alloc_ostream_ct -// -// A fake ostream that is used in DoutInternal and LIBCWD_Dout in order to write -// to an ostream without allocating memory through std::__default_allocator<true, 0> -// which could lead to a dead lock. - -struct no_alloc_ostream_ct { - std::ostream& M_os; - no_alloc_ostream_ct(std::ostream& os) : M_os(os) { } -}; - -} // namespace _private_ - -inline _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, char const* data) -{ - os.M_os.write(data, strlen(data)); - return os; -} - -inline _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, libcw::debug::_private_::internal_string const& data) -{ - os.M_os.write(data.data(), data.size()); - return os; -} - -inline _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, char data) -{ - os.M_os.put(data); - return os; -} - -inline _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, int data) -{ - _private_::no_alloc_print_int_to(&os.M_os, data, false); - return os; -} - -inline _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, unsigned int data) -{ - _private_::no_alloc_print_int_to(&os.M_os, data, false); - return os; -} - -inline _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, long data) -{ - _private_:: no_alloc_print_int_to(&os.M_os, data, false); - return os; -} - -inline _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, unsigned long data) -{ - _private_::no_alloc_print_int_to(&os.M_os, data, false); - return os; -} - -inline _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, void const* data) -{ - _private_::no_alloc_print_int_to(&os.M_os, reinterpret_cast<unsigned long>(data), true); - return os; -} - -#define LIBCWD_Dout( cntrl, data ) \ - do \ - { \ - if (libcw_do._off < 0) \ - { \ - bool on; \ - { \ - using namespace channels; \ - on = (libcw_do|cntrl).on; \ - } \ - if (on) \ - { \ - libcw_do.start(LIBCWD_TSD); \ - _private_::no_alloc_ostream_ct no_alloc_ostream(*libcw_do.current_oss); \ - no_alloc_ostream << data; \ - libcw_do.finish(LIBCWD_TSD); \ - } \ - } \ - } while(0) - -#define LIBCWD_DoutFatal( cntrl, data ) \ - do \ - { \ - { \ - using namespace dc_namespace; \ - libcw_do&cntrl; \ - } \ - libcw_do.start(LIBCWD_TSD); \ - _private_::no_alloc_ostream_ct no_alloc_ostream(*libcw_do.current_oss); \ - no_alloc_ostream << data; \ - libcw_do.fatal_finish(LIBCWD_TSD); \ - } while(0) - -#ifdef DEBUGDEBUG -namespace _private_ { - static class non_allocating_fake_ostream_using_write_ct { } const raw_write = { }; -} - -inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, char const* data) -{ - write(2, data, strlen(data)); - return raw_write; -} - -inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, void const* data) -{ - size_t dat = (size_t)data; - write(2, "0x", 2); - char c[11]; - char* p = &c[11]; - do - { - int d = (dat % 16); - *--p = ((d < 10) ? '0' : ('a' - 10)) + d; - dat /= 16; - } - while(dat > 0); - write(2, p, &c[11] - p); - return raw_write; -} - -inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, bool data) -{ - if (data) - write(2, "true", 4); - else - write(2, "false", 5); - return raw_write; -} - -inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, char data) -{ - char c[1]; - c[0] = data; - write(2, c, 1); - return raw_write; -} - -inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, unsigned long data) -{ - char c[11]; - char* p = &c[11]; - do - { - *--p = '0' + (data % 10); - data /= 10; - } - while(data > 0); - write(2, p, &c[11] - p); - return raw_write; -} - -inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, long data) -{ - if (data < 0) - { - write(2, "-", 1); - data = -data; - } - return operator<<(raw_write, (unsigned long)data); -} - -inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, int data) -{ - return operator<<(raw_write, (long)data); -} - -inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, unsigned int data) -{ - return operator<<(raw_write, static_cast<unsigned long>(data)); -} - -inline _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& raw_write, libcw::debug::_private_::internal_string const& data) -{ - write(2, data.data(), data.size()); - return raw_write; -} - -#endif // DEBUGDEBUG - - } // namespace debug -} // namespace libcw - -#ifdef DEBUGDEBUG -// The difference between DEBUGDEBUG_CERR and FATALDEBUGDEBUG_CERR is that the latter is not suppressed -// when --disable-libcwd-debug-output is used because a fatal error occured anyway, so this can't -// disturb the testsuite. -#define FATALDEBUGDEBUG_CERR(x) \ - do { \ - if (1/*::libcw::debug::_private_::WST_ios_base_initialized FIXME: uncomment again*/) { \ - ::write(2, "DEBUGDEBUG: ", 12); \ - LIBCWD_TSD_DECLARATION \ - /* __libcwd_lcwc means library_call write counter. Used to avoid the 'scope of for changed' warning. */ \ - for (int __libcwd_lcwc = 0; __libcwd_lcwc < __libcwd_tsd.library_call; ++__libcwd_lcwc) \ - ::write(2, " "... [truncated message content] |
From: Carlo W. <li...@us...> - 2001-12-08 02:06:35
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-11-08 02:06:33 UTC Modified files: Tag: branch-threading libcwd/INSTALL libcwd/bfd.cc libcwd/debug.cc libcwd/debugmalloc.cc libcwd/demangle3.cc libcwd/maintMakefile.in libcwd/strerrno.cc libcwd/type_info.cc libcwd/documentation/Makefile libcwd/documentation/alloc_intro.dox libcwd/documentation/allocated_memory_overview.dox libcwd/documentation/custom_do.dox libcwd/documentation/debug_channels.dox libcwd/documentation/debug_object.dox libcwd/documentation/downloading.dox libcwd/documentation/doxygen.config libcwd/documentation/fatal_output.dox libcwd/documentation/invisible.dox libcwd/documentation/location.dox libcwd/documentation/memory_leak_checking.dox libcwd/documentation/preparation.dox libcwd/documentation/reference.dox libcwd/documentation/why_macro.dox libcwd/documentation/writing_intro.dox 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_debug.h 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.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/debug.h libcwd/include/libcw/debugmalloc.h libcwd/include/libcw/demangle.h libcwd/include/libcw/macro_AllocTag.h libcwd/include/libcw/macro_Libcwd_macros.h libcwd/include/libcw/max_label_len.h libcwd/include/libcw/pc_mangled_function_name.h libcwd/include/libcw/sysd.ho.in libcwd/include/libcw/type_info.h Log message: Work in progress. Moved most of the reference manual documentation to doxygen format. ---------------------- diff included ---------------------- Index: src/libcwd/INSTALL diff -u src/libcwd/INSTALL:1.20.2.2 src/libcwd/INSTALL:1.20.2.3 --- src/libcwd/INSTALL:1.20.2.2 Tue Nov 13 19:01:06 2001 +++ src/libcwd/INSTALL Fri Dec 7 18:06:22 2001 @@ -3,6 +3,7 @@ ./configure --prefix=/usr make +su make install If that doesn't work, mail me: li...@al... @@ -14,96 +15,97 @@ Check if you have all GNU tools/libraries/packages that libcwd depends on: - Primary site: - ftp://ftp.gnu.org/gnu/ +Primary site: +ftp://ftp.gnu.org/gnu/ - List of mirrors: - http://www.gnu.org/order/ftp.html +List of mirrors: +http://www.gnu.org/order/ftp.html - Packages/versions needed - ------------------------ +Packages/versions needed +------------------------ - i) The GNU compiler, version 2.95.1 or higher. - - Location: gnu/gcc/ - Current version: 3.0.2 - - Alternatively you can install only - ia) gnu/gcc/gcc-core-<version>.tar.gz and - ib) gnu/gcc/gcc-g++-<version>.tar.gz - - Note: It is very unlikely that you want to install - the source tree of gcc/g++. Please try to upgrade your - compiler the usual way if needed. - If you are using rpm's then you will need to - install/upgrade the following: - gcc (2.95.1 or higher), - gcc-c++ (of same version), - libstdc++ (of same version) and - cpp (of same version). - Check your installation on RedHat with: - rpm -qa | egrep '(gcc|libstdc|cpp)' - - Note: If you don't use rpm's but are using tar balls, - then you do NOT need to download gnu/libstdc++/* because - gcc-2.95 and higher comes with libstdc++ included. - The gnu/libstdc++/ directory on GNU ftp sites are - for older compilers or to be used as source drop-in - when you compile g++ (replacing the normal stdc++ with - an alpha version). You also don't need libg++. - 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-97 (RedHat) - and gcc-3.0.x. - - Packages needed to run the testsuite - ------------------------------------ - - If you want to run the testsuite then you will have to install - dejagnu-1.4.1 which can be downloaded from ftp://ftp.gnu.org/gnu/dejagnu/, - or your local GNU mirror. However, this version still contains a bug - and you'll have to apply the following patch: edit /usr/share/dejagnu/target.exp - line 275 and remove the newline at the end (so that the word "text" on line - 276 is added at the end of line 275: - regsub -all ".*: warning: -f(pic|PIC) ignored for target .*" $text "" text - - Alternatively, you can get dejagnu directly from the cvs repository - at http://www.gnu.org/software/dejagnu/ where this bug already has been - fixed (as it will be in any version *after* 1.4.1). - - You will also need expect-5.32.2 (and tcl/tk 8.3.3?). At least, expect 5.31.2 - is known to hang. - - Packages/versions needed as maintainer or when using CVS - -------------------------------------------------------- - - If you want to generate maintainer files (and you need that when - you get this package via CVS) then you also need to have the - following tools: - - iii) GNU make - iv) GNU m4 - v) GNU which version 2.x - vi) autoconf version 2.13 (2.52 seems to have problems) - vii) automake version 1.4pl1 or higher - viii) libtool version 1.4 or higher - - Each of those can be downloaded from your local GNU site. - - Moreover, in order to generate the documentation, you need to - have the following installed: - - ix) GNU grep version 2.4.2 is known to work. - x) doxygen http://www.doxygen.org/ - xi) graphviz http://www.research.att.com/sw/tools/graphviz/ +i) The GNU compiler, version 2.95.1 or higher. + + Location: gnu/gcc/ + Current version: 3.0.2 + +Alternatively you can install only +ia) gnu/gcc/gcc-core-<version>.tar.gz and +ib) gnu/gcc/gcc-g++-<version>.tar.gz + +Note: It is very unlikely that you want to install +the source tree of gcc/g++. Please try to upgrade your +compiler the usual way if needed. +If you are using rpm's then you will need to +install/upgrade the following: + gcc (2.95.1 or higher), + gcc-c++ (of same version), + libstdc++ (of same version) and + cpp (of same version). +Check your installation on RedHat with: + rpm -qa | egrep '(gcc|libstdc|cpp)' + +Note: If you don't use rpm's but are using tar balls, +then you do NOT need to download gnu/libstdc++/* because +gcc-2.95 and higher comes with libstdc++ included. +The gnu/libstdc++/ directory on GNU ftp sites are +for older compilers or to be used as source drop-in +when you compile g++ (replacing the normal stdc++ with +an alpha version). You also don't need libg++. +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-97 (RedHat) +and gcc-3.0.x. + +Packages needed to run the testsuite +------------------------------------ + +ii) If you want to run the testsuite then you will have to install +dejagnu-1.4.1 which can be downloaded from ftp://ftp.gnu.org/gnu/dejagnu/, +or your local GNU mirror. However, this version still contains a bug +and you'll have to apply the following patch: edit /usr/share/dejagnu/target.exp +line 275 and remove the newline at the end (so that the word "text" on line +276 is added at the end of line 275: +regsub -all ".*: warning: -f(pic|PIC) ignored for target .*" $text "" text + +Alternatively, you can get dejagnu directly from the cvs repository +at http://www.gnu.org/software/dejagnu/ where this bug already has been +fixed (as it will be in any version *after* 1.4.1). + +You will also need expect-5.32.2 (and tcl/tk 8.3.3?). At least, expect 5.31.2 +is known to hang. + +Packages/versions needed as maintainer or when using CVS +-------------------------------------------------------- + +If you want to generate maintainer files (and you need that when you +get this package via CVS; in that case you also need to configure using +--enable-maintainer-mode) then you also need to have the following tools: + +iii) GNU make +iv) GNU m4 +v) GNU which version 2.x +vi) autoconf version 2.13 (2.52 seems to have problems) +vii) automake version 1.4pl1 or higher +viii) libtool version 1.4 or higher + +Each of those can be downloaded from your local GNU site. + +Moreover, in order to generate the documentation, you need to +have the following installed: + +ix) GNU grep version 2.4.2 is known to work. +x) doxygen version 1.2.12 or higher (http://www.doxygen.org/) +xi) graphviz http://www.research.att.com/sw/tools/graphviz/ + Hackers info ============ -=i=- -`configure' has a few interesting options. You can list them by issuing: +'configure' has a few interesting options. You can list them by issuing: ./configure --help @@ -112,7 +114,7 @@ Actually, I forgot why they are there :). You can read more about the configuration options and what they do in include/libcw/debug_config.h. -If you want to change Makefile.am files and the-like then you'll need to +If you want to change Makefile.am files and the like then you'll need to use --enable-maintainer-mode. If you enable maintainer-mode then you will need GNU make, other make won't work (you also need a LOT of other extra tools installed on your system, only for the brave thus). @@ -139,15 +141,15 @@ Please note that the libbfd that comes with binutils-2.11.x is not compatible with the libiberty that comes with with gcc-2.95.x. --=iii=- +-=iv=- -You can install libcwd in a `staging' directory by issuing +You can install libcwd in a 'staging' directory by issuing make DESTDIR=/tmp/staging install this can come in handy when you want to build an rpm for instance. --=iv=- +-=v=- The Makefile has the following targets: @@ -169,9 +171,9 @@ make CC="gcc-3.0.2" CXX="g++-3.0.2" reconfig // Switch compilers keeping the same configuration make full-check // Iterate over all configurations and all compiler versions -It is not garanteed that these work on another machine then mine however. +It is not garanteed that these work on another machine than mine however. --=v=- +-=vi=- Finally, you can also build libcwd in a different directory than the source tree is in: Index: src/libcwd/bfd.cc diff -u src/libcwd/bfd.cc:1.85.2.32 src/libcwd/bfd.cc:1.85.2.33 --- src/libcwd/bfd.cc:1.85.2.32 Wed Dec 5 22:01:14 2001 +++ src/libcwd/bfd.cc Fri Dec 7 18:06:22 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.85.2.32 2001/12/06 06:01:14 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/bfd.cc,v 1.85.2.33 2001/12/08 02:06:22 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -1103,9 +1103,12 @@ char const* const unknown_function_c = "<unknown function>"; - // - // Find the mangled function name of the address `addr'. - // + /** + * \brief Find the mangled function name of the address \a addr. + * + * \returns the same pointer that is returned by location_ct::mangled_function_name() on success, + * otherwise \ref unknown_function_c is returned. + */ char const* pc_mangled_function_name(void const* addr) { using namespace cwbfd; @@ -1247,7 +1250,7 @@ // that will free `file' again a second call to `bfd_find_nearest_line' (for the // same value of `abfd': the allocated pointer is stored in a structure // that is kept for each bfd seperately). - // The call to `new char [len + 1]' below could cause this function (pc_location) + // The call to `new char [len + 1]' below could cause this function (M_pc_location) // to be called again (in order to store the file:line where the allocation // is done) and thus a new call to `bfd_find_nearest_line', which then would // free `file' before we copy it! @@ -1317,6 +1320,9 @@ M_func = unknown_function_c; } + /** + * \brief Reset this location object (frees memory). + */ void location_ct::clear(void) { if (M_filepath) @@ -1330,6 +1336,7 @@ M_func = "<cleared location_ct>"; } + // Undocumented: shouldn't be used I think. location_ct::location_ct(location_ct const &prototype) : M_filepath(NULL) { if (prototype.M_filepath) @@ -1345,6 +1352,12 @@ } } + /** + * \brief Move \p prototype to this location object; + * + * \p prototype must be \ref is_known "known" and the current object \ref is_known "unknown"; + * \p prototype is clear()-ed afterwards. + */ void location_ct::move(location_ct& prototype) { // MT: This method is used assuming that *only* attributes of the @@ -1359,6 +1372,7 @@ prototype.M_func = "<moved location_ct>"; } + // Undocumented: shouldn't be used I think. location_ct& location_ct::operator=(location_ct const &prototype) { if (this != &prototype) @@ -1381,11 +1395,10 @@ /** * \brief Write \a location to ostream \a os. - * - * Write the contents of a location_ct object to an ostream in - * the form source-%file:line-number, or writes "<unknown location>" - * when the location is unknown. * \ingroup group_locations + * + * Write the contents of a location_ct object to an ostream in the form "source-%file:line-number", + * or writes "<unknown location>" when the location is unknown. */ std::ostream& operator<<(std::ostream& os, location_ct const& location) { Index: src/libcwd/debug.cc diff -u src/libcwd/debug.cc:1.46.2.40 src/libcwd/debug.cc:1.46.2.41 --- src/libcwd/debug.cc:1.46.2.40 Wed Dec 5 22:01:15 2001 +++ src/libcwd/debug.cc Fri Dec 7 18:06:22 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.46.2.40 2001/12/06 06:01:15 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.46.2.41 2001/12/08 02:06:22 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -164,7 +164,7 @@ /** * \addtogroup group_default_dc Predefined Debug Channels - * \ingroup chapter_debug_channels + * \ingroup group_debug_channels * * These are the default %debug %channels pre-defined in libcwd. */ @@ -508,6 +508,9 @@ strncpy(M_str, str, len); } + /** + * \brief Reserve memory for the string in advance. + */ void debug_string_ct::reserve(size_t size) { if (size < M_size) @@ -529,6 +532,12 @@ M_default_capacity = ds.M_default_capacity; } + /** \addtogroup group_formatting */ + /* \{ */ + + /** + * \brief Push the current margin on a stack. + */ void debug_ct::push_margin(void) { debug_string_stack_element_ct* current_margin_stack = M_margin_stack; @@ -540,6 +549,9 @@ M_margin_stack->next = current_margin_stack; } + /** + * \brief Pop margin from the stack. + */ void debug_ct::pop_margin(void) { if (!M_margin_stack) @@ -553,6 +565,9 @@ M_margin_stack = next; } + /** + * \brief Push the current marker on a stack. + */ void debug_ct::push_marker(void) { debug_string_stack_element_ct* current_marker_stack = M_marker_stack; @@ -563,6 +578,9 @@ M_marker_stack->next = current_marker_stack; } + /** + * \brief Pop marker from the stack. + */ void debug_ct::pop_marker(void) { if (!M_marker_stack) @@ -576,6 +594,8 @@ M_marker_stack = next; } + /** \} */ + void debug_ct::start(LIBCWD_TSD_PARAM) { // It's possible we get here before this debug object is initialized: The order of calling global is undefined :(. @@ -946,6 +966,9 @@ } } + /** + * \brief Destructor + */ debug_ct::~debug_ct() { // Sanity checks: @@ -1047,22 +1070,22 @@ } } - void channel_ct::NS_initialize(char const* lbl) // Single Threaded function (or just Non-Shared if you take dlopen into account). + void channel_ct::NS_initialize(char const* label) // Single Threaded function (or just Non-Shared if you take dlopen into account). { // This is pretty much identical to fatal_channel_ct::fatal_channel_ct(). if (WNS_initialized) return; // Already initialized. - DEBUGDEBUG_CERR( "Entering `channel_ct::channel_ct(\"" << lbl << "\")'" ); + DEBUGDEBUG_CERR( "Entering `channel_ct::NS_initialize(\"" << label << "\")'" ); // Of course, dc::debug is off - so this won't do anything unless DEBUGDEBUG is #defined. - Dout( dc::debug, "Initializing channel_ct(\"" << lbl << "\")" ); + Dout( dc::debug, "Initializing channel_ct(\"" << label << "\")" ); - size_t lbl_len = strlen(lbl); + size_t label_len = strlen(label); - if (lbl_len > max_label_len_c) // Only happens for customized channels - DoutFatal( dc::core, "strlen(\"" << lbl << "\") > " << max_label_len_c ); + if (label_len > max_label_len_c) // Only happens for customized channels + DoutFatal( dc::core, "strlen(\"" << label << "\") > " << max_label_len_c ); #ifdef LIBCWD_THREAD_SAFE _private_::mutex_tct<_private_::write_max_len_instance>::initialize(); @@ -1074,8 +1097,8 @@ // because this assignment is an atomic operation. The lock above is only needed to // prefend two such simultaneously loaded libraries from causing WST_max_len to end up // not maximal. - if (lbl_len > WST_max_len) - WST_max_len = lbl_len; + if (label_len > WST_max_len) + WST_max_len = label_len; LIBCWD_TSD_DECLARATION #ifdef LIBCWD_THREAD_SAFE @@ -1091,8 +1114,8 @@ off_cnt = 0; #endif - strncpy(WNS_label, lbl, lbl_len); - memset(WNS_label + lbl_len, ' ', max_label_len_c - lbl_len); + strncpy(WNS_label, label, label_len); + memset(WNS_label + label_len, ' ', max_label_len_c - label_len); // We store debug channels in some organized order, so that the // order in which they appear in the ForAllDebugChannels is not @@ -1113,52 +1136,52 @@ set_alloc_checking_on(LIBCWD_TSD); // Turn debug channel "WARNING" on by default. - if (strncmp(WNS_label, "WARNING", lbl_len) == 0) + if (strncmp(WNS_label, "WARNING", label_len) == 0) #ifdef LIBCWD_THREAD_SAFE __libcwd_tsd.off_cnt_array[WNS_index] = -1; #else off_cnt = -1; #endif - DEBUGDEBUG_CERR( "Leaving `channel_ct::channel_ct(\"" << lbl << "\")" ); + DEBUGDEBUG_CERR( "Leaving `channel_ct::NS_initialize(\"" << label << "\")" ); WNS_initialized = true; } - void fatal_channel_ct::NS_initialize(char const* lbl, control_flag_t maskbit) + void fatal_channel_ct::NS_initialize(char const* label, control_flag_t maskbit) { - // This is pretty much identical to channel_ct::channel_ct(). + // This is pretty much identical to channel_ct::NS_initialize(). if (WNS_maskbit) return; // Already initialized. WNS_maskbit = maskbit; - DEBUGDEBUG_CERR( "Entering `fatal_channel_ct::fatal_channel_ct(\"" << lbl << "\")'" ); + DEBUGDEBUG_CERR( "Entering `fatal_channel_ct::NS_initialize(\"" << label << "\")'" ); // Of course, dc::debug is off - so this won't do anything unless DEBUGDEBUG is #defined. - Dout( dc::debug, "Initializing fatal_channel_ct(\"" << lbl << "\")" ); + Dout( dc::debug, "Initializing fatal_channel_ct(\"" << label << "\")" ); - size_t lbl_len = strlen(lbl); + size_t label_len = strlen(label); - if (lbl_len > max_label_len_c) // Only happens for customized channels - DoutFatal( dc::core, "strlen(\"" << lbl << "\") > " << max_label_len_c ); + if (label_len > max_label_len_c) // Only happens for customized channels + DoutFatal( dc::core, "strlen(\"" << label << "\") > " << max_label_len_c ); #ifdef LIBCWD_THREAD_SAFE _private_::mutex_tct<_private_::write_max_len_instance>::initialize(); _private_::mutex_tct<_private_::write_max_len_instance>::lock(); #endif - // MT: See comment in channel_ct::channel_ct above. - if (lbl_len > WST_max_len) - WST_max_len = lbl_len; + // MT: See comment in channel_ct::NS_initialize above. + if (label_len > WST_max_len) + WST_max_len = label_len; #ifdef LIBCWD_THREAD_SAFE _private_::mutex_tct<_private_::write_max_len_instance>::unlock(); #endif - strncpy(WNS_label, lbl, lbl_len); - memset(WNS_label + lbl_len, ' ', max_label_len_c - lbl_len); + strncpy(WNS_label, label, label_len); + memset(WNS_label + label_len, ' ', max_label_len_c - label_len); - DEBUGDEBUG_CERR( "Leaving `fatal_channel_ct::fatal_channel_ct(\"" << lbl << "\")" ); + DEBUGDEBUG_CERR( "Leaving `fatal_channel_ct::NS_initialize(\"" << label << "\")" ); } void continued_channel_ct::NS_initialize(control_flag_t maskbit) @@ -1167,6 +1190,11 @@ WNS_maskbit = maskbit; } + /** + * \brief Turn this channel off. + * + * \sa on() + */ void channel_ct::off(void) { #ifdef LIBCWD_THREAD_SAFE @@ -1177,6 +1205,11 @@ #endif } + /** + * \brief Cancel one call to `off()'. + * + * The channel is turned on when on() is called as often as off() was called before. + */ void channel_ct::on(void) { #ifdef LIBCWD_THREAD_SAFE Index: src/libcwd/debugmalloc.cc diff -u src/libcwd/debugmalloc.cc:1.61.2.46 src/libcwd/debugmalloc.cc:1.61.2.47 --- src/libcwd/debugmalloc.cc:1.61.2.46 Wed Dec 5 22:01:15 2001 +++ src/libcwd/debugmalloc.cc Fri Dec 7 18:06:22 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.61.2.46 2001/12/06 06:01:15 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.61.2.47 2001/12/08 02:06:22 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -469,6 +469,11 @@ from_free // memblk_type_external }; +/** + * \brief Allow writing a \c memblk_types_nt directly to an ostream. + * + * Writes the name of the \c memblk_types_nt \a memblk_type to \c ostream \a os. + */ std::ostream& operator<<(std::ostream& os, memblk_types_nt memblk_type) { switch(memblk_type) @@ -577,7 +582,7 @@ class dm_alloc_ct : public alloc_ct { #ifdef DEBUGMARKER friend class marker_ct; - friend void libcw_debug_move_outside(marker_ct* marker, void const* ptr); + friend void move_outside(marker_ct* marker, void const* ptr); #endif private: static dm_alloc_ct** current_alloc_list; @@ -694,7 +699,7 @@ class memblk_info_ct { #ifdef DEBUGMARKER friend class marker_ct; - friend void libcw_debug_move_outside(marker_ct* marker, void const* ptr); + friend void move_outside(marker_ct* marker, void const* ptr); #endif private: memblk_types_nt M_memblk_type; @@ -1555,9 +1560,9 @@ /** * \brief Allow writing of enum malloc_report_nt to an ostream. - * \ingroup chapter_overview + * \ingroup group_overview * - * \sa \ref malloc_report + * \sa \ref malloc_report_nt */ std::ostream& operator<<(std::ostream& o, malloc_report_nt) { @@ -1571,12 +1576,12 @@ /** * \brief List all current allocations to a given %debug object. - * \ingroup chapter_overview + * \ingroup group_overview * * With both, \link enable_libcwd_debugm DEBUGMALLOC \endlink and * \link enable_libcwd_debug DEBUGDEBUG \endlink defined, it is possible - * to write the \ref chapter_overview "overview of allocated memory" to - * a \ref chapter_debug_object "Debug Object". + * to write the \ref group_overview "overview of allocated memory" to + * a \ref group_debug_object "Debug Object". * The syntax to do this is: * * \code @@ -1584,7 +1589,7 @@ * \endcode * * which would print on \link libcw::debug::libcw_do libcw_do \endlink using - * \ref chapter_debug_channels "debug channel" \link libcw::debug::dc::malloc dc::malloc \endlink. + * \ref group_debug_channels "debug channel" \link libcw::debug::dc::malloc dc::malloc \endlink. */ void list_allocations_on(debug_ct& debug_object) { @@ -1630,10 +1635,10 @@ * \ingroup group_invisible * * The allocation pointed to by \a ptr is made invisible; it won't show up - * anymore in the \ref chapter_overview "overview of allocated memory". + * anymore in the \ref group_overview "overview of allocated memory". * * \sa \ref group_invisible - * \sa \ref chapter_overview + * \sa \ref group_overview * * <b>Example:</b> * @@ -1668,12 +1673,12 @@ * \ingroup group_invisible * * All allocations, except the given pointer, are made invisible; they won't show up - * anymore in the \ref chapter_overview "overview of allocated memory". + * anymore in the \ref group_overview "overview of allocated memory". * * If you want to make \em all allocations invisible, just pass \c NULL as parameter. * * \sa \ref group_invisible - * \sa \ref chapter_overview + * \sa \ref group_overview * * <b>Example:</b> * @@ -1757,6 +1762,9 @@ #endif } +/** + * \brief Destructor. + */ marker_ct::~marker_ct(void) { #ifdef DEBUGDEBUGMALLOC @@ -1794,7 +1802,11 @@ RELEASE_WRITE_LOCK } -void libcw_debug_move_outside(marker_ct* marker, void const* ptr) +/** + * \brief Move memory allocation pointed to by \a ptr outside \a marker. + * \ingroup group_markers + */ +void move_outside(marker_ct* marker, void const* ptr) { #ifdef DEBUGDEBUGMALLOC LIBCWD_TSD_DECLARATION Index: src/libcwd/demangle3.cc diff -u src/libcwd/demangle3.cc:1.8.2.19 src/libcwd/demangle3.cc:1.8.2.20 --- src/libcwd/demangle3.cc:1.8.2.19 Wed Dec 5 22:01:15 2001 +++ src/libcwd/demangle3.cc Fri Dec 7 18:06:23 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/demangle3.cc,v 1.8.2.19 2001/12/06 06:01:15 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/demangle3.cc,v 1.8.2.20 2001/12/08 02:06:23 libcw Exp $ // // Copyright (C) 2001, by // @@ -1993,7 +1993,12 @@ extern void demangle_symbol(char const* input, _private_::internal_string& output); extern void demangle_type(char const* input, _private_::internal_string& output); -/** \ingroup group_demangle */ +/** \addtogroup group_demangle */ +/** \{ */ + +/** + * \brief Demangle mangled symbol name \p input and write the result to string \p output. + */ void demangle_symbol(char const* input, std::string& output) { LIBCWD_TSD_DECLARATION @@ -2008,7 +2013,9 @@ _private_::set_alloc_checking_on(LIBCWD_TSD); } -/** \ingroup group_demangle */ +/** + * \brief Demangle mangled type name \p input and write the result to string \p output. + */ void demangle_type(char const* input, std::string& output) { LIBCWD_TSD_DECLARATION @@ -2022,6 +2029,8 @@ } _private_::set_alloc_checking_on(LIBCWD_TSD); } + +/** \} */ } // namespace debug } // namespace libcw Index: src/libcwd/documentation/Makefile diff -u src/libcwd/documentation/Makefile:1.1.2.1 src/libcwd/documentation/Makefile:1.1.2.2 --- src/libcwd/documentation/Makefile:1.1.2.1 Tue Nov 13 19:01:07 2001 +++ src/libcwd/documentation/Makefile Fri Dec 7 18:06:23 2001 @@ -5,7 +5,15 @@ .PHONY: html external html: external + rm -rf html doxygen doxygen.config + mv html/preparation.html html/preparation.tmp + cat html/preparation.tmp | \ + sed -e 's/href="debug_8h\.html">debug\.h/href="#preparation_step2">debug.h/' \ + -e 's/"sys\.h"/"<a class="code" href="#preparation_step2">sys.h<\/a>"/' \ + > html/preparation.html + rm html/preparation.tmp + external: external/INSTALL external/sys.h external/debug.h external/debug.cc Index: src/libcwd/documentation/alloc_intro.dox diff -u src/libcwd/documentation/alloc_intro.dox:1.1.2.2 src/libcwd/documentation/alloc_intro.dox:1.1.2.3 --- src/libcwd/documentation/alloc_intro.dox:1.1.2.2 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/alloc_intro.dox Fri Dec 7 18:06:23 2001 @@ -14,7 +14,7 @@ -# Finding the start, size, place of allocation in the source code and allocator type of an allocated memory block when given a pointer which points inside of it. -# Providing means to add type info and a description to the Allocated memory Overview (using <CODE>AllocTag()</CODE></a>). --# Listing \ref chapter_overview "an overview of allocated memory" to a \ref chapter_debug_object "Debug Object". +-# Listing \ref group_overview "an overview of allocated memory" to a \ref group_debug_object "Debug Object". -# Boundary checks of allocated blocks, by means of \ref chapter_magic_numbers "magic numbers" (see also \ref enable_libcwd_magic). Unfortunately it is impossible to support feature 3. in C++ without putting hooks in your code: Index: src/libcwd/documentation/allocated_memory_overview.dox diff -u src/libcwd/documentation/allocated_memory_overview.dox:1.1.2.2 src/libcwd/documentation/allocated_memory_overview.dox:1.1.2.3 --- src/libcwd/documentation/allocated_memory_overview.dox:1.1.2.2 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/allocated_memory_overview.dox Fri Dec 7 18:06:23 2001 @@ -1,10 +1,12 @@ /*! -\defgroup chapter_overview Overview Of Allocated Memory +\defgroup group_overview Overview Of Allocated Memory \ingroup book_allocations */ /*! \page page_overview -\ingroup chapter_overview +\ingroup group_overview + +<hr><h2>Detailed Description</h2> An example output, using libcw-0.2.5, is given below. Please follow the links to get a short explanation. Index: src/libcwd/documentation/custom_do.dox diff -u src/libcwd/documentation/custom_do.dox:1.1.2.3 src/libcwd/documentation/custom_do.dox:1.1.2.4 --- src/libcwd/documentation/custom_do.dox:1.1.2.3 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/custom_do.dox Fri Dec 7 18:06:23 2001 @@ -25,7 +25,7 @@ #endif // !CWDEBUG \endcode -\sa \ref chapter_debug_object +\sa \ref group_debug_object \sa \ref libcw::debug::libcw_do */ Index: src/libcwd/documentation/debug_channels.dox diff -u src/libcwd/documentation/debug_channels.dox:1.1.2.2 src/libcwd/documentation/debug_channels.dox:1.1.2.3 --- src/libcwd/documentation/debug_channels.dox:1.1.2.2 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/debug_channels.dox Fri Dec 7 18:06:23 2001 @@ -1,12 +1,12 @@ /*! -\defgroup chapter_debug_channels Controlling The Output Level (Debug Channels) +\defgroup group_debug_channels Controlling The Output Level (Debug Channels) \ingroup book_writing */ /*! \page page_debug_channels -\ingroup chapter_debug_channels +\ingroup group_debug_channels -<hr> +<hr><h2>Detailed Description</h2> Whenever debug output is written, one or more <i>debug channels</i> must be specified. The debug output is then written to the ostream of the debug object Index: src/libcwd/documentation/debug_object.dox diff -u src/libcwd/documentation/debug_object.dox:1.1.2.1 src/libcwd/documentation/debug_object.dox:1.1.2.2 --- src/libcwd/documentation/debug_object.dox:1.1.2.1 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/debug_object.dox Fri Dec 7 18:06:23 2001 @@ -1,12 +1,12 @@ /*! -\defgroup chapter_debug_object The Output Device (Debug Object) +\defgroup group_debug_object The Output Device (Debug Object) \ingroup book_writing */ /*! \page page_debug_object -\ingroup chapter_debug_object +\ingroup group_debug_object -<hr> +<hr><h2>Detailed Description</h2> Libcwd declares a %debug class (\ref libcw::debug::debug_ct "debug_ct") which can be assigned an <code>ostream</code> to which %debug output will be written. Index: src/libcwd/documentation/downloading.dox diff -u src/libcwd/documentation/downloading.dox:1.1.2.2 src/libcwd/documentation/downloading.dox:1.1.2.3 --- src/libcwd/documentation/downloading.dox:1.1.2.2 Mon Nov 19 20:32:39 2001 +++ src/libcwd/documentation/downloading.dox Fri Dec 7 18:06:23 2001 @@ -2,6 +2,6 @@ \page downloading Downloading -For now, download libcwd from sourceforge at http://sourceforge.net/project/showfiles.php?group_id=354 +Download libcwd from sourceforge at http://sourceforge.net/project/showfiles.php?group_id=354 */ Index: src/libcwd/documentation/doxygen.config diff -u src/libcwd/documentation/doxygen.config:1.1.2.9 src/libcwd/documentation/doxygen.config:1.1.2.10 --- src/libcwd/documentation/doxygen.config:1.1.2.9 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/doxygen.config Fri Dec 7 18:06:23 2001 @@ -7,7 +7,7 @@ PROJECT_NUMBER = "libcwd 0.99.16" OUTPUT_DIRECTORY = OUTPUT_LANGUAGE = English -EXTRACT_ALL = YES +EXTRACT_ALL = NO EXTRACT_PRIVATE = NO EXTRACT_STATIC = NO HIDE_UNDOC_MEMBERS = YES @@ -41,7 +41,7 @@ ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 0 OPTIMIZE_OUTPUT_FOR_C = NO -SHOW_USED_FILES = YES +SHOW_USED_FILES = NO #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- @@ -60,7 +60,8 @@ ../include/libcw \ ../demangle3.cc FILE_PATTERNS = *.dox \ - *.h + *.h \ + *.inl RECURSIVE = NO EXCLUDE = EXCLUDE_PATTERNS = @@ -125,10 +126,10 @@ #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- -GENERATE_MAN = NO +GENERATE_MAN = YES MAN_OUTPUT = -MAN_EXTENSION = -MAN_LINKS = NO +MAN_EXTENSION = .1 +MAN_LINKS = YES #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- Index: src/libcwd/documentation/fatal_output.dox diff -u src/libcwd/documentation/fatal_output.dox:1.1.2.1 src/libcwd/documentation/fatal_output.dox:1.1.2.2 --- src/libcwd/documentation/fatal_output.dox:1.1.2.1 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/fatal_output.dox Fri Dec 7 18:06:23 2001 @@ -1,12 +1,12 @@ /*! -\defgroup chapter_fatal_output Fatal Debug Output +\defgroup group_fatal_output Fatal Debug Output \ingroup book_writing */ /*! \page page_fatal_output -\ingroup chapter_fatal_output +\ingroup group_fatal_output -<hr> +<hr><h2>Detailed Description</h2> Often an application needs to be terminated when a fatal error occurs (whether or not CWDEBUG is defined). Libcwd defines for these cases the macro DoutFatal. Index: src/libcwd/documentation/invisible.dox diff -u src/libcwd/documentation/invisible.dox:1.1.2.1 src/libcwd/documentation/invisible.dox:1.1.2.2 --- src/libcwd/documentation/invisible.dox:1.1.2.1 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/invisible.dox Fri Dec 7 18:06:23 2001 @@ -1,6 +1,6 @@ /*! \addtogroup group_invisible Invisible Allocations -\ingroup chapter_overview +\ingroup group_overview */ /*! \page page_invisible @@ -9,7 +9,7 @@ <hr><h2>Detailed Description</h2> Allocated memory blocks can be made invisible: They won't show up in -the \ref chapter_overview "overview of allocated memory" anymore. +the \ref group_overview "overview of allocated memory" anymore. Even more, the corresponding \ref libcw::debug::alloc_ct "alloc_ct" is destroyed: \ref libcw::debug::find_alloc "find_alloc" will not find them anymore. There is no other effect, \ref libcw::debug::test_delete "test_delete" will still work Index: src/libcwd/documentation/location.dox diff -u src/libcwd/documentation/location.dox:1.1.2.3 src/libcwd/documentation/location.dox:1.1.2.4 --- src/libcwd/documentation/location.dox:1.1.2.3 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/location.dox Fri Dec 7 18:06:23 2001 @@ -23,7 +23,7 @@ With \link enable_libcwd_location --enable-libcwd-location \endlink, libcwd will write the source file and line number information about where memory allocations are done to the -\link chapter_debug_channels debug channels \endlink \link libcw::debug::channels::dc::bfd dc::bfd \endlink. +\link group_debug_channels debug channels \endlink \link libcw::debug::channels::dc::bfd dc::bfd \endlink. For example, @@ -37,7 +37,7 @@ at address 0x804bc9b corresponding to line 179 of source file <TT>deb.cc</TT>. Source file and line number information is also shown in the -\ref chapter_overview "overview of allocated memory" and when a memory block is freed. +\ref group_overview "overview of allocated memory" and when a memory block is freed. \section section_Without_location_support Without location support Index: src/libcwd/documentation/memory_leak_checking.dox diff -u src/libcwd/documentation/memory_leak_checking.dox:1.1.2.3 src/libcwd/documentation/memory_leak_checking.dox:1.1.2.4 --- src/libcwd/documentation/memory_leak_checking.dox:1.1.2.3 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/memory_leak_checking.dox Fri Dec 7 18:06:23 2001 @@ -1,11 +1,13 @@ /*! -\defgroup chapter_markers Memory Allocation Markers: Memory Leak Checking +\defgroup group_markers Memory Allocation Markers: Memory Leak Checking \ingroup book_allocations */ /*! \page page_markers -\ingroup chapter_markers +\ingroup group_markers +<hr><h2>Detailed Description</h2> + Libcwd does a weak attempt to support debugging of memory leaks. I hope to greatly improve this in the future. @@ -40,7 +42,7 @@ } \endcode -which would move the memory allocation pointed to by ptr outside the test region of \c marker. +which would move the memory allocation pointed to by \a ptr outside the test region of \a marker. A complete example program with output is given here: Index: src/libcwd/documentation/preparation.dox diff -u src/libcwd/documentation/preparation.dox:1.1.2.4 src/libcwd/documentation/preparation.dox:1.1.2.5 --- src/libcwd/documentation/preparation.dox:1.1.2.4 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/preparation.dox Fri Dec 7 18:06:23 2001 @@ -7,7 +7,7 @@ \subsection installation Step 1: Installing libcwd -Binairy distributions should be installed the usual way. +Binary distributions should be installed the usual way. If you are installing libcwd from source then please read the \htmlonly<A HREF="../external/INSTALL">\endhtmlonly @@ -31,8 +31,8 @@ \include debug.h \htmlonly «<A HREF="../external/debug.h">download</A>»\endhtmlonly -This %debug.h file is for applications, for more detailed information and for information -for library developers who want to use libbcwd, please also read \ref chapter_custom_debug_h. +This %debug.h file is for applications; for more detailed information and for information +for library developers who want to use libcwd, please also read \ref chapter_custom_debug_h. \subsection custom_debug_cc Step 3: Creating the custom source file Index: src/libcwd/documentation/reference.dox diff -u src/libcwd/documentation/reference.dox:1.1.2.3 src/libcwd/documentation/reference.dox:1.1.2.4 --- src/libcwd/documentation/reference.dox:1.1.2.3 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/reference.dox Fri Dec 7 18:06:23 2001 @@ -6,17 +6,17 @@ <ul> <li>\ref book_writing_intro <li>\ref group_destination - <li>\ref chapter_debug_object + <li>\ref group_debug_object <ul> <li>\ref chapter_custom_do </ul> - <li>\ref chapter_debug_channels + <li>\ref group_debug_channels <ul> <li>\ref group_default_dc </ul> <li>\ref group_control_flags <li>\ref group_formatting - <li>\ref chapter_fatal_output + <li>\ref group_fatal_output <li>\ref chapter_nesting <li>\ref group_special </ul> @@ -27,12 +27,12 @@ <li>\ref chapter_validation <li>\ref chapter_magic_numbers <li>\ref group_annotation - <li>\ref chapter_overview + <li>\ref group_overview <ul> <li>\ref group_invisible </ul> <li>\ref group_finding - <li>\ref chapter_markers + <li>\ref group_markers </ul> <h2>Program Symbols Access And Interpretation</h2> @@ -50,16 +50,6 @@ <li>\ref chapter_custom_debug_h <li>\ref chapter_alloc_locations <li>\ref group_configuration - <ul> - <li>\ref enable_libcwd_alloc - <li>\ref enable_libcwd_magic - <li>\ref enable_libcwd_location - <li>\ref enable_libcwd_libbfd - <li>\ref enable_libcwd_debug - <li>\ref enable_libcwd_debugoutput - <li>\ref enable_libcwd_debugm - <li>\ref enable_libcwd_marker - </ul> </ul> */ Index: src/libcwd/documentation/why_macro.dox diff -u src/libcwd/documentation/why_macro.dox:1.1.2.1 src/libcwd/documentation/why_macro.dox:1.1.2.2 --- src/libcwd/documentation/why_macro.dox:1.1.2.1 Sat Dec 1 17:01:31 2001 +++ src/libcwd/documentation/why_macro.dox Fri Dec 7 18:06:23 2001 @@ -2,14 +2,14 @@ \page page_why_macro Design Consideration Concerning Macros -This page describes why we use a macro in stead of an inline +This page describes why we use a macro instead of an inline function for <CODE>Dout()</CODE>. -Good C++ code should not use macros, but <CODE>inline</CODE> functions which +Good C++ code whenever possible, should not use macros but <CODE>inline</CODE> functions which have the advantage of type checking, overloading and easier debugging with a debugger. It is therefore a very relevant question to ask why a macro was used for <CODE>Dout()</CODE>. -Using a macro has also advantages: +Using a macro has its advantages however: <OL> <LI>It inlines the debug code even when we don't use optimization. @@ -19,43 +19,43 @@ <LI>No optimization is needed to really get rid of the debug code when debugging is omitted. </OL> -Points 1., 2. and 3. are the most important reasons that lead to the decision to use a macro. -Please note that the author of %libcw used the alternative for <B>two years</B> before finally was decided +Points 1, 2 and 3 are the most important reasons that lead to the decision to use a macro. +Please note that the author of %libcw used the alternative for <B>two years</B> before finally deciding to to <B>rewrite</B> the debug facility, being convinced that it was better to do it the way it is done now. -While points 4. and 5. are trivial, the first three advantages might need some explanation: +While points 4 and 5 are trivial, the first three advantages might need some explanation: 1. Usually a developer won't use compiler optimization because that makes debugging harder. -In most cases the debug code will be compiled and used <B>without</B> compiler optimization; including -the fact that <B>no</B> inlining is done at all. +In most cases the debug code will be compiled and used <em>without</em> compiler optimization; including +the fact that no inlining is done. Moreover, we expect to use a lot of inserter operators and without -optimization, each of these which will be called. +optimization, each of these will be called. [ Note that when omitting debug code we can't get rid of the content of all <CODE>%operator<<</CODE> functions because they might be used for non-debug code too, so we'd need to use a trick and write to -something else than an <CODE>ostream</CODE> (lets say to a class <CODE>no_dstream</CODE>). +something else than an <CODE>ostream</CODE> (let's say to a class <CODE>no_dstream</CODE>). Each call to <CODE>template<class T> no_dstream %operator<<(T) { };</CODE> would actually be done(!), -without inlining (point 5. above) ]. +without inlining (point 5 above) ]. -2. Lets develop an example, step by step which is writing debug output. +2. Let's develop step by step an example where we write debug output. -Lets start with writing some example debug output to <CODE>cerr</CODE>. +Let's start with writing some example debug output to <CODE>cerr</CODE>. \code std::cerr << "i = " << i << "; j = " << j << "; s = " << s << std::endl; \endcode -This line calls seven functions, if we want to save cpu when we +This line calls seven functions. If we want to save CPU time when we <B>don't</B> want to write this output, then we need to test whether the debugging output (for this specific channel) is turned on or off <B>before</B> calling the <CODE>%operator<<()</CODE>'s. -After all, such an operator call can use a lot of cpu for arbitrary objects. +After all, such an operator call can use a lot of CPU time for arbitrary objects. We can not pass <CODE>"i = " << i << "; j = " << j << "; s = " << s << std::endl</CODE> to an inline function without causing all <CODE>%operator<<</CODE> functions to be called. The only way, not using a macro, to achieve that no <CODE>%operator<<</CODE> is called is by not calling them in the first place: We can't write to an <CODE>ostream</CODE>. -It is necessary to write to a new class (lets call that class <CODE>dstream</CODE>) which +It is necessary to write to a new class (let's call that class <CODE>dstream</CODE>) which checks if the debug channel we are writing to is turned on before calling the <CODE>ostream %operator<<()</CODE>: Index: src/libcwd/documentation/writing_intro.dox diff -u src/libcwd/documentation/writing_intro.dox:1.1.2.1 src/libcwd/documentation/writing_intro.dox:1.1.2.2 --- src/libcwd/documentation/writing_intro.dox:1.1.2.1 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/writing_intro.dox Fri Dec 7 18:06:23 2001 @@ -11,7 +11,7 @@ Libcwd is an <code>ostream</code> oriented debug output facility. The class libcw::debug::debug_ct represents a single <code>ostream</code>. -Libcwd defines and uses only one such object, called a \ref chapter_debug_object "debug object", +Libcwd defines and internally uses only one object of that class, called a \ref group_debug_object "debug object", being libcw::debug::libcw_do. Debug output is written using \ref page_why_macro "macros" (\ref Dout and \ref DoutFatal), @@ -19,8 +19,8 @@ More general macros exist (\ref LibcwDout and \ref LibcwDoutFatal) that allow you to use a different (\ref chapter_custom_do "custom") debug object. -Both macros take two arguments, the first argument is used to specify -\ref chapter_debug_channels "debug channels" and \ref group_control_flags "control flags" +\ref Dout and \ref DoutFatal take two arguments: the first argument is used to specify +\ref group_debug_channels "debug channels" and \ref group_control_flags "control flags" while the second argument should be a series of objects seperated by <code><<</code> that you want to write to the <code>ostream</code>. @@ -30,8 +30,8 @@ Dout(dc::notice|blank_label_cf|flush_cf, "Total count: " << count << "; Average: " << average); \endcode -In this example <code>dc::notice</code> is one of the \ref group_default_dc "pre-defined" debug channels. -Debug channels are intended to control to amount of output of your application by switching -the channels on or off. +In this example <code>dc::notice</code> is one of the \ref group_default_dc "predefined" debug channels. +Debug channels are intended to control the amount of output of your application: +you can switch the channels on and off. */ Index: src/libcwd/include/libcw/buf2str.h diff -u src/libcwd/include/libcw/buf2str.h:1.5.2.10 src/libcwd/include/libcw/buf2str.h:1.5.2.11 --- src/libcwd/include/libcw/buf2str.h:1.5.2.10 Wed Dec 5 22:01:16 2001 +++ src/libcwd/include/libcw/buf2str.h Fri Dec 7 18:06:23 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/buf2str.h,v 1.5.2.10 2001/12/06 06:01:16 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/buf2str.h,v 1.5.2.11 2001/12/08 02:06:23 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -62,22 +62,23 @@ class buf2str { private: - char const* M_buf; - size_t M_size; + char const* M_buf; //!< Pointer to the start of the buffer. + size_t M_size; //!< The size of the buffer. public: + //! Construct \c buf2str object with attributes \a buf and \a size. buf2str(char const* buf, size_t size) : M_buf(buf), M_size(size) { } - // - // Note: This function is only intended for debugging purposes, - // it is not a good idea to use it in the final compilation. - // + /** + * \brief Write the contents of the buffer represented by \a __buf2str + * to the \c ostream \a os, escaping non-printable characters. + */ friend __inline__ std::ostream& operator<<(std::ostream& os, buf2str const& __buf2str) { - register size_t size = __buf2str.M_size; + size_t size = __buf2str.M_size; for (char const* p1 = __buf2str.M_buf; size > 0; --size, p1++) os << char2str(*p1); return os; Index: src/libcwd/include/libcw/char2str.h diff -u src/libcwd/include/libcw/char2str.h:1.5.2.10 src/libcwd/include/libcw/char2str.h:1.5.2.11 --- src/libcwd/include/libcw/char2str.h:1.5.2.10 Wed Dec 5 22:01:16 2001 +++ src/libcwd/include/libcw/char2str.h Fri Dec 7 18:06:23 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/char2str.h,v 1.5.2.10 2001/12/06 06:01:16 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/char2str.h,v 1.5.2.11 2001/12/08 02:06:23 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -53,11 +53,20 @@ class char2str { private: - char c; + char c; //!< The character to be printed. + +private: void print_char_to(std::ostream&) const; void print_escaped_char_to(std::ostream&) const; + public: + //! Construct a \c char2str object with attribute \a ci. char2str(char ci) : c(ci) { } + + /** + * \brief Write the character represented by \a c2s to the \c ostream \a os, + * escaping it when it is a non-printable character. + */ friend __inline__ std::ostream& operator<<(std::ostream& os, char2str const c2s) { if ((c2s.c > 31 && c2s.c != 92 && c2s.c != 127) || (unsigned char)c2s.c > 159) Index: src/libcwd/include/libcw/class_alloc.h diff -u src/libcwd/include/libcw/class_alloc.h:1.1.2.4 src/libcwd/include/libcw/class_alloc.h:1.1.2.5 --- src/libcwd/include/libcw/class_alloc.h:1.1.2.4 Wed Dec 5 22:01:16 2001 +++ src/libcwd/include/libcw/class_alloc.h Fri Dec 7 18:06:23 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_alloc.h,v 1.1.2.4 2001/12/06 06:01:16 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_alloc.h,v 1.1.2.5 2001/12/08 02:06:23 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -53,19 +53,16 @@ */ class alloc_ct { protected: - void const* a_start; // Duplicate of (original) memblk_key_ct - size_t a_size; // Duplicate of (original) memblk_key_ct - memblk_types_nt a_memblk_type; // A flag which indicates the type of allocation - type_info_ct const* type_info_ptr; // Type info of related object - lockable_auto_ptr<char, true> a_description; // A label describing this memblk + void const* a_start; //!< Duplicate of (original) memblk_key_ct. + size_t a_size; //!< Duplicate of (original) memblk_key_ct. + memblk_types_nt a_memblk_type; //!< A flag which indicates the type of allocation. + type_info_ct const* type_info_ptr; //!< Type info of related object. + lockable_auto_ptr<char, true> a_description; //!< A label describing this memblk. #ifdef DEBUGUSEBFD - location_ct M_location; // Source file, function and line number from where - // the allocator was called from + location_ct M_location; //!< Source file, function and line number from where the allocator was called from. #endif -public: - alloc_ct(void const* s, size_t sz, memblk_types_nt type, type_info_ct const& ti) : - a_start(s), a_size(sz), a_memblk_type(type), type_info_ptr(&ti) { } +public: /** * \brief The allocated size in bytes. */ @@ -84,7 +81,8 @@ /** * \brief A reference to the type info of the pointer to the allocated memory block. * - * \returns a reference to the static \ref type_info_ct object that is returned by a call to \ref type_info_of(p1). + * \returns a reference to the static \ref type_info_ct object that is returned + * by a call to \ref libcw::debug::type_info_of "type_info_of"(p1). * Where \p p1 is the first parameter that was passed to \ref AllocTag(). */ type_info_ct const& type_info(void) const { return *type_info_ptr; } @@ -101,7 +99,7 @@ * \brief The source file location that the allocator was called from. * * \returns a non-const \ref location_ct reference corresponding to the place where the allocation was done. - * Class\ref location_ct describes a source file and line number location and in which function that location resides. + * Class \ref location_ct describes a source file and line number location and in which function that location resides. * \sa \ref chapter_alloc_locations */ location_ct& location_reference(void) { return M_location; } @@ -115,7 +113,22 @@ */ location_ct const& location(void) const { return M_location; } #endif + protected: + /** + * \brief Construct an \c alloc_ct object with attributes \a s, \a sz, \a type and \a ti. + * \internal + */ + alloc_ct(void const* s, size_t sz, memblk_types_nt type, type_info_ct const& ti) : + a_start(s), a_size(sz), a_memblk_type(type), type_info_ptr(&ti) { } + + /** + * \brief Destructor. + * \internal + * + * The destructor is virtual because libcwd really creates dm_alloc_ct + * objects, objects \em derived from alloc_ct, using <code>operator new</code>. + */ virtual ~alloc_ct() { } }; Index: src/libcwd/include/libcw/class_channel.h diff -u src/libcwd/include/libcw/class_channel.h:1.1.2.7 src/libcwd/include/libcw/class_channel.h:1.1.2.8 --- src/libcwd/include/libcw/class_channel.h:1.1.2.7 Wed Dec 5 22:01:16 2001 +++ src/libcwd/include/libcw/class_channel.h Fri Dec 7 18:06:23 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_channel.h,v 1.1.2.7 2001/12/06 06:01:16 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_channel.h,v 1.1.2.8 2001/12/08 02:06:23 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -34,16 +34,12 @@ namespace libcw { namespace debug { -//=================================================================================================== -// class channel_ct -// -// This object represents a debug channel, it has a fixed label. -// A debug channel can be viewed upon as a single bit: on or off. -// - -/** \class channel_ct debug.h libcw/debug.h +/** + * \class channel_ct class_channel.h libcw/debug.h + * \ingroup group_debug_channels * - * \brief The %Debug Channel class. + * \brief This object represents a debug channel, it has a fixed label. + * A debug channel can be viewed upon as a single bit: on or off. * * Whenever %debug output is written, one or more %debug %channels must be specified (as first * parameter of the \ref Dout macro). @@ -112,16 +108,10 @@ // MT: All channel objects must be global so that `WNS_initialized' is false // at the start of the program and initialization occurs before other threads // share the object. - /** - * \brief Constructor - * - * Constructor for an arbitrary new %debug channel with name \a label. - * A newly created channel is off by default (except <CODE>dc::warning</CODE>). - */ explicit channel_ct(char const* label); // MT: May only be called from the constructors of global objects (or single threaded functions). - void NS_initialize(char const* lbl); + void NS_initialize(char const* label); // Force initialization in case the constructor of this global object // wasn't called yet. Does nothing when the object was already initialized. @@ -130,18 +120,7 @@ // Manipulators // - /** - * \brief Turn this channel off. - * - * \sa on() - */ void off(void); - - /** - * \brief Cancel one call to `off()'. - * - * The channel is turned on when on() is called as often as off() was called before. - */ void on(void); public: @@ -149,22 +128,12 @@ // Accessors // - /** - * \brief Pointer to the label of the %debug channel. - */ char const* get_label(void) const; - - /** - * \brief Returns `true' if the channel is active. - */ bool is_on(void) const; #ifdef _REENTRANT bool is_on(LIBCWD_TSD_PARAM) const; #endif }; - -// End of declaration of class channel_ct. -//=================================================================================================== } // namespace debug } // namespace libcw Index: src/libcwd/include/libcw/class_channel.inl diff -u src/libcwd/include/libcw/class_channel.inl:1.1.2.2 src/libcwd/include/libcw/class_channel.inl:1.1.2.3 --- src/libcwd/include/libcw/class_channel.inl:1.1.2.2 Sat Oct 20 19:19:32 2001 +++ src/libcwd/include/libcw/class_channel.inl Fri Dec 7 18:06:23 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_channel.inl,v 1.1.2.2 2001/10/21 02:19:32 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_channel.inl,v 1.1.2.3 2001/12/08 02:06:23 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -24,10 +24,18 @@ namespace libcw { namespace debug { +/** + * \brief Construct a new %debug channel with name \a label. + * + * A newly created channel is off by default (except \ref libcw::debug::channels::dc::warning "dc::warning"). + * All channel objects must be global objects. + * + * \sa \ref chapter_custom_debug_h + */ __inline__ -channel_ct::channel_ct(char const* lbl) +channel_ct::channel_ct(char const* label) { - NS_initialize(lbl); + NS_initialize(label); } #ifdef _REENTRANT @@ -39,6 +47,10 @@ } #endif + +/** + * \brief Returns `true' if the channel is active. + */ __inline__ bool channel_ct::is_on(void) const @@ -51,6 +63,9 @@ #endif } +/** + * \brief Pointer to the label of the %debug channel. + */ __inline__ char const* channel_ct::get_label(void) const Index: src/libcwd/include/libcw/class_debug.h diff -u src/libcwd/include/libcw/class_debug.h:1.1.2.9 src/libcwd/include/libcw/class_debug.h:1.1.2.10 --- src/libcwd/include/libcw/class_debug.h:1.1.2.9 Wed Dec 5 22:01:16 2001 +++ src/libcwd/include/libcw/class_debug.h Fri Dec 7 18:06:23 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_debug.h,v 1.1.2.9 2001/12/06 06:01:16 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_debug.h,v 1.1.2.10 2001/12/08 02:06:23 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -59,14 +59,18 @@ /** * \class debug_ct debug.h libcw/debug.h - * \ingroup chapter_debug_object + * \ingroup group_debug_object * - * \brief The %Debug Object class. + * \brief The %Debug Object class, this object represents one output device (<code>ostream</code>). * - * See \ref chapter_debug_object. + * See \ref group_debug_object. */ class debug_ct { +#ifdef DOXYGEN +protected: +#else public: // Direct access needed in macro LibcwDout(). Do not write to these. +#endif int _off; // Debug output is turned on when this variable is -1, otherwise it is off. @@ -161,29 +165,16 @@ // Manipulators and accessors for the above "format" attributes: // - /** \addtogroup group_formatting */ - /* \{ */ - - /** \brief Set number of spaces to indent. */ void set_indent(unsigned short indentation); - /** \brief Increment number of spaces to indent. */ void inc_indent(unsigned short indentation); - /** \brief Decrement number of spaces to indent. */ void dec_indent(unsigned short indentation); - /** \brief Get the current indentation. */ unsigned short get_indent(void) const; - /** \brief Push the current margin on a stack */ void push_margin(void); - /** \brief Pop margin from the stack */ void pop_margin(void); - /** \brief Push the current marker on a stack */ void push_marker(void); - /** \brief Pop marker from the stack */ void pop_marker(void); - /** \} */ - // Deprecated (last documented in 0.99.15) void set_margin(std::string const& ... [truncated message content] |
From: Carlo W. <li...@us...> - 2001-12-08 03:07:32
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-11-08 03:07:31 UTC Modified files: Tag: branch-threading libcwd/libcwd.spec.in Log message: Trying to add the documentation to the rpm. ---------------------- diff included ---------------------- Index: src/libcwd/libcwd.spec.in diff -u src/libcwd/libcwd.spec.in:1.8 src/libcwd/libcwd.spec.in:1.8.2.1 --- src/libcwd/libcwd.spec.in:1.8 Wed Sep 13 14:43:01 2000 +++ src/libcwd/libcwd.spec.in Fri Dec 7 19:07:21 2001 @@ -46,6 +46,7 @@ %defattr(-,root,root) %doc README %doc example-project.tar.gz +%doc documentation/html %dir %{__prefix}/include/libcw %{__prefix}/lib/* %{__prefix}/include/libcw/* ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-12-09 16:19:01
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-11-09 16:18:59 UTC Modified files: Tag: branch-threading libcwd/libcwd.spec.in Log message: Added doxygen documentation to the rpm. ---------------------- diff included ---------------------- Index: src/libcwd/libcwd.spec.in diff -u src/libcwd/libcwd.spec.in:1.8.2.1 src/libcwd/libcwd.spec.in:1.8.2.2 --- src/libcwd/libcwd.spec.in:1.8.2.1 Fri Dec 7 19:07:21 2001 +++ src/libcwd/libcwd.spec.in Sun Dec 9 08:18:49 2001 @@ -39,7 +39,7 @@ echo echo "Please look at %{__prefix}/doc/libcwd-%{version}/example-project.tar.gz" echo "for an example of how to write an application that uses libcwd." -echo "Detailed documentation can be found on-line at http://libcw.sourceforge.net/debugging/" +echo "Detailed documentation can be found in file://%{__prefix}/doc/libcwd-%{version}/html/index.html" echo %files @@ -47,6 +47,11 @@ %doc README %doc example-project.tar.gz %doc documentation/html +%doc documentation/scripts +%doc documentation/styles +%doc documentation/images +%doc documentation/external +%doc documentation/doxygen-examples %dir %{__prefix}/include/libcw %{__prefix}/lib/* %{__prefix}/include/libcw/* ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-12-09 16:25:15
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-11-09 16:25:14 UTC Modified files: Tag: branch-threading libcwd/libcwd.spec.in Log message: Fixed documentation URL. ---------------------- diff included ---------------------- Index: src/libcwd/libcwd.spec.in diff -u src/libcwd/libcwd.spec.in:1.8.2.2 src/libcwd/libcwd.spec.in:1.8.2.3 --- src/libcwd/libcwd.spec.in:1.8.2.2 Sun Dec 9 08:18:49 2001 +++ src/libcwd/libcwd.spec.in Sun Dec 9 08:25:04 2001 @@ -39,7 +39,7 @@ echo echo "Please look at %{__prefix}/doc/libcwd-%{version}/example-project.tar.gz" echo "for an example of how to write an application that uses libcwd." -echo "Detailed documentation can be found in file://%{__prefix}/doc/libcwd-%{version}/html/index.html" +echo "Detailed documentation can be found in file:/%{__prefix}/doc/libcwd-%{version}/html/index.html" echo %files ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-12-09 16:55:03
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-11-09 16:55:01 UTC Modified files: Tag: branch-threading libcwd/libcwd.spec.in Log message: More fixes. ---------------------- diff included ---------------------- Index: src/libcwd/libcwd.spec.in diff -u src/libcwd/libcwd.spec.in:1.8.2.3 src/libcwd/libcwd.spec.in:1.8.2.4 --- src/libcwd/libcwd.spec.in:1.8.2.3 Sun Dec 9 08:25:04 2001 +++ src/libcwd/libcwd.spec.in Sun Dec 9 08:54:51 2001 @@ -8,9 +8,11 @@ Source: http://download.sourceforge.net/libcw/libcwd-%{version}.tar.gz Copyright: QPL %ifos linux -Requires: gcc >= 2.95.1, gcc-c++ >= 2.95.1, binutils >= 2.9 +Requires: gcc-c++ >= 2.95.1, binutils >= 2.9 %endif Buildroot: %{_tmppath}/%{name}-root +BuildPrereq: make, m4, which >= 2.5, autoconf = 2.13, automake >= 1.4pl1, libtool >= 1.4 +URL: http://libcw.sourceforge.net/debugging/ %description Libcwd is a full-featured, professional, well documented library to support @@ -39,7 +41,7 @@ echo echo "Please look at %{__prefix}/doc/libcwd-%{version}/example-project.tar.gz" echo "for an example of how to write an application that uses libcwd." -echo "Detailed documentation can be found in file:/%{__prefix}/doc/libcwd-%{version}/html/index.html" +echo "Detailed documentation can be found in file://%{__prefix}/doc/libcwd-%{version}/html/index.html" echo %files ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-12-09 17:05:30
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-11-09 17:05:30 UTC Modified files: Tag: branch-threading libcwd/libcwd.spec.in Log message: ---------------------- diff included ---------------------- Index: src/libcwd/libcwd.spec.in diff -u src/libcwd/libcwd.spec.in:1.8.2.4 src/libcwd/libcwd.spec.in:1.8.2.5 --- src/libcwd/libcwd.spec.in:1.8.2.4 Sun Dec 9 08:54:51 2001 +++ src/libcwd/libcwd.spec.in Sun Dec 9 09:05:19 2001 @@ -11,7 +11,7 @@ Requires: gcc-c++ >= 2.95.1, binutils >= 2.9 %endif Buildroot: %{_tmppath}/%{name}-root -BuildPrereq: make, m4, which >= 2.5, autoconf = 2.13, automake >= 1.4pl1, libtool >= 1.4 +BuildPrereq: make, m4, which >= 2.5, autoconf = 2.13, automake >= 1.4p1, libtool >= 1.4 URL: http://libcw.sourceforge.net/debugging/ %description ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-12-09 19:30:07
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-11-09 19:30:05 UTC Modified files: Tag: branch-threading libcwd/Makefile.am libcwd/maintMakefile.in libcwd/documentation/doxygen.config libcwd/documentation/scripts/load_style_sheets.js libcwd/include/Makefile.am libcwd/include/libcw/Makefile.am Added files: Tag: branch-threading libcwd/documentation/README Log message: Documentation is now a part of the tar and rpm. ---------------------- diff included ---------------------- Index: src/libcwd/Makefile.am diff -u src/libcwd/Makefile.am:1.30.2.12 src/libcwd/Makefile.am:1.30.2.13 --- src/libcwd/Makefile.am:1.30.2.12 Tue Nov 13 19:01:06 2001 +++ src/libcwd/Makefile.am Sun Dec 9 11:29:55 2001 @@ -34,7 +34,9 @@ # --------------- Maintainer's Section -dist-hook: +dist-hook: documentation + cp -pr $(srcdir)/documentation $(distdir)/documentation + find $(distdir)/documentation -name CVS -print | xargs rm -rf mkdir $(distdir)/example-project for i in `grep '^/' $(srcdir)/example-project/CVS/Entries | cut -d/ -f2`; do \ cp -p $(srcdir)/example-project/$$i $(distdir)/example-project; \ Index: src/libcwd/documentation/README diff -u /dev/null src/libcwd/documentation/README:1.1.2.1 --- /dev/null Sun Dec 9 11:30:05 2001 +++ src/libcwd/documentation/README Sun Dec 9 11:29:55 2001 @@ -0,0 +1,5 @@ +The Reference Manual can be found in html/. + +Please ignore all other files: they are only used to generate +the documentation in the html directory. + Index: src/libcwd/documentation/doxygen.config diff -u src/libcwd/documentation/doxygen.config:1.1.2.10 src/libcwd/documentation/doxygen.config:1.1.2.11 --- src/libcwd/documentation/doxygen.config:1.1.2.10 Fri Dec 7 18:06:23 2001 +++ src/libcwd/documentation/doxygen.config Sun Dec 9 11:29:55 2001 @@ -126,7 +126,7 @@ #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- -GENERATE_MAN = YES +GENERATE_MAN = NO MAN_OUTPUT = MAN_EXTENSION = .1 MAN_LINKS = YES Index: src/libcwd/documentation/scripts/load_style_sheets.js diff -u src/libcwd/documentation/scripts/load_style_sheets.js:1.1.2.2 src/libcwd/documentation/scripts/load_style_sheets.js:1.1.2.3 --- src/libcwd/documentation/scripts/load_style_sheets.js:1.1.2.2 Tue Nov 13 19:01:07 2001 +++ src/libcwd/documentation/scripts/load_style_sheets.js Sun Dec 9 11:29:55 2001 @@ -5,11 +5,9 @@ rootpath = location.href.substring(0,rootpos) + "libcw.sourceforge.net/"; else { - rootpos = location.pathname.lastIndexOf("documentation"); + rootpos = location.pathname.lastIndexOf("/html/"); if (rootpos != -1) - rootpath = location.pathname.substring(0,rootpos) + "documentation/"; - else - rootpath = "http://www.xs4all.nl/~carlo17/libcw/sourceforge/www/"; + rootpath = location.pathname.substring(0,rootpos) + "/"; } write("<LINK REL=StyleSheet HREF=\"" + rootpath + "styles/main.css\" TYPE=\"text/css\">"); if (need_style_tag_cw == 1) Index: src/libcwd/include/Makefile.am diff -u src/libcwd/include/Makefile.am:1.2.2.7 src/libcwd/include/Makefile.am:1.2.2.8 --- src/libcwd/include/Makefile.am:1.2.2.7 Tue Oct 23 07:17:08 2001 +++ src/libcwd/include/Makefile.am Sun Dec 9 11:29:55 2001 @@ -1,7 +1,7 @@ SUBDIRS = libcw BUILT_SOURCES =@MAINTAINER_MODE_TRUE@ sys.ho -EXTRA_DIST = sys.ho.in elf32.h exec_prog.h private_debug_stack.inl $(BUILT_SOURCES) +EXTRA_DIST = sys.ho.in cwd_debug.h ios_base_Init.h elf32.h exec_prog.h private_debug_stack.inl $(BUILT_SOURCES) EXTRA_HEADERS = sys.h DISTCLEANFILES = sys.h sys.ho Index: src/libcwd/include/libcw/Makefile.am diff -u src/libcwd/include/libcw/Makefile.am:1.16.2.9 src/libcwd/include/libcw/Makefile.am:1.16.2.10 --- src/libcwd/include/libcw/Makefile.am:1.16.2.9 Sun Oct 21 09:02:48 2001 +++ src/libcwd/include/libcw/Makefile.am Sun Dec 9 11:29:55 2001 @@ -4,36 +4,47 @@ bfd.h \ buf2str.h \ char2str.h \ - cwprint.h \ - debug.h \ - debugmalloc.h \ - demangle.h \ - lockable_auto_ptr.h \ - strerrno.h \ - type_info.h \ - private_threading.h \ - core_dump.h \ + class_alloc.h \ class_channel.h \ - max_label_len.h \ - class_fatal_channel.h \ - class_continued_channel.h \ - control_flag.h \ - private_assert.h \ class_channel.inl \ + class_channel_set.h \ + class_channel_set.inl \ + class_continued_channel.h \ class_continued_channel.inl \ - class_fatal_channel.inl \ class_debug.h \ - class_channel_set.h \ + class_debug.inl \ class_debug_string.h \ class_debug_string.inl \ - class_debug.inl \ - private_debug_stack.h \ - class_channel_set.inl \ - macro_ForAllDebugObjects.h \ + class_fatal_channel.h \ + class_fatal_channel.inl \ + class_location.h \ + class_location.inl \ + class_marker.h \ + control_flag.h \ + core_dump.h \ + cwprint.h \ + debug.h \ + debugmalloc.h \ + demangle.h \ + enum_memblk_types.h \ + lockable_auto_ptr.h \ + macro_AllocTag.h \ macro_ForAllDebugChannels.h \ - private_TSD.h \ + macro_ForAllDebugObjects.h \ macro_Libcwd_macros.h \ - private_set_alloc_checking.h + max_label_len.h \ + pc_mangled_function_name.h \ + private_TSD.h \ + private_allocator.h \ + private_assert.h \ + private_debug_stack.h \ + private_internal_string.h \ + private_internal_stringstream.h \ + private_internal_vector.h \ + private_set_alloc_checking.h \ + private_threading.h \ + strerrno.h \ + type_info.h BUILT_SOURCES = sysd.ho debug_config.ho EXTRA_HEADERS = sysd.h debug_config.h Index: src/libcwd/maintMakefile.in diff -u src/libcwd/maintMakefile.in:1.13.2.10 src/libcwd/maintMakefile.in:1.13.2.11 --- src/libcwd/maintMakefile.in:1.13.2.10 Fri Dec 7 18:06:23 2001 +++ src/libcwd/maintMakefile.in Sun Dec 9 11:29:55 2001 @@ -75,7 +75,7 @@ rpm: dist $(SPECFILE) mv @PACKAGE@-@VERSION@.tar.gz $(RPMDIR)/SOURCES - cd rpm; rpm --rcfile=/usr/lib/rpm/rpmrc:rpmrc --target=$(TARGET) --sign --clean -ba ../$(SPECFILE) + cd rpm; rpm --rcfile=/usr/lib/rpm/rpmrc:rpmrc --sign --clean -ba ../$(SPECFILE) reconfig: $(top_builddir)/config.status $(top_builddir)/config.status --recheck @@ -89,24 +89,28 @@ (cd $(srcdir); cvs log $(SPECFILE).in) | \ grep -A2000 '^-----' | \ egrep -v '^-----|^=====|^revision' | \ - $(AWK) -F'[ ;]' -v lastdate="" \ + $(AWK) -F'[ ;]' -v lastdate="" -v count=9999 \ '{ \ if ($$0~/^date: /) { \ if (lastdate != $$2) { \ if (lastdate != "") { \ - printf("\n"); \ + printf("%s/%04d\n", lastdate, count); \ } \ lastdate=$$2; \ + printf("%s/%04d", lastdate, count); \ system("echo \"* \"`date --date \""$$2" "$$3"\" \"+%a %b %d %Y\"`\" Carlo Wood <li...@al...>\""); \ } \ + } else if ($$0~/^branches: /) { \ + printf(""); \ } else if ($$0~/^[A-Z]/) { \ - printf("- %s\n", $$0); \ + printf("%s/%04d- %s\n", lastdate, count, $$0); \ } else if ($$0~/./) { \ - printf(" %s\n", $$0); \ + printf("%s/%04d %s\n", lastdate, count, $$0); \ } else { \ - print \ + printf("%s/%04d\n", lastdate, count); \ } \ - }' > spec.changelog; \ + count = count - 1; \ + } END { printf("%s/%04d\n", lastdate, count); }' | sort -r | sed -e 's/^...............//' > spec.changelog; \ else \ touch spec.changelog; \ fi ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-12-09 23:52:58
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-11-09 23:52:56 UTC Modified files: Tag: branch-threading libcwd/Makefile.am libcwd/example-project/configure.in libcwd/example-project/program.cc Added files: Tag: branch-threading libcwd/example-project/acconfig.h Log message: Example project bug fixes. ---------------------- diff included ---------------------- Index: src/libcwd/Makefile.am diff -u src/libcwd/Makefile.am:1.30.2.13 src/libcwd/Makefile.am:1.30.2.14 --- src/libcwd/Makefile.am:1.30.2.13 Sun Dec 9 11:29:55 2001 +++ src/libcwd/Makefile.am Sun Dec 9 15:52:46 2001 @@ -34,14 +34,14 @@ # --------------- Maintainer's Section -dist-hook: documentation +dist-hook: example-project/debug.h documentation cp -pr $(srcdir)/documentation $(distdir)/documentation find $(distdir)/documentation -name CVS -print | xargs rm -rf mkdir $(distdir)/example-project for i in `grep '^/' $(srcdir)/example-project/CVS/Entries | cut -d/ -f2`; do \ cp -p $(srcdir)/example-project/$$i $(distdir)/example-project; \ done - rm $(distdir)/example-project/debug.h.maintainer + rm $(distdir)/example-project/debug.h.maintainer $(distdir)/example-project/macrotest.cc cp -p $(srcdir)/example-project/debug.h $(distdir)/example-project chmod +x $(distdir)/install-sh mkdir $(distdir)/debian Index: src/libcwd/example-project/acconfig.h diff -u /dev/null src/libcwd/example-project/acconfig.h:1.1.2.1 --- /dev/null Sun Dec 9 15:52:56 2001 +++ src/libcwd/example-project/acconfig.h Sun Dec 9 15:52:46 2001 @@ -0,0 +1,2 @@ +// Defined if libcdw is available. +#undef HAVE_LIBCWD Index: src/libcwd/example-project/configure.in diff -u src/libcwd/example-project/configure.in:1.6.2.1 src/libcwd/example-project/configure.in:1.6.2.2 --- src/libcwd/example-project/configure.in:1.6.2.1 Mon Nov 5 18:54:08 2001 +++ src/libcwd/example-project/configure.in Sun Dec 9 15:52:46 2001 @@ -1,10 +1,10 @@ dnl Process this file with autoconf to produce a configure script. -AC_REVISION($Revision: 1.6.2.1 $)dnl +AC_REVISION($Revision: 1.6.2.2 $)dnl dnl General initialization of `autoconf' variables. dnl Ensure that the directory specified with --srcdir was correct dnl by demanding that it contains `debug.h'. -AC_INIT(debug.h) +AC_INIT(program.cc) dnl Include --enable-maintainer-mode option. AM_MAINTAINER_MODE @@ -46,6 +46,7 @@ LDFLAGS=\"-L/usr/local/lib\" CPPFLAGS=\"-I/usr/local/include\" ./configure])])]) CXXFLAGS="-DCWDEBUG $CXXFLAGS" + AC_DEFINE(HAVE_LIBCWD) fi dnl Generate output files. Index: src/libcwd/example-project/program.cc diff -u src/libcwd/example-project/program.cc:1.2 src/libcwd/example-project/program.cc:1.2.2.1 --- src/libcwd/example-project/program.cc:1.2 Wed Oct 4 13:59:24 2000 +++ src/libcwd/example-project/program.cc Sun Dec 9 15:52:46 2001 @@ -10,7 +10,7 @@ Dout(dc::custom, "This is debug output, written to a custom channel (see ./debug.h and ./debug.cc)"); - cout << "This program works" << endl; + std::cout << "This program works" << std::endl; return 0; } ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-12-10 01:31:56
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-11-10 01:31:55 UTC Modified files: Tag: branch-threading libcwd/libcwd.spec.in Log message: Work in progress. ---------------------- diff included ---------------------- Index: src/libcwd/libcwd.spec.in diff -u src/libcwd/libcwd.spec.in:1.8.2.5 src/libcwd/libcwd.spec.in:1.8.2.6 --- src/libcwd/libcwd.spec.in:1.8.2.5 Sun Dec 9 09:05:19 2001 +++ src/libcwd/libcwd.spec.in Sun Dec 9 17:31:45 2001 @@ -46,8 +46,9 @@ %files %defattr(-,root,root) -%doc README %doc example-project.tar.gz +%doc documentation/README +%doc documentation/tutorial %doc documentation/html %doc documentation/scripts %doc documentation/styles ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-12-10 01:55:44
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-11-10 01:55:43 UTC Modified files: Tag: branch-threading libcwd/README Log message: Documentation is now part of the source tree ---------------------- diff included ---------------------- Index: src/libcwd/README diff -u src/libcwd/README:1.8 src/libcwd/README:1.8.2.1 --- src/libcwd/README:1.8 Mon Jul 30 21:10:04 2001 +++ src/libcwd/README Sun Dec 9 17:55:33 2001 @@ -37,44 +37,6 @@ 2) Support for memory allocation debugging. -Documentation -------------- - -You can find extensive documentation online at -http://libcw.sourceforge.net/debugging/. There you will find -a reference manual, a tutorial and many examples. - -It is highly recommended that you download and install the html -files locally for greater speed. At the moment you can only -download the documentation by using `cvs': - -Install cvs (after all, you are a developer) and issue the -following command once: - -cvs -d:pserver:ano...@cv...:/cvsroot/libcw login - -When prompted for a password for anonymous, simply press the -Enter key. Next download the documentation with the following -commandline: - -cvs -z3 -d:pserver:ano...@cv...:/cvsroot/libcw co www - -At any later time you can update the documentation by changing -directory into the www directory and issuing: - -cvs update -d - -A European mirror has been setup in Amsterdam (the Netherlands) at -http://www.alinoe.com/. This is my home PC (cable, 128cps) and -therefore only contains the front page, using www.xs4all.nl -(my other provider) for all the rest of the pages and images. -Feel free to try this when sourceforge is too slow. - -Note that the documentation includes documentation of libcw -(without a `d' at the end), libcw is not released to the public -yet. You can ignore everything not in the debugging/ directory. - - Anonymous CVS Access -------------------- ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-12-10 01:56:26
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-11-10 01:56:25 UTC Modified files: Tag: branch-threading libcwd/documentation/alloc_intro.dox Log message: Added a few references ---------------------- diff included ---------------------- Index: src/libcwd/documentation/alloc_intro.dox diff -u src/libcwd/documentation/alloc_intro.dox:1.1.2.3 src/libcwd/documentation/alloc_intro.dox:1.1.2.4 --- src/libcwd/documentation/alloc_intro.dox:1.1.2.3 Fri Dec 7 18:06:23 2001 +++ src/libcwd/documentation/alloc_intro.dox Sun Dec 9 17:56:15 2001 @@ -9,10 +9,10 @@ Unless \link enable_libcwd_alloc --disable-libcwd-alloc \endlink was specified during configuration then the following memory allocation and de-allocation debugging features are provided by libcwd: --# Checking if a pointer that is passed to a memory de-allocation function is valid; +-# Checking if a pointer that is passed to a memory de-allocation function is \ref chapter_validation "valid"; and if this pointer was previously returned by a corresponding allocation function. -# Finding the start, size, place of allocation in the source code and allocator type of an - allocated memory block when given a pointer which points inside of it. + allocated memory block when given a pointer which points inside of it (see \ref group_finding). -# Providing means to add type info and a description to the Allocated memory Overview (using <CODE>AllocTag()</CODE></a>). -# Listing \ref group_overview "an overview of allocated memory" to a \ref group_debug_object "Debug Object". -# Boundary checks of allocated blocks, by means of \ref chapter_magic_numbers "magic numbers" (see also \ref enable_libcwd_magic). ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-12-10 01:57:10
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-11-10 01:57:09 UTC Modified files: Tag: branch-threading libcwd/libcwd.spec.in libcwd/maintMakefile.in Log message: Do not generate the .spec changelog anymore: too much junk in the cvs log. ---------------------- diff included ---------------------- Index: src/libcwd/libcwd.spec.in diff -u src/libcwd/libcwd.spec.in:1.8.2.6 src/libcwd/libcwd.spec.in:1.8.2.7 --- src/libcwd/libcwd.spec.in:1.8.2.6 Sun Dec 9 17:31:45 2001 +++ src/libcwd/libcwd.spec.in Sun Dec 9 17:56:59 2001 @@ -59,5 +59,22 @@ %{__prefix}/lib/* %{__prefix}/include/libcw/* -%changelog@SPECCHANGELOG@ +%changelog +* Sun Dec 09 2001 Carlo Wood <li...@al...> +- Added a URL: and BuildPrereq: entry. +- Added doxygen documentation to the rpm. + +* Wed Sep 13 2000 Carlo Wood <li...@al...> +- Added example-project to doc/ and added a %post instruction echo. + +* Sat Sep 02 2000 Carlo Wood <li...@al...> +- Still generate libcwd.lsm and libcwd.spec in config.status, but only + when initiated from maintMakefile according to Makefile rules. + Put them in $(srcdir) because they need to be put in the distribution. +- Add file list to %files. Added a 'Requires:' and started to use macros for prefix and version. +- Use '@@' instead of '!!' because now the spec file is generated from spec.in by config.status. + +* Thu Aug 31 2000 Carlo Wood <li...@al...> +- Remove build root in %clean. +- Initial version. Index: src/libcwd/maintMakefile.in diff -u src/libcwd/maintMakefile.in:1.13.2.11 src/libcwd/maintMakefile.in:1.13.2.12 --- src/libcwd/maintMakefile.in:1.13.2.11 Sun Dec 9 11:29:55 2001 +++ src/libcwd/maintMakefile.in Sun Dec 9 17:56:59 2001 @@ -81,42 +81,6 @@ $(top_builddir)/config.status --recheck $(top_builddir)/config.status -$(SPECFILE): $(srcdir)/$(SPECFILE).in $(srcdir)/configure.in - if test $(CVSWRITEACCESS) = yes; then \ - (cd $(srcdir); cvs commit $(SPECFILE).in); \ - fi - if test $(CVSREADACCESS) = yes; then \ - (cd $(srcdir); cvs log $(SPECFILE).in) | \ - grep -A2000 '^-----' | \ - egrep -v '^-----|^=====|^revision' | \ - $(AWK) -F'[ ;]' -v lastdate="" -v count=9999 \ - '{ \ - if ($$0~/^date: /) { \ - if (lastdate != $$2) { \ - if (lastdate != "") { \ - printf("%s/%04d\n", lastdate, count); \ - } \ - lastdate=$$2; \ - printf("%s/%04d", lastdate, count); \ - system("echo \"* \"`date --date \""$$2" "$$3"\" \"+%a %b %d %Y\"`\" Carlo Wood <li...@al...>\""); \ - } \ - } else if ($$0~/^branches: /) { \ - printf(""); \ - } else if ($$0~/^[A-Z]/) { \ - printf("%s/%04d- %s\n", lastdate, count, $$0); \ - } else if ($$0~/./) { \ - printf("%s/%04d %s\n", lastdate, count, $$0); \ - } else { \ - printf("%s/%04d\n", lastdate, count); \ - } \ - count = count - 1; \ - } END { printf("%s/%04d\n", lastdate, count); }' | sort -r | sed -e 's/^...............//' > spec.changelog; \ - else \ - touch spec.changelog; \ - fi - CONFIG_FILES=$(SPECFILE) CONFIG_HEADERS= $(SHELL) ./config.status - rm spec.changelog - $(srcdir)/$(LSMFILE): $(srcdir)/$(LSMFILE).in $(srcdir)/configure.in CONFIG_FILES=$(LSMFILE) CONFIG_HEADERS= $(SHELL) ./config.status ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-12-27 05:12:21
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-11-27 05:12:20 UTC Modified files: Tag: branch-threading libcwd/documentation/styles/main.css Added files: Tag: branch-threading libcwd/documentation/styles/Makefile libcwd/documentation/styles/defines.h libcwd/documentation/styles/doxygen.css libcwd/documentation/styles/test.html libcwd/documentation/styles/test.m4 libcwd/documentation/styles/tutorial.css libcwd/documentation/styles/ie/.cvsignore libcwd/documentation/styles/konqueror/.cvsignore libcwd/documentation/styles/mozilla/.cvsignore libcwd/documentation/styles/netscape4/.cvsignore libcwd/documentation/styles/netscape6/.cvsignore Log message: Styles Sheet fixes (work in progress). ---------------------- diff included ---------------------- Index: src/libcwd/documentation/styles/Makefile diff -u /dev/null src/libcwd/documentation/styles/Makefile:1.1.2.1 --- /dev/null Wed Dec 26 21:12:20 2001 +++ src/libcwd/documentation/styles/Makefile Wed Dec 26 21:12:10 2001 @@ -0,0 +1,21 @@ +TEMPLATES=main.css doxygen.css tutorial.css +BROWSERS=netscape4 netscape6 mozilla konqueror ie +OUTPUT=$(shell for b in $(BROWSERS); do for i in $(TEMPLATES); do echo $$b/$$i; done done) + +all: $(OUTPUT) + +%/main.css: main.css + @MACRO=`echo $@ | sed -e 's%\([^/]*\)/.*%\1%' | tr a-z A-Z`; \ + cat main.css | gcc -D$$MACRO -E -c - | egrep -v '^(#|$$)' > $@ + +%/doxygen.css: doxygen.css + @MACRO=`echo $@ | sed -e 's%\([^/]*\)/.*%\1%' | tr a-z A-Z`; \ + cat doxygen.css | gcc -D$$MACRO -E -c - | egrep -v '^(#|$$)' > $@ + +%/tutorial.css: tutorial.css + @MACRO=`echo $@ | sed -e 's%\([^/]*\)/.*%\1%' | tr a-z A-Z`; \ + cat tutorial.css | gcc -D$$MACRO -E -c - | egrep -v '^(#|$$)' > $@ + +test.html: test.m4 ../definitions.m4 + m4 -I.. test.m4 > test.html + Index: src/libcwd/documentation/styles/defines.h diff -u /dev/null src/libcwd/documentation/styles/defines.h:1.1.2.1 --- /dev/null Wed Dec 26 21:12:20 2001 +++ src/libcwd/documentation/styles/defines.h Wed Dec 26 21:12:10 2001 @@ -0,0 +1,97 @@ +#define FOREGROUND_COLOR black +#define BACKGROUND_COLOR rgb(247, 252, 248) + +#define FOREGROUND_COLOR_ADDRESS FOREGROUND_COLOR +#define BACKGROUND_COLOR_ADDRESS #eee + +#define FOREGROUND_COLOR_HOVER FOREGROUND_COLOR +#define BACKGROUND_COLOR_HOVER #feffc6 + +#define FOREGROUND_COLOR_EXAMPLE #2323DC +#define BACKGROUND_COLOR_EXAMPLE INHERIT + +#define FOREGROUND_COLOR_CODE #044c2f +#define BACKGROUND_COLOR_CODE INHERIT + +#define FOREGROUND_COLOR_OUTPUT rgb(40, 0, 100) +#define BACKGROUND_COLOR_OUTPUT INHERIT + +#ifndef NETSCAPE4 +#define INHERIT inherit +#else +#define INHERIT BACKGROUND_COLOR /* Otherwise it becomes green?! */ +#endif + +#define NORMAL_FONT font-family: arial, sans-serif; font-size: NORMAL_SIZE; font-size-adjust: none + +#ifdef KONQUEROR +#define HSIZE1 24pt +#define HSIZE2 20pt +#define HSIZE3 16pt +#define HSIZE4 13pt +#define HSIZE5 10pt +#define HSIZE6 8pt +#elif NETSCAPE4 +#define HSIZE1 32pt /* Netscape 4 can't display larger than 24pt. */ +#define HSIZE2 24pt +#define HSIZE3 16pt +#define HSIZE4 14pt +#define HSIZE5 12pt +#define HSIZE6 10pt +#elif NETSCAPE6 +#define HSIZE1 32pt +#define HSIZE2 20pt +#define HSIZE3 15pt +#define HSIZE4 13pt +#define HSIZE5 10pt +#define HSIZE6 8pt +#elif MOZILLA +#define HSIZE1 32pt +#define HSIZE2 24pt +#define HSIZE3 16pt +#define HSIZE4 14pt +#define HSIZE5 12pt +#define HSIZE6 10pt +#elif IE +#define HSIZE1 21pt +#define HSIZE2 18pt +#define HSIZE3 16pt +#define HSIZE4 13pt +#define HSIZE5 10pt +#define HSIZE6 8pt +#endif + +#ifdef KONQUEROR +#define SIZE2 16pt +#define SIZE3 13pt +#define SIZE4 11pt +#define SIZE5 10pt +#define SIZE6 8pt +#elif NETSCAPE4 +#define SIZE2 18pt +#define SIZE3 16pt; font-weight: bold /* Netscape 4 doesn't scale, this size looks like SIZE4 */ +#define SIZE4 14pt +#define SIZE5 12pt +#define SIZE6 10pt +#elif NETSCAPE6 +#define SIZE2 14pt +#define SIZE3 13pt +#define SIZE4 11pt +#define SIZE5 10pt +#define SIZE6 8pt +#elif MOZILLA +#define SIZE2 18pt +#define SIZE3 14pt +#define SIZE4 13pt +#define SIZE5 12pt +#define SIZE6 10pt +#elif IE +#define SIZE2 16pt +#define SIZE3 13pt +#define SIZE4 11pt +#define SIZE5 10pt +#define SIZE6 8pt +#endif + +#define NORMAL_SIZE SIZE4 + Index: src/libcwd/documentation/styles/doxygen.css diff -u /dev/null src/libcwd/documentation/styles/doxygen.css:1.1.2.1 --- /dev/null Wed Dec 26 21:12:21 2001 +++ src/libcwd/documentation/styles/doxygen.css Wed Dec 26 21:12:10 2001 @@ -0,0 +1,120 @@ +#include "defines.h" + +/* + * Style sheet definitions for doxygen. + */ + +H1 { + text-align : center; + font-size : HSIZE2; +} + +A.qindex { +} + +A.qindexRef { +} + +A.el { + text-decoration : none; + font-weight : bold +} + +A.elRef { + font-weight : bold; +} + +A.code { + text-decoration : none; + font-weight : normal; + color : #4444ee; +} + +A.codeRef { + font-weight : normal; + color : #4444ee; +} + +DL.el { + margin-left : -1cm; +} + +DIV.fragment { + width : 100%; + border : none; + background-color : #eeeeee; + font-family : monospace +#ifdef MOZILLA + padding-top : 0em; + padding-bottom : 0em; +#endif +} + +DIV.ah { + background-color : black; + font-weight : bold; + color : #ffffff; + margin-bottom : 3px; + margin-top: 3px; +} + +TD.md { + background-color : #f2f2ff; + font-weight : bold; +} + +TD.mdname1 { + color : #602020; + background-color : #f2f2ff; + font-weight : bold; +} + +TD.mdname { + background-color : #f2f2ff; + font-weight : bold; + color : #602020; + width : 600px; +} + +DIV.groupHeader { + margin-left : 16px; + margin-top : 12px; + margin-bottom : 6px; + font-weight : bold; +} + +DIV.groupText { + margin-left : 16px; + font-style : italic; + font-size : smaller; +} + +FONT.keyword { + color : #008000; +} + +FONT.keywordtype { + color : #604020; +} + +FONT.keywordflow { + color : #e08000; +} + +FONT.comment { + color : #800000; +} + +FONT.preprocessor { + color : #806020; +} + +FONT.stringliteral { + color : #002080; +} + +FONT.charliteral { + color : #008080; +} + + Index: src/libcwd/documentation/styles/ie/.cvsignore diff -u /dev/null src/libcwd/documentation/styles/ie/.cvsignore:1.1.2.1 --- /dev/null Wed Dec 26 21:12:21 2001 +++ src/libcwd/documentation/styles/ie/.cvsignore Wed Dec 26 21:12:10 2001 @@ -0,0 +1 @@ +*.css Index: src/libcwd/documentation/styles/konqueror/.cvsignore diff -u /dev/null src/libcwd/documentation/styles/konqueror/.cvsignore:1.1.2.1 --- /dev/null Wed Dec 26 21:12:21 2001 +++ src/libcwd/documentation/styles/konqueror/.cvsignore Wed Dec 26 21:12:10 2001 @@ -0,0 +1 @@ +*.css Index: src/libcwd/documentation/styles/main.css diff -u src/libcwd/documentation/styles/main.css:1.1.2.2 src/libcwd/documentation/styles/main.css:1.1.2.3 --- src/libcwd/documentation/styles/main.css:1.1.2.2 Tue Nov 13 19:01:07 2001 +++ src/libcwd/documentation/styles/main.css Wed Dec 26 21:12:10 2001 @@ -1,107 +1,218 @@ +#include "defines.h" + /* - * Style sheet definitions needed for doxygen + * Style Sheet for the libcw documentation */ -H1 { text-align: center; } -A.qindex {} -A.qindexRef {} -A.el { text-decoration: none; font-weight: bold } -A.elRef { font-weight: bold } -A.code { text-decoration: none; font-weight: normal; color: #4444ee } -A.codeRef { font-weight: normal; color: #4444ee } -A:hover { text-decoration: none; background-color: #f2f2ff } -DL.el { margin-left: -1cm } -DIV.fragment { width: 100%; border: none; background-color: #eeeeee; font-family: monospace } -DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } -TD.md { background-color: #f2f2ff; font-weight: bold; } -TD.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; } -TD.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; } -DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold } -DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller } -FONT.keyword { color: #008000 } -FONT.keywordtype { color: #604020 } -FONT.keywordflow { color: #e08000 } -FONT.comment { color: #800000 } -FONT.preprocessor { color: #806020 } -FONT.stringliteral { color: #002080 } -FONT.charliteral { color: #008080 } -CODE { display: inline; font-family: monospace } +BODY { + color : FOREGROUND_COLOR; + background-color : BACKGROUND_COLOR; + NORMAL_FONT; +#ifndef NETSCAPE4 + margin-top : 24px; /* Netscape 4 thinks it is funny to add 24 to the margin top all by itself. */ +#else + margin-top : 0; +#endif + border-top : 0; + padding-top : 0; + word-spacing : normal; + letter-spacing : normal; + text-transform : none; +} + +.normal { + color: FOREGROUND_COLOR; + background-color : BACKGROUND_COLOR; + NORMAL_FONT; + word-spacing : normal; + letter-spacing : normal; + text-transform : none; +} /* - * Style Sheet for the libcw documentation + * Style sheet in the TABLE of the header in order to get a solid + * horizontal line underneath the header. This does not work in netscape 4. */ - -BODY { color: black; background-color: rgb(247, 252, 248); margin-top: 10px; } -BODY, .normal { color: black; background-color: rgb(247, 252, 248); } -BODY, .normal, TD, TH { - font-family: verdana; - font-size: 10pt; +.header { + margin-top : 0; + margin-bottom : 1em; + border-top : 0; + border-bottom : 2px solid FOREGROUND_COLOR; + padding-top : 0; +#ifndef NETSCAPE4 + padding-bottom : 10px; +#endif +} + +.header-title { + font-family : helvetica, sans-serif; + font-size : HSIZE3; + font-weight : normal; + margin-top : 0; + margin-bottom : 0; + margin-left : 0; + margin-right : 0; +} + +.header-copyright { + font-family : MS sans serif, helvetica, sans-serif; + font-size : HSIZE5; + font-weight : normal; + margin-top : 0; + margin-bottom : 0; + margin-left : 0; + margin-right : 0; } /* Images and links */ a:link img, a:visited img { - border-style : none; + border-style : none; +} + +a:hover { + text-decoration : none; + color: : FOREGROUND_COLOR_HOVER; + background-color : BACKGROUND_COLOR_HOVER; } + a img { - color: transparent; background: transparent; text-decoration: none; + color : transparent; + background : transparent; + text-decoration : none; } -address img { - float: right; + +address img { + float : right; } + address { - padding-top: 0.5em; - padding-right: 1em; - padding-left: 1em; - padding-bottom: 0.5em; - margin-top: 3em; - border-top: 2px solid black; - background-color: #eee; - clear: both; + padding-top : 0.5em; + padding-right : 1em; + padding-left : 1em; + padding-bottom : 0.5em; + margin-top : 3em; + border-top : 2px solid FOREGROUND_COLOR; + color : FOREGROUND_COLOR_ADDRESS; + background-color : BACKGROUND_COLOR_ADDRESS; + clear : both; + font-family : sans-serif; + font-size : HSIZE5; } -.image-link:link { text-decoration: none; } -.image-link:visited { text-decoration: none; } -.image-link:active { text-decoration: none; } +/* Special classes */ -/* Heading fonts and sizes */ +.table { + font-family : helvetica, arial, sans-serif; + font-size : 18pt; + font-weight : bold; + margin-top : 3px; + margin-bottom : 3px + word-spacing : normal; + letter-spacing : normal; + text-transform : none; +} -H1, H2, H3, H4, H5 { font-family: helvetica; } +PRE, CODE, .output, .example-output { + font-family : courier, monospace; +#ifndef NETSCAPE4 + font-size : inherit; /* Bug in netscape 4 causes large letter-spacing when using this. */ +#else + font-size : NORMAL_SIZE; +#endif + white-space : pre; +} -/* Special classes */ +PRE { + display : block; +} -.table { - font-family: helvetica; - font-size: 18pt; - font-weight: bold; - margin-top: 3px; - margin-bottom: 3px +CODE { + display : inline; +} + +P { + font-size : NORMAL_SIZE; +} + +P.test-size2 { + font-size : SIZE2; +} + +P.test-size3 { + font-size : SIZE3; } -.code, .example-code, .nld, .output, .example-output { - font-family: courier; - font-size: 13pt; +P.test-size4 { + font-size : SIZE4; } +P.test-size5 { + font-size : SIZE5; +} + +P.test-size6 { + font-size : SIZE6; +} + +/* Heading fonts and sizes */ + +H1, H2, H3, H4, H5, H6 { + font-family : helvetica, arial, sans-serif; +} + +H1 { font-size: HSIZE1 } +H2 { font-size: HSIZE2 } +H3 { font-size: HSIZE3 } +H4 { font-size: HSIZE4 } +H5 { font-size: HSIZE5 } +H6 { font-size: HSIZE6 } + /* Colors */ -.code { color: #000040; } -.nld { color: #b80047; } -.output { color: rgb(40, 0, 100) } -.example, .example-code, .example-output { color: #2323DC } +PRE, CODE { + color : FOREGROUND_COLOR_CODE; + background-color : BACKGROUND_COLOR_CODE; +} +.output { + color : FOREGROUND_COLOR_OUTPUT; + background-color : BACKGROUND_COLOR_OUTPUT; +} +.example, CODE.example, .example-output { + color : FOREGROUND_COLOR_EXAMPLE; + background-color : BACKGROUND_COLOR_EXAMPLE; +} /* Indentation */ -PRE.example-code, PRE.example-output { margin-left: 30px } -PRE.output, PRE.code { margin-left: 10px } +PRE.example, PRE.example-output { + margin-left : 30px; +} + +PRE, PRE.output { + margin-left : 10px; +} + /* Font styles */ -.filename { font-family: courier } -.para { font-style: italic } -.command-line-parameter { font-weight: bold } -.command-line-variable { font-weight: normal; font-style: italic } -.H1code, .H2code, .H3code, .H4code, .H5code, .H6code { - font-family: courier; - font-weight: bold; - color: #000040; + +.filename { + font-family : courier, monospace; +} + +.para { + font-style : italic; +} + +.command-line-parameter { + font-weight : bold +} + +.command-line-variable { + font-weight : normal; + font-style : italic; +} + +.shell-command { + font-family : ludica; + font-size : NORMAL_SIZE; } -.shell-command { font-family: ludica; font-size: 12pt; } Index: src/libcwd/documentation/styles/mozilla/.cvsignore diff -u /dev/null src/libcwd/documentation/styles/mozilla/.cvsignore:1.1.2.1 --- /dev/null Wed Dec 26 21:12:21 2001 +++ src/libcwd/documentation/styles/mozilla/.cvsignore Wed Dec 26 21:12:10 2001 @@ -0,0 +1 @@ +*.css Index: src/libcwd/documentation/styles/netscape4/.cvsignore diff -u /dev/null src/libcwd/documentation/styles/netscape4/.cvsignore:1.1.2.1 --- /dev/null Wed Dec 26 21:12:21 2001 +++ src/libcwd/documentation/styles/netscape4/.cvsignore Wed Dec 26 21:12:10 2001 @@ -0,0 +1 @@ +*.css Index: src/libcwd/documentation/styles/netscape6/.cvsignore diff -u /dev/null src/libcwd/documentation/styles/netscape6/.cvsignore:1.1.2.1 --- /dev/null Wed Dec 26 21:12:21 2001 +++ src/libcwd/documentation/styles/netscape6/.cvsignore Wed Dec 26 21:12:10 2001 @@ -0,0 +1 @@ +*.css Index: src/libcwd/documentation/styles/test.html diff -u /dev/null src/libcwd/documentation/styles/test.html:1.1.2.1 --- /dev/null Wed Dec 26 21:12:21 2001 +++ src/libcwd/documentation/styles/test.html Wed Dec 26 21:12:10 2001 @@ -0,0 +1,92 @@ + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML LANG="en-us"> +<HEAD> +<META name="Author" content="Carlo Wood"> +<META http-equiv="content-type" content="text/html; charset=iso-8859-1"> +<META http-equiv="content-script-type" content="text/javascript"> +<TITLE>libcwd: The C++ Debugging Support Library</TITLE> +<SCRIPT SRC="../scripts/detect_browser.js"></SCRIPT> +<SCRIPT SRC="../scripts/load_style_sheets.js"></SCRIPT> +</HEAD> +<BODY> + +<TABLE class="header" height=64 width="100%" cellpadding=0 cellspacing=0 border=0> + <TR> + <TD width=237 valign=top> + <IMG valign=top src="../images/libcwd_logo.png" alt="" align=left border=0> + </TD> + <TD width="100%" align=center> + <DIV class="header-title"> + The C++ Debugging Support Library + </DIV> + <DIV class="header-copyright"> + By Carlo Wood, ©1999 - 2001. + </DIV> + </TD> + </TR> + <SCRIPT>if (is_mozilla4) document.write("<TR><TD colspan=2 height=19 valign=bottom><HR SIZE=2 NOSHADE></TD></TR>");</SCRIPT> +</TABLE> + +<DIV class="normal"> + +<H3>Headers</H3> + +<H1><H1>Largest Header</H1></H1> +<H2><H2>Here is some example code: <code><code>libcw::debug::dc</code></code></H2></H2> +<H3><H3>Here is some example code: <code><code>Dout(dc::notice, i << "Hello")</code></code></H3></H3> +<H4><H4>Here is some example code: <code><code>Dout(dc::notice, i << "Hello")</code></code></H4></H4> +<H5><H5>Here is some example code: <code><code>Dout(dc::notice, i << "Hello")</code></code></H5></H5> +<H6><H6>Here is some example code: <code><code>Dout(dc::notice, i << "Hello")</code></code></H6></H6> + +<H3>Paragraphs</H3> + +<p class="test-size2">Normal text with size 2. abcdefghijklmnopqrstuvwxyz 0123456789.</p> +<p class="test-size3">Normal text with size 3. abcdefghijklmnopqrstuvwxyz 0123456789.</p> +<p class="test-size4">Normal text with size 4. abcdefghijklmnopqrstuvwxyz 0123456789.</p> +<p class="test-size5">Normal text with size 5. abcdefghijklmnopqrstuvwxyz 0123456789.</p> +<p class="test-size6">Normal text with size 6. abcdefghijklmnopqrstuvwxyz 0123456789.</p> + +<H3>Code</H3> + +<P><p>Normal text. You can use <code>libcwd</code> +for instance in space shuttles or nuclear power plants, +to write debug output to <code>ostream</code> +devices.</p></P> + +<P><code><code>func(char const*)</code></code></P> + +<P><pre></P> +<PRE>// This line is not indented. + // This one is indented two spaces. + int abcdefghijklmnopqrstuvwxyz = 0123456789;</PRE> +<P></pre></P> + +<P>Here is program output:</P> + +<PRE class="output"> +Output of a program +should always be shown +inside a <PRE> +tag. +</PRE> + +<H3>Examples</H3> + +<P>This is an <SPAN class="example">example</SPAN> that is inline.</P> + +<P class="example">This is an example by itself.</P> + +<PRE class="example"> +NOTICE: This is example output. +NOTICE: This is the second line. +</PRE> + + +</DIV> + +<ADDRESS>Copyright © 2001 Carlo Wood. All rights reserved.</ADDRESS> + +</BODY> +</HTML> + Index: src/libcwd/documentation/styles/test.m4 diff -u /dev/null src/libcwd/documentation/styles/test.m4:1.1.2.1 --- /dev/null Wed Dec 26 21:12:21 2001 +++ src/libcwd/documentation/styles/test.m4 Wed Dec 26 21:12:10 2001 @@ -0,0 +1,61 @@ +include(definitions.m4)dnl +__HTMLHEADER +__PAGEHEADER +__PAGESTART + +<H3>Headers</H3> + +<H1><H1>Largest Header</H1></H1> +<H2><H2>Here is some example code: <code><code>libcw::debug::dc</code></code></H2></H2> +<H3><H3>Here is some example code: <code><code>Dout(dc::notice, i << "Hello")</code></code></H3></H3> +<H4><H4>Here is some example code: <code><code>Dout(dc::notice, i << "Hello")</code></code></H4></H4> +<H5><H5>Here is some example code: <code><code>Dout(dc::notice, i << "Hello")</code></code></H5></H5> +<H6><H6>Here is some example code: <code><code>Dout(dc::notice, i << "Hello")</code></code></H6></H6> + +<H3>Paragraphs</H3> + +<p class="test-size2">Normal text with size 2. abcdefghijklmnopqrstuvwxyz 0123456789.</p> +<p class="test-size3">Normal text with size 3. abcdefghijklmnopqrstuvwxyz 0123456789.</p> +<p class="test-size4">Normal text with size 4. abcdefghijklmnopqrstuvwxyz 0123456789.</p> +<p class="test-size5">Normal text with size 5. abcdefghijklmnopqrstuvwxyz 0123456789.</p> +<p class="test-size6">Normal text with size 6. abcdefghijklmnopqrstuvwxyz 0123456789.</p> + +<H3>Code</H3> + +<P><p>Normal text. You can use <code>libcwd</code> +for instance in space shuttles or nuclear power plants, +to write debug output to <code>ostream</code> +devices.</p></P> + +<P><code><code>func(char const*)</code></code></P> + +<P><pre></P> +<PRE>// This line is not indented. + // This one is indented two spaces. + int abcdefghijklmnopqrstuvwxyz = 0123456789;</PRE> +<P></pre></P> + +<P>Here is program output:</P> + +<PRE class="output"> +Output of a program +should always be shown +inside a <PRE> +tag. +</PRE> + +<H3>Examples</H3> + +<P>This is an <SPAN class="example">example</SPAN> that is inline.</P> + +<P class="example">This is an example by itself.</P> + +<PRE class="example"> +NOTICE: This is example output. +NOTICE: This is the second line. +</PRE> + +__PAGEEND +__PAGEFOOTER +__HTMLFOOTER + Index: src/libcwd/documentation/styles/tutorial.css diff -u /dev/null src/libcwd/documentation/styles/tutorial.css:1.1.2.1 --- /dev/null Wed Dec 26 21:12:21 2001 +++ src/libcwd/documentation/styles/tutorial.css Wed Dec 26 21:12:10 2001 @@ -0,0 +1,203 @@ +#include "defines.h" + +/* + * Style Sheets for tutorial. + */ + +DIV.body { + margin-left : 2cm; + margin-right : 0; +} + +P { + margin-left : 0; + margin-right : 2cm; +} + +P.download { + font-size : 80%; +} + +H1, H2 { + color : rgb(62, 122, 242); + background-color : INHERIT; + font-family : caligula, genoaroman, blackforest, arnoldboecklin, garamond, classicheavy, serif; +} + +H1 { + font-size : 400%; + text-align : center; +} + +H2 { + font-size : H2SIZE; +} + +FONT.hello { + font-family : caligula, genoaroman, blackforest, arnoldboecklin, garamond, classicheavy, serif; + font-size : SIZE2; + font-size : 300%; +} + +P.line { + margin-top : 1em; + margin-bottom : 1em; + margin-left : 0; + margin-right : 0; + padding : 0; + text-align : center; +} + +DIV.buttons { + margin-top : 0; +#ifdef KONQUEROR + margin-bottom : 0; /* Konqueror already puts a large empty area between the buttons and the address :/ */ +#else + margin-bottom : 1em; +#endif + padding-top : 0; + padding-bottom: : 0; + text-align : center; +} + +DIV.buttons IMG { + margin-left : 4px; + margin-right : 4px; +} + +DIV.faq-frame { + border-style : solid; + border-bottom-width : 0px; + border-left-width : 5px; + border-right-width : 0px; + border-top-width : 0px; + margin-right : 2cm; + padding-top : 1px; + color : #4c5e52; + background-color : rgb(240, 240, 224); + padding-bottom : 0.5em; + margin-bottom : 1em; +} + +DIV.faq-frame H4 { + margin-top : 1.1ex; + margin-left : 1em; + margin-bottom : 0; + font-size : HSIZE4; + font-weight : bold; + color : #4c5e52; + background-color : rgb(240, 240, 224); +} + +UL LI { + font-size : smaller; + color : FOREGROUND_COLOR; + background-color : INHERIT; +} + +.highlight { + font-weight : normal; + color : red; +} + +PRE { + color : FOREGROUND_COLOR_CODE; + background-color : #eeeeee; + margin-left : 0; + margin-right : 2cm; + padding-left : 1em; +} + +/* Table of contents styles */ + +BODY.toc { + background-color : rgb(247, 252, 248); + font-family : arial, helvetica, sans-serif; + font-size : HSIZE5; + font-weight : normal; + margin-top : 10px; + margin-bottom : 0px; + margin-left : 3px; + margin-right : 8px; +} + +A.toc:link, A.toc:visited, A.toc:active, A.toc1:link, A.toc1:visited, A.toc1:active { + text-decoration : none; + color : rgb(0, 150, 100); + background-color : INHERIT; +} + +A.toc:link, A.toc1:link { + color : rgb(0, 0, 255) + background-color : INHERIT; +} + +A.toc1:link { + text-decoration : underline; +} + +.toc-header1 { + font-family : helvetica; + font-size : SIZE2; + margin-bottom : 4px; + margin-top : 1px; + margin-left : 0px; + font-weight : bold; +} + +.toc-number2f { + font-family : times; + font-size : SIZE3; + margin-bottom : 2px; + margin-top : 0px; +} + +.toc-header2f { + font-family : helvetica; + font-size : SIZE3; + margin-bottom : 2px; + margin-top : 0px; + font-weight : normal; +} + +.toc-number2 { + font-family : times; + font-size : SIZE3; + margin-bottom : 2px; + margin-top : 15px; +} + +.toc-header2 { + font-family : helvetica; + font-size : SIZE3; + margin-bottom : 2px; + margin-top : 15px; + font-weight : normal; +} + +.toc-number3 { + font-family : times; + font-size : SIZE4; + margin-bottom : 2px; +} + +.toc-header3 { + font-family : helvetica; + font-size : SIZE4; + margin-bottom : 2px; + margin-left : 4px; +} + +.toc-number4 { + font-family : times; + font-size : SIZE5; + margin-bottom : 2px; +} + +.toc-header4 { + font-family : helvetica; + font-size : SIZE5; + margin-bottom : 2px; + margin-left : 8px; +} + ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-12-27 05:13:32
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-11-27 05:13:32 UTC Modified files: Tag: branch-threading libcwd/documentation/Makefile libcwd/documentation/custom_do.dox libcwd/documentation/deallocation_pointer_validation.dox libcwd/documentation/debug_channels.dox libcwd/documentation/html.header libcwd/documentation/location.dox libcwd/documentation/magic.dox libcwd/documentation/mainpage.dox libcwd/documentation/nested.dox libcwd/documentation/why_macro.dox libcwd/documentation/scripts/detect_browser.js libcwd/documentation/scripts/load_style_sheets.js Added files: Tag: branch-threading libcwd/documentation/definitions.m4 libcwd/documentation/images/libcwd_logo.png Log message: Bug fixes and improvements, work in progress. ---------------------- diff included ---------------------- Index: src/libcwd/documentation/Makefile diff -u src/libcwd/documentation/Makefile:1.1.2.2 src/libcwd/documentation/Makefile:1.1.2.3 --- src/libcwd/documentation/Makefile:1.1.2.2 Fri Dec 7 18:06:23 2001 +++ src/libcwd/documentation/Makefile Wed Dec 26 21:13:21 2001 @@ -2,9 +2,9 @@ INPUT_FILES=$(shell for i in $(INPUT); do if test -f $$i; then echo $$i; else for j in $(FILE_PATTERNS); do ls $$i/$$j; done; fi done) EXAMPLE_FILES=$(shell find doxygen-examples -mindepth 1 -maxdepth 1 -type f -print) -.PHONY: html external +.PHONY: html external styles tutorial -html: external +html: external styles tutorial rm -rf html doxygen doxygen.config mv html/preparation.html html/preparation.tmp @@ -28,3 +28,10 @@ external/debug.cc: ../example-project/debug.cc cp ../example-project/debug.cc external/debug.cc + +styles: + $(MAKE) -C styles + +tutorial: + $(MAKE) -C tutorial + Index: src/libcwd/documentation/custom_do.dox diff -u src/libcwd/documentation/custom_do.dox:1.1.2.4 src/libcwd/documentation/custom_do.dox:1.1.2.5 --- src/libcwd/documentation/custom_do.dox:1.1.2.4 Fri Dec 7 18:06:23 2001 +++ src/libcwd/documentation/custom_do.dox Wed Dec 26 21:13:21 2001 @@ -6,8 +6,8 @@ \page page_custom_do \ingroup chapter_custom_do -Each %debug object is associated with one ostream. -The default %debug output macros Dout and DoutFatal use the \em default debug object libcw::debug::libcw_do. +Each %debug object is associated with one <code>ostream</code>. +The default %debug output macros \ref Dout and \ref DoutFatal use the \em default debug object libcw::debug::libcw_do. Other %debug objects may be created as global objects; it is convenient to define new macros for each (custom) %debug object using the generic macros \ref LibcwDout and \ref LibcwDoutFatal. Index: src/libcwd/documentation/deallocation_pointer_validation.dox diff -u src/libcwd/documentation/deallocation_pointer_validation.dox:1.1.2.3 src/libcwd/documentation/deallocation_pointer_validation.dox:1.1.2.4 --- src/libcwd/documentation/deallocation_pointer_validation.dox:1.1.2.3 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/deallocation_pointer_validation.dox Wed Dec 26 21:13:21 2001 @@ -20,20 +20,20 @@ <td BGCOLOR="#a98061"><font COLOR="#ffffff">Allocation function</font></td> </tr> <tr> -<td><span class="code">delete</span></td> -<td><span class="code">new</span></td> +<td><CODE>delete</CODE></td> +<td><CODE>new</CODE></td> </tr> <tr> -<td><span class="code">delete []</span></td> -<td><span class="code">new []</span></td> +<td><CODE>delete []</CODE></td> +<td><CODE>new []</CODE></td> </tr> <tr> -<td><span class="code">free()</span></td> -<td><span class="code">malloc()</span>, <span class="code">calloc()</span> or <span class="code">realloc()</span></td> +<td><CODE>free()</CODE></td> +<td><CODE>malloc()</CODE>, <CODE>calloc()</CODE> or <CODE>realloc()</CODE></td> </tr> <tr> -<td><span class="code">realloc()</span></td> -<td><span class="code">malloc()</span>, <span class="code">calloc()</span> or <span class="code">realloc()</span></td> +<td><CODE>realloc()</CODE></td> +<td><CODE>malloc()</CODE>, <CODE>calloc()</CODE> or <CODE>realloc()</CODE></td> </tr> </table> </center> Index: src/libcwd/documentation/debug_channels.dox diff -u src/libcwd/documentation/debug_channels.dox:1.1.2.3 src/libcwd/documentation/debug_channels.dox:1.1.2.4 --- src/libcwd/documentation/debug_channels.dox:1.1.2.3 Fri Dec 7 18:06:23 2001 +++ src/libcwd/documentation/debug_channels.dox Wed Dec 26 21:13:21 2001 @@ -45,7 +45,7 @@ gives as result -\exampleoutput <PRE> +\exampleoutput <PRE class="example-output"> NOTICE: Libcw is a great library</PRE> \endexampleoutput @@ -67,13 +67,13 @@ #endif Dout(dc::hello, "Hello World!"); -Dout(dc::kernel|dc::io, "This is written when either the <i>kernel</i>" -"or <i>io</i> channel is turned on."); +Dout(dc::kernel|dc::io, "This is written when either the dc::kernel " + "or dc::io channel is turned on."); \endcode gives as result -\exampleoutput <PRE> +\exampleoutput <PRE class="example-output"> HELLO : Hello World! KERNEL: This is written when either the kernel or io channel is turned on.</PRE> \endexampleoutput Index: src/libcwd/documentation/definitions.m4 diff -u /dev/null src/libcwd/documentation/definitions.m4:1.1.2.1 --- /dev/null Wed Dec 26 21:13:32 2001 +++ src/libcwd/documentation/definitions.m4 Wed Dec 26 21:13:21 2001 @@ -0,0 +1,49 @@ +changequote([[,]])dnl +define(__HTMLHEADER, [[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML LANG="en-us"> +<HEAD> +<META name="Author" content="Carlo Wood"> +<META http-equiv="content-type" content="text/html; charset=iso-8859-1"> +<META http-equiv="content-script-type" content="text/javascript"> +<TITLE>libcwd: The C++ Debugging Support Library</TITLE> +<SCRIPT SRC="../scripts/detect_browser.js"></SCRIPT> +ifdef([[__DOXYGEN]], [[<SCRIPT>need_style_doxygen=1</SCRIPT> +]])dnl +ifdef([[__TUTORIAL]], [[<SCRIPT>need_style_tutorial=1</SCRIPT> +]])dnl +ifdef([[__CWTAG]], [[<SCRIPT>need_style_tag_cw=1</SCRIPT> +]])dnl +<SCRIPT SRC="../scripts/load_style_sheets.js"></SCRIPT> +</HEAD> +<BODY>]])dnl +dnl +define(__HTMLFOOTER, [[ +</BODY> +</HTML>]]) +dnl +define(__PAGEHEADER, [[ +<TABLE class="header" height=64 width="100%" cellpadding=0 cellspacing=0 border=0> + <TR> + <TD width=237 valign=top> + <IMG valign=top src="../images/libcwd_logo.png" alt="" align=left border=0> + </TD> + <TD width="100%" align=center> + <DIV class="header-title"> + The C++ Debugging Support Library + </DIV> + <DIV class="header-copyright"> + By Carlo Wood, ©1999 - 2001. + </DIV> + </TD> + </TR> + <SCRIPT>if (is_mozilla4) document.write("<TR><TD colspan=2 height=19 valign=bottom><HR SIZE=2 NOSHADE></TD></TR>");</SCRIPT> +</TABLE>]])dnl +dnl +define(__PAGEFOOTER, [[ +<ADDRESS>Copyright © 2001 Carlo Wood. All rights reserved.</ADDRESS>]])dnl +dnl +define(__PAGESTART, [[ +<DIV class="body">]])dnl +dnl +define(__PAGEEND, [[ +</DIV>]])dnl Index: src/libcwd/documentation/html.header diff -u src/libcwd/documentation/html.header:1.1.2.2 src/libcwd/documentation/html.header:1.1.2.3 --- src/libcwd/documentation/html.header:1.1.2.2 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/html.header Wed Dec 26 21:13:21 2001 @@ -3,12 +3,14 @@ <HEAD> <META name="Author" content="Carlo Wood"> -<META name="description" content="Object Oriented Debug Output Facility in C++"> -<META name="keywords" content="libcwd, debug output, debug facility, debug channel, object orientation, OO, C++, nested debug output"> +<META name="description" content="C++ debugging support library with ostream debug output"> +<META name="keywords" content="libcwd, debug output, debug facility, debug channel, object orientation, OO, C++, nested debug output, ostream, memory allocation, debugging, source file and line number"> <META http-equiv="content-type" content="text/html; charset=iso-8859-1"> -<TITLE>libcwd: An Object Oriented C++ debugging library</TITLE> -<SCRIPT TYPE="text/javascript" SRC="../scripts/detect_browser.js"></SCRIPT> -<SCRIPT TYPE="text/javascript" SRC="../scripts/load_style_sheets.js"></SCRIPT> +<META http-equiv="content-script-type" content="text/javascript"> +<TITLE>libcwd: The C++ Debugging Library - Reference Manual</TITLE> +<SCRIPT src="../scripts/detect_browser.js"></SCRIPT> +<SCRIPT>need_style_doxygen=1</SCRIPT> +<SCRIPT src="../scripts/load_style_sheets.js"></SCRIPT> </HEAD> <BODY> Index: src/libcwd/documentation/images/libcwd_logo.png Index: src/libcwd/documentation/location.dox diff -u src/libcwd/documentation/location.dox:1.1.2.4 src/libcwd/documentation/location.dox:1.1.2.5 --- src/libcwd/documentation/location.dox:1.1.2.4 Fri Dec 7 18:06:23 2001 +++ src/libcwd/documentation/location.dox Wed Dec 26 21:13:21 2001 @@ -27,7 +27,7 @@ For example, -\exampleoutput <PRE> +\exampleoutput <PRE class="example-output"> MALLOC : operator new (size = 4) = <unfinished> BFD : 0x804bc9b is at (deb.cc:179) MALLOC : <continued> 0x8137220</PRE> Index: src/libcwd/documentation/magic.dox diff -u src/libcwd/documentation/magic.dox:1.1.2.2 src/libcwd/documentation/magic.dox:1.1.2.3 --- src/libcwd/documentation/magic.dox:1.1.2.2 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/magic.dox Wed Dec 26 21:13:21 2001 @@ -50,7 +50,7 @@ results in output like -\exampleoutput <PRE> +\exampleoutput <PRE class="example-output"> MALLOC : operator new[] (size = 16) = 0x8116460 MALLOC : Allocated memory: 16 bytes in 1 blocks. Index: src/libcwd/documentation/mainpage.dox diff -u src/libcwd/documentation/mainpage.dox:1.1.2.5 src/libcwd/documentation/mainpage.dox:1.1.2.6 --- src/libcwd/documentation/mainpage.dox:1.1.2.5 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/mainpage.dox Wed Dec 26 21:13:21 2001 @@ -14,13 +14,15 @@ \li \ref downloading \li \ref preparation +\htmlonly +<li> <a href="../tutorial/index.html">Tutorial</a> +\endhtmlonly \li \ref reference \section output_example Example output \htmlonly -<CODE> -<PRE> +<PRE class="example-output"> MALLOC : malloc(72) = <unfinished> BFD : address 0x402ad017 corresponds to dl-open.c:114 MALLOC : <continued> 0x81c1330 @@ -44,7 +46,6 @@ malloc 0x81c00a0 dlerror.c:108 <unknown type>; (sz = 16) NOTICE : Finished </PRE> -</CODE> \endhtmlonly */ Index: src/libcwd/documentation/nested.dox diff -u src/libcwd/documentation/nested.dox:1.1.2.4 src/libcwd/documentation/nested.dox:1.1.2.5 --- src/libcwd/documentation/nested.dox:1.1.2.4 Wed Dec 5 22:01:16 2001 +++ src/libcwd/documentation/nested.dox Wed Dec 26 21:13:21 2001 @@ -31,7 +31,7 @@ This code would start a new debug message before the previous debug message is finished. Libcwd detects this and will output: -\exampleoutput <PRE> +\exampleoutput <PRE class="example-output"> NOTICE: Entering foobar() NOTICE: Leaving foobar() KERNEL: The value of foobar() = 2, aint that nice?</PRE> @@ -53,13 +53,13 @@ If generate_tables() would not print debug messages, then the output will look like: -\exampleoutput <PRE> +\exampleoutput <PRE class="example-output"> KERNEL: Generating tables... done</PRE> \endexampleoutput When it does generated debug output, then the <unfinished> and <continued> labels are printed also: -\exampleoutput <PRE> +\exampleoutput <PRE class="example-output"> KERNEL: Generating tables... <unfinished> NOTICE: Inside generate_tables() KERNEL: <continued> done</PRE> @@ -79,13 +79,13 @@ When generate_table(i) doesn't print debug messages, then the output will look like: -\exampleoutput <PRE> +\exampleoutput <PRE class="example-output"> NOTICE: Generating tables......... done</PRE> \endexampleoutput When it does generate debug output, then each dot would be surrounded by a <continued> .<unfinished> : -\exampleoutput <PRE> +\exampleoutput <PRE class="example-output"> NOTICE: Generating tables.<unfinished> TABLE : Inside generate_table(0) NOTICE: <continued> .<unfinished></PRE> Index: src/libcwd/documentation/scripts/detect_browser.js diff -u src/libcwd/documentation/scripts/detect_browser.js:1.1.2.1 src/libcwd/documentation/scripts/detect_browser.js:1.1.2.2 --- src/libcwd/documentation/scripts/detect_browser.js:1.1.2.1 Fri Oct 26 15:58:03 2001 +++ src/libcwd/documentation/scripts/detect_browser.js Wed Dec 26 21:13:22 2001 @@ -1,70 +1,65 @@ // From http://developer.netscape.com/docs/examples/javascript/browser_type.html -var a=navigator.userAgent.toLowerCase(); -var j=parseInt(navigator.appVersion); -var n=parseFloat(navigator.appVersion); -var is_nav=a.indexOf('mozilla')!=-1&&a.indexOf('spoofer')==-1&&a.indexOf('compatible')==-1&&a.indexOf('opera')==-1&&a.indexOf('webtv')==-1; -var is_nav2=is_nav&&j==2; -var is_nav3=is_nav&&j==3; -var is_nav4=is_nav&&j==4; -var is_nav4up=is_nav&&j>=4; -var is_navonly=is_nav&&(a.indexOf(";nav")!=-1||a.indexOf("; nav")!=-1); -var is_nav5=is_nav&&j==5; -var is_nav5up=is_nav&&j>=5; -var is_ie=a.indexOf("msie")!=-1; -var is_ie3=is_ie&&(j<4); -var is_ie4=is_ie&&j==4&&a.indexOf("msie 5.0")==-1; -var is_ie4up=is_ie&&j>=4; -var is_ie5=is_ie&&j==4&&a.indexOf("msie 5.0")!=-1; -var is_ie5up=is_ie&&!is_ie3&&!is_ie4; -var is_aol=a.indexOf("aol")!=-1; -var is_aol3=is_aol&&is_ie3; -var is_aol4=is_aol&&is_ie4; -var is_opera=a.indexOf("opera")!=-1; -var is_webtv=a.indexOf("webtv")!=-1; -var is_js; -if(is_nav2||is_ie3)is_js=1.0 -else if(is_nav3||is_opera)is_js=1.1 -else if((is_nav4&&n<=4.05)||is_ie4)is_js=1.2 -else if((is_nav4&&n>4.05)||is_ie5)is_js=1.3 -else if(is_nav5)is_js=1.4 -else if(is_nav&&j>5)is_js=1.4 -else if(is_ie&&j>5)is_js=1.3 -else is_js=0.0; -var is_win=a.indexOf("win")!=-1||a.indexOf("16bit")!=-1; -var is_win95=a.indexOf("win95")!=-1||a.indexOf("windows 95")!=-1; -var is_win16=a.indexOf("win16")!=-1||a.indexOf("16bit")!=-1||a.indexOf("windows 3.1")!=-1||a.indexOf("windows 16-bit")!=-1; -var is_win31=a.indexOf("windows 3.1")!=-1||a.indexOf("win16")!=-1||a.indexOf("windows 16-bit")!=-1; -var is_win98=a.indexOf("win98")!=-1||a.indexOf("windows 98")!=-1; -var is_winnt=a.indexOf("winnt")!=-1||a.indexOf("windows nt")!=-1; -var is_win32=is_win95||is_winnt||is_win98||(j>=4&&navigator.platform=="Win32")||a.indexOf("win32")!=-1||a.indexOf("32bit")!=-1; -var is_os2=a.indexOf("os/2")!=-1||navigator.appVersion.indexOf("OS/2")!=-1||a.indexOf("ibm-webexplorer")!=-1; -var is_mac=a.indexOf("mac")!=-1; -var is_mac68k=is_mac&&(a.indexOf("68k")!=-1||a.indexOf("68000")!=-1); -var is_macppc=is_mac&&(a.indexOf("ppc")!=-1||a.indexOf("powerpc")!=-1); -var is_sun=a.indexOf("sunos")!=-1; -var is_sun4=a.indexOf("sunos 4")!=-1; -var is_sun5=a.indexOf("sunos 5")!=-1; -var is_suni86=is_sun&&a.indexOf("i86")!=-1; -var is_irix=a.indexOf("irix")!=-1; -var is_irix5=a.indexOf("irix 5")!=-1; -var is_irix6=a.indexOf("irix 6")!=-1||a.indexOf("irix6")!=-1; -var is_hpux=a.indexOf("hp-ux")!=-1; -var is_hpux9=is_hpux&&a.indexOf("09.")!=-1; -var is_hpux10=is_hpux&&a.indexOf("10.")!=-1; -var is_aix=a.indexOf("aix")!=-1; -var is_aix1=a.indexOf("aix 1")!=-1; -var is_aix2=a.indexOf("aix 2")!=-1; -var is_aix3=a.indexOf("aix 3")!=-1; -var is_aix4=a.indexOf("aix 4")!=-1; -var is_linux=a.indexOf("inux")!=-1; -var is_sco=a.indexOf("sco")!=-1||a.indexOf("unix_sv")!=-1; -var is_unixware=a.indexOf("unix_system_v")!=-1; -var is_mpras=a.indexOf("ncr")!=-1; -var is_reliant=a.indexOf("reliantunix")!=-1; -var is_dec=a.indexOf("dec")!=-1||a.indexOf("osf1")!=-1||a.indexOf("dec_alpha")!=-1||a.indexOf("alphaserver")!=-1||a.indexOf("ultrix")!=-1||a.indexOf("alphastation")!=-1; -var is_sinix=a.indexOf("sinix")!=-1; -var is_freebsd=a.indexOf("freebsd")!=-1; -var is_bsd=a.indexOf("bsd")!=-1; -var is_unix=a.indexOf("x11")!=-1||is_sun||is_irix||is_hpux||is_sco||is_unixware||is_mpras||is_reliant||is_dec||is_sinix||is_aix||is_linux||is_bsd||is_freebsd; -var is_vms=a.indexOf("vax")!=-1||a.indexOf("openvms")!=-1; + +// convert all characters to lowercase to simplify testing +var agt=navigator.userAgent.toLowerCase(); + +// *** BROWSER VERSION *** +// Note: On IE5, these return 4, so use is_ie5up to detect IE5. +var is_major = parseInt(navigator.appVersion); +var is_minor = parseFloat(navigator.appVersion); + +// Note: Opera and WebTV spoof Mozilla. We do strict client detection. +var is_mozilla = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) + && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) + && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)); +var is_mozilla2 = (is_mozilla && (is_major == 2)); +var is_mozilla3 = (is_mozilla && (is_major == 3)); +var is_mozilla4 = (is_mozilla && (is_major == 4)); +var is_mozilla4up = (is_mozilla && (is_major >= 4)); +var is_mozilla5 = (is_mozilla && (is_major == 5)); +var is_mozilla5up = (is_mozilla && (is_major >= 5)); +var is_gecko = (agt.indexOf('gecko') != -1); +var is_netscape6 = (is_mozilla5 && (agt.indexOf('netscape6')!=-1)); + +var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)); +var is_ie3 = (is_ie && (is_major < 4)); +var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) ); +var is_ie4up = (is_ie && (is_major >= 4)); +var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) ); +var is_ie5_5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1)); +var is_ie5up = (is_ie && !is_ie3 && !is_ie4); +var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5); +var is_ie6 = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) ); +var is_ie6up = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5); + +// KNOWN BUG: On AOL4, returns false if IE3 is embedded browser +// or if this is the first browser window opened. Thus the +// variables is_aol, is_aol3, and is_aol4 aren't 100% reliable. +var is_aol = (agt.indexOf("aol") != -1); +var is_aol3 = (is_aol && is_ie3); +var is_aol4 = (is_aol && is_ie4); +var is_aol5 = (agt.indexOf("aol 5") != -1); +var is_aol6 = (agt.indexOf("aol 6") != -1); + +var is_opera = (agt.indexOf("opera") != -1); +var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1); +var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1); +var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1); +var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1); +var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4); + +var is_webtv = (agt.indexOf("webtv") != -1); + +var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); +var is_AOLTV = is_TVNavigator; + +var is_hotjava = (agt.indexOf("hotjava") != -1); +var is_hotjava3 = (is_hotjava && (is_major == 3)); +var is_hotjava3up = (is_hotjava && (is_major >= 3)); + +var is_konqueror = (navigator.appName.indexOf("Konqueror") != -1); + var need_style_tag_cw = 0; +var need_style_tutorial = 0; +var need_style_doxygen = 0; + Index: src/libcwd/documentation/scripts/load_style_sheets.js diff -u src/libcwd/documentation/scripts/load_style_sheets.js:1.1.2.3 src/libcwd/documentation/scripts/load_style_sheets.js:1.1.2.4 --- src/libcwd/documentation/scripts/load_style_sheets.js:1.1.2.3 Sun Dec 9 11:29:55 2001 +++ src/libcwd/documentation/scripts/load_style_sheets.js Wed Dec 26 21:13:22 2001 @@ -1,5 +1,7 @@ with (document) { + var styles_path; + var rootpath; var rootpos = location.href.lastIndexOf("libcw.sourceforge.net"); if (rootpos != -1) rootpath = location.href.substring(0,rootpos) + "libcw.sourceforge.net/"; @@ -8,19 +10,52 @@ rootpos = location.pathname.lastIndexOf("/html/"); if (rootpos != -1) rootpath = location.pathname.substring(0,rootpos) + "/"; + else + { + rootpos = location.pathname.lastIndexOf("/tutorial/"); + if (rootpos != -1) + rootpath = location.pathname.substring(0,rootpos) + "/"; + else + { + rootpos = location.pathname.lastIndexOf("/documentation/"); + if (rootpos != -1) + rootpath = location.pathname.substring(0,rootpos) + "/documentation/"; + } + } } - write("<LINK REL=StyleSheet HREF=\"" + rootpath + "styles/main.css\" TYPE=\"text/css\">"); - if (need_style_tag_cw == 1) - write("<LINK REL=StyleSheet HREF=\"" + rootpath + "styles/tag-cw.css\" TYPE=\"text/css\">"); - if (is_nav) + + if (is_opera) + styles_path = rootpath + "styles/opera/"; + else { - if (is_nav5up) - write("<LINK REL=StyleSheet HREF=\"" + rootpath + "styles/ns5/main.css\" TYPE=\"text/css\">"); + if (is_mozilla4) + styles_path = rootpath + "styles/netscape4/"; else { - write("<LINK REL=StyleSheet HREF=\"" + rootpath + "styles/ns4/main.css\" TYPE=\"text/css\">"); - if (is_unix) - write("<LINK REL=StyleSheet HREF=\"" + rootpath + "styles/ns4/linux/main.css\" TYPE=\"text/css\">"); + if (is_netscape6) + styles_path = rootpath + "styles/netscape6/"; + else + { + if (is_konqueror) + styles_path = rootpath + "styles/konqueror/"; + else + { + if (is_ie) + styles_path = rootpath + "styles/ie/"; + else if (is_mozilla5up || is_gecko) + styles_path = rootpath + "styles/mozilla/"; + else + styles_path = rootpath + "styles/ie/"; + } + } } } + + write("<LINK REL=StyleSheet HREF=\"" + styles_path + "main.css\" TYPE=\"text/css\">"); + if (need_style_tutorial == 1) + write("<LINK REL=StyleSheet HREF=\"" + styles_path + "tutorial.css\" TYPE=\"text/css\">"); + if (need_style_doxygen == 1) + write("<LINK REL=StyleSheet HREF=\"" + styles_path + "doxygen.css\" TYPE=\"text/css\">"); + if (need_style_tag_cw == 1) + write("<LINK REL=StyleSheet HREF=\"" + styles_path + "tag-cw.css\" TYPE=\"text/css\">"); } Index: src/libcwd/documentation/why_macro.dox diff -u src/libcwd/documentation/why_macro.dox:1.1.2.2 src/libcwd/documentation/why_macro.dox:1.1.2.3 --- src/libcwd/documentation/why_macro.dox:1.1.2.2 Fri Dec 7 18:06:23 2001 +++ src/libcwd/documentation/why_macro.dox Wed Dec 26 21:13:21 2001 @@ -20,12 +20,12 @@ </OL> Points 1, 2 and 3 are the most important reasons that lead to the decision to use a macro. -Please note that the author of %libcw used the alternative for <B>two years</B> before finally deciding to +Please note that the author of %libcw used the alternative for <B>two years</B> before finally deciding to <B>rewrite</B> the debug facility, being convinced that it was better to do it the way it is done now. While points 4 and 5 are trivial, the first three advantages might need some explanation: 1. Usually a developer won't use compiler optimization because that makes debugging harder. -In most cases the debug code will be compiled and used <em>without</em> compiler optimization; including +In most cases the debug code will be compiled and used <em>without</em> compiler optimization; implying the fact that no inlining is done. Moreover, we expect to use a lot of inserter operators and without optimization, each of these will be called. @@ -50,7 +50,7 @@ on or off <B>before</B> calling the <CODE>%operator<<()</CODE>'s. After all, such an operator call can use a lot of CPU time for arbitrary objects. -We can not pass <CODE>"i = " << i << "; j = " << j << "; s = " << s << std::endl</CODE> +We cannot pass <CODE>"i = " << i << "; j = " << j << "; s = " << s << std::endl</CODE> to an inline function without causing all <CODE>%operator<<</CODE> functions to be called. The only way, not using a macro, to achieve that no <CODE>%operator<<</CODE> is called is by not calling them @@ -69,7 +69,7 @@ } \endcode -Nevertheless, even with inlining (needing often the maximium optimization), most compilers would turn that into: +Nevertheless, even with inlining (often requiring the highest level of optimization), most compilers would turn that into: \code if (on) @@ -120,3 +120,4 @@ \endcode */ + ----------------------- End of diff ----------------------- |
From: Carlo W. <li...@us...> - 2001-12-27 05:15:23
|
CVSROOT : /cvsroot/libcw Module : src Branch tags: branch-threading Commit time: 2001-11-27 05:15:23 UTC Modified files: Tag: branch-threading libcwd/include/libcw/class_debug.inl Log message: Documentation bug fix. ---------------------- diff included ---------------------- Index: src/libcwd/include/libcw/class_debug.inl diff -u src/libcwd/include/libcw/class_debug.inl:1.1.2.3 src/libcwd/include/libcw/class_debug.inl:1.1.2.4 --- src/libcwd/include/libcw/class_debug.inl:1.1.2.3 Fri Dec 7 18:06:23 2001 +++ src/libcwd/include/libcw/class_debug.inl Wed Dec 26 21:15:13 2001 @@ -1,4 +1,4 @@ -// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_debug.inl,v 1.1.2.3 2001/12/08 02:06:23 libcw Exp $ +// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/Attic/class_debug.inl,v 1.1.2.4 2001/12/27 05:15:13 libcw Exp $ // // Copyright (C) 2000 - 2001, by // @@ -145,7 +145,7 @@ /** * \brief Constructor * - * A debug object must be global. + * A %debug object must be global. * * \sa group_debug_object * \sa chapter_custom_do ----------------------- End of diff ----------------------- |