<s>
The	O
LLDB	B-Language
Debugger	B-Application
(	O
LLDB	B-Language
)	O
is	O
the	O
debugger	B-Application
component	O
of	O
the	O
LLVM	B-Application
project	O
.	O
</s>
<s>
It	O
is	O
built	O
as	O
a	O
set	O
of	O
reusable	O
components	O
which	O
extensively	O
use	O
existing	O
libraries	O
from	O
LLVM	B-Application
,	O
such	O
as	O
the	O
Clang	B-Application
expression	O
parser	O
and	O
LLVM	B-Application
disassembler	O
.	O
</s>
<s>
LLDB	B-Language
is	O
free	B-License
and	I-License
open-source	I-License
software	I-License
under	O
the	O
University	B-License
of	I-License
Illinois/NCSA	I-License
Open	I-License
Source	I-License
License	I-License
,	O
a	O
BSD-style	B-Operating_System
permissive	B-License
software	I-License
license	I-License
.	O
</s>
<s>
Since	O
v9.0.0	O
,	O
it	O
was	O
relicensed	O
to	O
the	O
Apache	B-Application
License	I-Application
2.0	I-Application
with	O
LLVM	B-Application
Exceptions	O
.	O
</s>
<s>
LLDB	B-Language
supports	O
debugging	O
of	O
programs	O
written	O
in	O
C	B-Language
,	O
Objective-C	B-Language
,	O
and	O
C++	B-Language
.	O
</s>
<s>
The	O
Swift	B-Application
community	O
maintains	O
a	O
version	O
which	O
adds	O
support	O
for	O
the	O
language	O
.	O
</s>
<s>
It	O
is	O
known	O
to	O
work	O
on	O
macOS	B-Application
,	O
Linux	B-Application
,	O
FreeBSD	B-Operating_System
,	O
NetBSD	B-Device
and	O
Windows	O
,	O
and	O
supports	O
i386	B-Device
,	O
x86-64	B-Device
,	O
and	O
ARM	B-Architecture
instruction	I-Architecture
sets	I-Architecture
.	O
</s>
<s>
LLDB	B-Language
is	O
the	O
default	O
debugger	B-Application
for	O
Xcode	B-Operating_System
5	O
and	O
later	O
.	O
</s>
<s>
Android	B-Application
Studio	I-Application
also	O
uses	O
LLDB	B-Language
for	O
debug	O
.	O
</s>
<s>
LLDB	B-Language
can	O
be	O
used	O
from	O
other	O
IDEs	O
,	O
including	O
Visual	B-Language
Studio	I-Language
Code	I-Language
,	O
C++Builder	B-Language
,	O
Eclipse	B-Application
,	O
and	O
CLion	O
.	O
</s>
<s>
+	O
Features	O
matrix	O
Feature	O
FreeBSD	B-Operating_System
Linux	B-Application
macOS	B-Application
NetBSD	B-Device
Windows	O
Backtracing	O
Breakpoints	O
C++11	B-Language
Command-line	B-Application
lldb	B-Language
tool	O
Core	O
file	O
debugging	O
Debugserver	O
(	O
remote	O
debugging	O
)	O
Disassembly	O
Expression	O
evaluation	O
JIT	O
debugging	O
Objective-C	B-Language
2.0	O
:	O
</s>
<s>
Consider	O
the	O
following	O
incorrect	O
program	O
written	O
in	O
C	B-Language
:	O
</s>
<s>
Using	O
the	O
clang	B-Application
compiler	B-Language
on	O
macOS	B-Application
,	O
the	O
code	O
above	O
can	O
be	O
compiled	B-Language
using	O
the	O
-g	O
flag	O
to	O
include	O
appropriate	O
debug	O
information	O
on	O
the	O
binary	O
generated	O
—	O
including	O
the	O
source	O
code	O
—	O
making	O
it	O
easier	O
to	O
inspect	O
it	O
using	O
LLDB	B-Language
.	O
</s>
<s>
Assuming	O
that	O
the	O
file	O
containing	O
the	O
code	O
above	O
is	O
named	O
test.c	O
,	O
the	O
command	O
for	O
the	O
compilation	B-Language
could	O
be	O
:	O
</s>
<s>
Since	O
the	O
example	O
code	O
,	O
when	O
executed	O
,	O
generates	O
a	O
segmentation	B-Error_Name
fault	I-Error_Name
,	O
lldb	B-Language
can	O
be	O
used	O
to	O
inspect	O
the	O
problem	O
:	O
</s>
<s>
The	O
problem	O
occurs	O
when	O
calling	O
the	O
function	O
strlen	O
,	O
but	O
we	O
can	O
run	O
a	O
backtrace	B-Language
to	O
identify	O
the	O
exact	O
line	O
of	O
code	O
that	O
is	O
causing	O
the	O
problem	O
:	O
</s>
<s>
From	O
the	O
line	O
beginning	O
with	O
frame	O
#5	O
,	O
LLDB	B-Language
indicates	O
that	O
the	O
error	O
is	O
at	O
line	O
5	O
of	O
test.c.	O
</s>
<s>
According	O
to	O
the	O
exception	O
code	O
EXC_BAD_ACCESS	O
from	O
the	O
backtrace	B-Language
,	O
strlen	O
is	O
trying	O
to	O
read	O
from	O
a	O
region	O
of	O
memory	O
it	O
does	O
not	O
have	O
access	O
to	O
by	O
dereferencing	O
an	O
invalid	O
pointer	O
.	O
</s>
<s>
After	O
recompiling	O
and	O
running	O
the	O
executable	O
again	O
,	O
LLDB	B-Language
now	O
gives	O
the	O
correct	O
result	O
:	O
</s>
<s>
LLDB	B-Language
runs	O
the	O
program	O
,	O
which	O
prints	O
the	O
output	O
of	O
printf	O
to	O
the	O
screen	O
.	O
</s>
<s>
After	O
the	O
program	O
exits	O
normally	O
,	O
LLDB	B-Language
indicates	O
that	O
the	O
process	O
running	O
the	O
program	O
has	O
completed	O
,	O
and	O
prints	O
its	O
exit	O
status	O
.	O
</s>
