<s>
Libcwd	B-Library
is	O
a	O
C++	B-Language
library	O
,	O
written	O
by	O
,	O
to	O
add	O
run-time	B-Library
debugging	O
support	O
for	O
C++	B-Language
applications	O
,	O
particularly	O
for	O
code	O
developed	O
with	O
the	O
GNU	B-Application
Compiler	I-Application
Collection	I-Application
.	O
</s>
<s>
Ostream-based	O
debug	O
output	O
.	O
</s>
<s>
Run-time	B-Library
access	O
to	O
debug	O
information	O
.	O
</s>
<s>
Run-time	B-Library
access	O
to	O
memory	B-General_Concept
allocation	I-General_Concept
administration	O
.	O
</s>
<s>
Although	O
the	O
library	O
code	O
itself	O
attempts	O
to	O
be	O
strictly	O
ISO	O
C++	B-Language
,	O
and	O
conform	O
to	O
POSIX	O
as	O
much	O
as	O
possible	O
,	O
in	O
order	O
to	O
achieve	O
points	O
2	O
and	O
3	O
,	O
rather	O
specialized	O
code	O
is	O
needed	O
,	O
specific	O
to	O
the	O
architecture	O
the	O
application	O
runs	O
on	O
.	O
</s>
<s>
Libcwd	B-Library
restricts	O
itself	O
to	O
a	O
narrow	O
architecture	O
for	O
this	O
reason	O
:	O
It	O
has	O
to	O
be	O
compiled	O
with	O
the	O
GNU	B-Application
compiler	I-Application
,	O
and	O
demands	O
the	O
object	O
code	O
to	O
be	O
32	O
or	O
64	O
bits	O
ELF	O
and	O
the	O
compiler	O
generated	O
debug	O
information	O
to	O
be	O
DWARF-2	O
.	O
</s>
<s>
Compiling	O
libcwd	B-Library
results	O
in	O
two	O
libraries	O
:	O
one	O
that	O
is	O
thread-safe	B-Operating_System
(	O
libcwd_r	O
)	O
and	O
a	O
version	O
(	O
libcwd	B-Library
)	O
without	O
thread	O
support	O
.	O
</s>
<s>
The	O
thread-safe	B-Operating_System
version	O
depends	O
on	O
even	O
more	O
architecture	O
specific	O
details	O
(	O
namely	O
,	O
the	O
GNU	B-Application
C	I-Application
library	O
)	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
a	O
full	O
featured	O
libcwd	B-Library
is	O
basically	O
only	O
suitable	O
for	O
development	O
on	O
Linux	B-Application
platforms	O
.	O
</s>
<s>
However	O
,	O
libcwd	B-Library
may	O
be	O
configured	O
to	O
drop	O
thread	O
support	O
,	O
memory	B-General_Concept
allocation	I-General_Concept
debugging	O
and/or	O
reading	O
the	O
ELF	O
and	O
DWARF-2	O
debugging	O
information	O
—	O
until	O
only	O
the	O
ostream	B-Language
debug	O
output	O
support	O
is	O
left	O
.	O
</s>
<s>
This	O
way	O
one	O
can	O
use	O
it	O
to	O
develop	O
an	O
application	O
on	O
linux	B-Application
until	O
it	O
is	O
robust	O
,	O
and	O
still	O
have	O
the	O
debug	O
output	O
on	O
other	O
(	O
POSIX	O
)	O
platforms	O
,	O
even	O
though	O
a	O
full-fledged	O
libcwd	B-Library
is	O
n't	O
available	O
there	O
—	O
provided	O
no	O
thread-safety	B-Operating_System
is	O
needed	O
for	O
the	O
debug	O
output	O
on	O
those	O
platforms	O
:	O
two	O
or	O
more	O
threads	O
writing	O
debug	O
output	O
to	O
the	O
same	O
ostream	B-Language
might	O
cause	O
a	O
rather	O
messy	O
output	O
where	O
the	O
output	O
of	O
one	O
line	O
starts	O
in	O
the	O
middle	O
of	O
another	O
,	O
without	O
thread-support	O
.	O
</s>
<s>
Libcwd	B-Library
provides	O
several	O
macros	O
that	O
are	O
easily	O
extensible	O
,	O
allowing	O
the	O
user	O
to	O
basically	O
do	O
anything	O
that	O
one	O
can	O
normally	O
do	O
with	O
ostreams	B-Language
.	O
</s>
<s>
It	O
is	O
also	O
possible	O
to	O
create	O
more	O
than	O
just	O
the	O
default	O
debug	O
output	O
ostream	B-Language
object	O
'	O
libcw_do	O
 '	O
,	O
and	O
thus	O
to	O
write	O
output	O
to	O
more	O
than	O
one	O
ostream	B-Language
.	O
</s>
<s>
Each	O
debug	O
object	O
,	O
representing	O
an	O
ostream	B-Language
,	O
can	O
in	O
turn	O
be	O
separately	O
turned	O
on	O
and	O
off	O
.	O
</s>
<s>
Libcwd	B-Library
keeps	O
an	O
internal	O
administration	O
of	O
memory	B-General_Concept
allocations	I-General_Concept
.	O
</s>
<s>
This	O
allows	O
one	O
to	O
do	O
things	O
like	O
memory	B-Error_Name
leak	I-Error_Name
checking	O
,	O
printing	O
out	O
an	O
overview	O
of	O
allocated	O
memory	O
(	O
in	O
a	O
very	O
powerful	O
way	O
,	O
allowing	O
one	O
to	O
filter	O
on	O
about	O
anything	O
:	O
regular	O
expressions	O
for	O
library	O
names	O
,	O
function	O
names	O
(	O
demangled	O
or	O
not	O
)	O
and/or	O
time	O
intervals	O
during	O
which	O
allocations	O
were	O
made	O
)	O
.	O
</s>
<s>
The	O
library	O
also	O
provides	O
a	O
few	O
global	O
functions	O
that	O
can	O
be	O
called	O
from	O
within	O
a	O
debugger	O
,	O
like	O
gdb	B-Language
,	O
allowing	O
the	O
developer	O
to	O
quickly	O
find	O
out	O
which	O
allocation	O
a	O
given	O
pointer	O
is	O
pointing	O
at	O
.	O
</s>
