Main Page   Reference Manual   Namespace List   Compound List   Namespace Members   Compound Members   File Members  

Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
libcwd Namespace Reference

namespace for libcwd. More...

Namespaces

 channels
 The default DEBUGCHANNELS namespace.
 

Classes

class  buf2str
 Print a (char) buffer with a given size to a debug ostream, escaping non-printable characters. More...
 
class  char2str
 Print a char to a debug ostream, escaping non-printable characters as needed. More...
 
class  alloc_ct
 An object of type alloc_ct contains information about one allocated memory block. More...
 
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. More...
 
class  debug_ct
 The Debug Object class, this object represents one output device (ostream). More...
 
class  debug_string_ct
 A string class used for the debug output margin and marker. More...
 
class  marker_ct
 A memory allocation marker. More...
 
class  object_file_ct
 An object representing the main executable or a shared library. More...
 
class  rcfile_ct
 This object represents a runtime configuration file. More...
 
class  type_info_ct
 Class that holds type information for debugging purposes.  Returned by type_info_of(). More...
 

Typedefs

typedef unsigned short int alloc_format_t
 The type used for the formatting flags of an alloc_filter_ct object.
 
typedef unsigned int control_flag_t
 

Enumerations

enum  continued_cf_nt { continued_cf }
 continued_cf has its own type for overloading purposes. More...
 
enum  memblk_types_nt {
  memblk_type_new , memblk_type_deleted , memblk_type_new_array , memblk_type_deleted_array ,
  memblk_type_malloc , memblk_type_realloc , memblk_type_freed , memblk_type_external ,
  memblk_type_posix_memalign , memblk_type_aligned_alloc , memblk_type_memalign , memblk_type_valloc
}
 A flag indicating the type of allocation. More...
 

Functions

void core_dump ()
 Dump core of current thread. More...
 
channel_ctfind_channel (char const *label)
 Find debug channel with label label. More...
 
void list_channels_on (debug_ct &debug_object)
 List all debug channels to a given debug object. More...
 
std::ostream & operator<< (std::ostream &os, memblk_types_nt memblk_type)
 Allow writing a memblk_types_nt directly to an ostream. More...
 
bool test_delete (void const *void_ptr)
 Test if a pointer points to the start of an allocated memory block. More...
 
size_t mem_size ()
 Returns the total number of allocated bytes.
 
unsigned long mem_blocks ()
 Returns the total number of allocated memory blocks.
 
std::ostream & operator<< (std::ostream &o, malloc_report_nt)
 Allow writing of enum malloc_report_nt to an ostream. More...
 
unsigned long list_allocations_on (debug_ct &debug_object)
 List all current allocations to a given debug object. More...
 
unsigned long list_allocations_on (debug_ct &debug_object, alloc_filter_ct const &filter)
 List all current allocations to a given debug object using a specified format. More...
 
void make_invisible (void const *void_ptr)
 Make allocation pointed to by ptr invisible. More...
 
void make_all_allocations_invisible_except (void const *ptr)
 Make all current allocations invisible except the given pointer. More...
 
void make_exit_function_list_invisible ()
 Make allocations done in libc.so:__new_exitfn invisible. More...
 
void move_outside (marker_ct *marker, void const *void_ptr)
 Move memory allocation pointed to by ptr outside marker.
 
alloc_ct const * find_alloc (void const *ptr)
 Find information about a memory allocation. More...
 
char const * pc_mangled_function_name (void const *addr)
 Find the mangled function name of the address addr. More...
 
void read_rcfile ()
 Calls libcwd::rcfile.read(). More...
 
control_flag_t cond_nonewline_cf (bool cond)
 Returns nonewline_cf when cond is true.
 
control_flag_t cond_noprefix_cf (bool cond)
 Returns noprefix_cf when cond is true.
 
control_flag_t cond_nolabel_cf (bool cond)
 Returns nolabel_cf when cond is true.
 
control_flag_t cond_error_cf (bool err)
 Returns error_cf when cond is true.
 
void demangle_type (char const *input, std::string &output)
 Demangle mangled type name input and write the result to string output.
 
