|
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] |