void demangle_symbol (char const *input, std::string &output)
 Demangle mangled symbol name input and write the result to string output.
 
template<typename T >
type_info_ct const & type_info_of ()
 Get type information of a given class or type. More...
 
template<typename T >
type_info_ct const & type_info_of (T const &)
 Get type information of a given class instance. More...
 

Variables

debug_ct libcw_do
 The default debug object. More...
 
control_flag_t const nonewline_cf
 Omit the default new line at the end.
 
control_flag_t const noprefix_cf
 Omit margin, label, marker and indentation.
 
control_flag_t const nolabel_cf
 Omit label, marker and indentation.
 
control_flag_t const blank_margin_cf
 Replace margin by white space.
 
control_flag_t const blank_label_cf
 Replace label by white space.
 
control_flag_t const blank_marker_cf
 Replace marker by white space.
 
control_flag_t const cerr_cf
 Force output to be written to cerr.
 
control_flag_t const flush_cf
 Flush ostream after writing this output.
 
control_flag_t const wait_cf
 If interactive, wait till return is pressed.
 
control_flag_t const error_cf
 Append error string according to errno.
 
unsigned short const max_label_len_c
 The maximum number of characters that are allowed in a debug channel label.
 
int const builtin_return_address_offset
 Offset to __builtin_return_address() needed to get the correct line number from location_ct. More...
 

Detailed Description

namespace for libcwd.

The d in libcwd stands for Debugging. The cw stand for the initials of the designer/developer of this life-span project.

This namespace contains all user accessible classes, functions and variables.
Things defined in this namespace belong to the libcwd API and will be supported through-out version 1.x.

Enumeration Type Documentation

◆ memblk_types_nt

A flag indicating the type of allocation.

This is returned by alloc_ct::memblk_type. The flags memblk_type_marker and memblk_type_deleted_marker only exist when libcwd was configured with –enable-marker (CWDEBUG_MARKER).

See also
alloc_ct
Enumerator
memblk_type_new 

Allocated with operator new

memblk_type_deleted 

Deleted with operator delete

memblk_type_new_array 

Allocated with operator new []

memblk_type_deleted_array 

Deleted with operator delete []

memblk_type_malloc 

Allocated with calloc() or malloc()

memblk_type_realloc 

Reallocated with realloc()

memblk_type_freed 

Freed with free()

memblk_type_external 

Externally allocated with malloc() (no magic numbers!)

memblk_type_posix_memalign 

Allocated with posix_memalign()

memblk_type_aligned_alloc 

Allocated with aligned_alloc()

memblk_type_memalign 

Allocated with memalign()

memblk_type_valloc 

Allocated with valloc()

Function Documentation

◆ operator<<()

std::ostream & libcwd::operator<< ( std::ostream &  os,
memblk_types_nt  memblk_type 
)

Allow writing a memblk_types_nt directly to an ostream.

Writes the name of the memblk_types_nt memblk_type to ostream os.

References memblk_type_aligned_alloc, memblk_type_deleted, memblk_type_deleted_array, memblk_type_external, memblk_type_freed, memblk_type_malloc, memblk_type_memalign, memblk_type_new, memblk_type_new_array, memblk_type_posix_memalign, memblk_type_realloc, and memblk_type_valloc.

◆ read_rcfile()

void libcwd::read_rcfile ( )
inline

Calls libcwd::rcfile.read().

See also
group_rcfile

References libcwd::rcfile_ct::read().

Variable Documentation

◆ builtin_return_address_offset

int const libcwd::builtin_return_address_offset

Offset to __builtin_return_address() needed to get the correct line number from location_ct.

Example
libcwd::location_ct loc((char*)__builtin_return_address(0) + libcwd::builtin_return_address_offset);
int const builtin_return_address_offset
Offset to __builtin_return_address() needed to get the correct line number from location_ct.
Definition: sys.h:39

Referenced by libcwd::debug_ct::set_ostream().

◆ libcw_do

debug_ct libcwd::libcw_do

The default debug object.

The debug object that is used by default by Dout and DoutFatal, the only debug object used by libcwd itself.

See also
Custom Debug Objects
Copyright © 2001 - 2004 Carlo Wood.  All rights reserved.