Skip to content

Commit e19f722

Browse files
[lldb][Docs] Use proper LLDB/GDB project branding in tutorial (#90712)
Except when referring to the program binaries.
1 parent 1609632 commit e19f722

File tree

1 file changed

+58
-58
lines changed

1 file changed

+58
-58
lines changed

lldb/docs/use/tutorial.rst

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Tutorial
22
========
33

4-
This document describes how to use lldb if you are already familiar with
5-
gdb's command set. We will start with some details on lldb command structure and
4+
This document describes how to use LLDB if you are already familiar with
5+
GDB's command set. We will start with some details on LLDB command structure and
66
syntax.
77

88
Command Structure
99
-----------------
1010

11-
Unlike gdb's quite free-form commands, lldb's are more structured. All commands
11+
Unlike GDB's quite free-form commands, LLDB's are more structured. All commands
1212
are of the form:
1313

1414
::
@@ -24,11 +24,11 @@ all commands. The command syntax for basic commands is very simple.
2424
* Escape backslashes and double quotes within arguments should be escaped
2525
with a backslash ``\``.
2626

27-
This makes lldb's commands more regular, but it also means you may have to quote
28-
some arguments in lldb that you would not in gdb.
27+
This makes LLDB's commands more regular, but it also means you may have to quote
28+
some arguments in LLDB that you would not in GDB.
2929

30-
There is one other special quote character in lldb - the backtick `````.
31-
If you put backticks around an argument or option value, lldb will run the text
30+
There is one other special quote character in LLDB - the backtick `````.
31+
If you put backticks around an argument or option value, LLDB will run the text
3232
of the value through the expression parser, and the result of the expression
3333
will be passed to the command. So for instance, if ``len`` is a local
3434
``int`` variable with the value ``5``, then the command:
@@ -40,7 +40,7 @@ will be passed to the command. So for instance, if ``len`` is a local
4040
Will receive the value ``5`` for the count option, rather than the string ``len``.
4141

4242
Options can be placed anywhere on the command line, but if the arguments begin
43-
with a ``-`` then you have to tell lldb that you are done with options for the
43+
with a ``-`` then you have to tell LLDB that you are done with options for the
4444
current command by adding an option termination: ``--``.
4545

4646
So for instance, if you want to launch a process and give the ``process launch``
@@ -53,7 +53,7 @@ to launch to be launched with the arguments ``-program_arg value``, you would ty
5353

5454
We also tried to reduce the number of special purpose argument parsers, which
5555
sometimes forces the user to be explicit about their intentions. The first
56-
instance you willl see of this is the breakpoint command. In gdb, to set a
56+
instance you willl see of this is the breakpoint command. In GDB, to set a
5757
breakpoint, you might enter:
5858

5959
::
@@ -71,17 +71,17 @@ from ``foo`` from ``foo.c::foo`` (which means the function ``foo`` in the file `
7171
got more and more complex. Especially in C++ there are times where there is
7272
really no way to specify the function you want to break on.
7373

74-
The lldb commands are more verbose but also more precise and allow for
74+
The LLDB commands are more verbose but also more precise and allow for
7575
intelligent auto completion.
7676

77-
To set the same file and line breakpoint in lldb you can enter either of:
77+
To set the same file and line breakpoint in LLDB you can enter either of:
7878

7979
::
8080

8181
(lldb) breakpoint set --file foo.c --line 12
8282
(lldb) breakpoint set -f foo.c -l 12
8383

84-
To set a breakpoint on a function named ``foo`` in lldb you can enter either of:
84+
To set a breakpoint on a function named ``foo`` in LLDB you can enter either of:
8585

8686
::
8787

@@ -96,7 +96,7 @@ conditions or commands without having to specify them multiple times:
9696

9797
(lldb) breakpoint set --name foo --name bar
9898

99-
Setting breakpoints by name is even more specialized in lldb as you can specify
99+
Setting breakpoints by name is even more specialized in LLDB as you can specify
100100
that you want to set a breakpoint at a function by method name. To set a
101101
breakpoint on all C++ methods named ``foo`` you can enter either of:
102102

@@ -125,7 +125,7 @@ The ``--shlib`` option can also be repeated to specify several shared libraries.
125125

126126
Suggestions on more interesting primitives of this sort are also very welcome.
127127

128-
Just like gdb, the lldb command interpreter does a shortest unique string match
128+
Just like GDB, the LLDB command interpreter does a shortest unique string match
129129
on command names, so the following two commands will both execute the same
130130
command:
131131

@@ -134,12 +134,12 @@ command:
134134
(lldb) breakpoint set -n "-[SKTGraphicView alignLeftEdges:]"
135135
(lldb) br s -n "-[SKTGraphicView alignLeftEdges:]"
136136

137-
lldb also supports command completion for source file names, symbol names, file
137+
LLDB also supports command completion for source file names, symbol names, file
138138
names, etc. Completion is initiated by hitting TAB. Individual options in a
139139
command can have different completers, so for instance, the ``--file <path>``
140140
option in ``breakpoint`` completes to source files, the ``--shlib <path>`` option
141141
to currently loaded shared libraries, etc. You can even do things like if you
142-
specify ``--shlib <path>``, and are completing on ``--file <path>``, lldb will only
142+
specify ``--shlib <path>``, and are completing on ``--file <path>``, LLDB will only
143143
list source files in the shared library specified by ``--shlib <path>``.
144144

145145
The individual commands are pretty extensively documented. You can use the ``help``
@@ -162,23 +162,23 @@ You can do:
162162
(lldb) command alias bfl breakpoint set -f %1 -l %2
163163
(lldb) bfl foo.c 12
164164

165-
lldb has a few aliases for commonly used commands (e.g. ``step``, ``next`` and
165+
LLDB has a few aliases for commonly used commands (e.g. ``step``, ``next`` and
166166
``continue``) but it does not try to be exhaustive because in our experience it
167167
is more convenient to make the basic commands unique down to a letter or two,
168168
and then learn these sequences than to fill the namespace with lots of aliases,
169169
and then have to type them all the way out.
170170

171-
However, users are free to customize lldb's command set however they like, and
172-
since lldb reads the file ``~/.lldbinit`` at startup, you can store all your
171+
However, users are free to customize LLDB's command set however they like, and
172+
since LLDB reads the file ``~/.lldbinit`` at startup, you can store all your
173173
aliases there and they will be generally available to you. Your aliases are
174174
also documented in the ``help`` command so you can remind yourself of what you have
175175
set up.
176176

177-
One alias of note that lldb does include by popular demand is a weak emulator of
178-
gdb's ``break`` command. It does not try to do everything that gdb's break command
177+
One alias of note that LLDB does include by popular demand is a weak emulator of
178+
GDB's ``break`` command. It does not try to do everything that GDB's break command
179179
does (for instance, it does not handle ``foo.c::bar``). But it mostly works, and
180180
makes the transition easier. Also, by popular demand, it is aliased to ``b``. If you
181-
actually want to learn the lldb command set natively, that means it will get in
181+
actually want to learn the LLDB command set natively, that means it will get in
182182
the way of the rest of the breakpoint commands. Fortunately, if you do not like
183183
one of our aliases, you can easily get rid of it by running, for example:
184184

@@ -192,9 +192,9 @@ You can also do:
192192

193193
(lldb) command alias b breakpoint
194194

195-
So you can run the native lldb breakpoint command with just ``b``.
195+
So you can run the native LLDB breakpoint command with just ``b``.
196196

197-
The lldb command parser also supports "raw" commands, where, after command
197+
The LLDB command parser also supports "raw" commands, where, after command
198198
options are stripped off, the rest of the command string is passed
199199
uninterpreted to the command. This is convenient for commands whose arguments
200200
might be some complex expression that would be painful to backslash protect.
@@ -205,17 +205,17 @@ commands still can have options, if your command string has dashes in it,
205205
you will have to indicate these are not option markers by putting ``--`` after the
206206
command name, but before your command string.
207207

208-
lldb also has a built-in Python interpreter, which is accessible by the
208+
LLDB also has a built-in Python interpreter, which is accessible by the
209209
``"script`` command. All the functionality of the debugger is available as classes
210-
in the Python interpreter, so the more complex commands that in gdb you would
210+
in the Python interpreter, so the more complex commands that in GDB you would
211211
introduce with the ``define`` command can be done by writing Python functions
212-
using the lldb-Python library, then loading the scripts into your running
212+
using the LLDB Python library, then loading the scripts into your running
213213
session and accessing them with the ``script`` command.
214214

215-
Loading a Program Into lldb
215+
Loading a Program Into LLDB
216216
---------------------------
217217

218-
First you need to set the program to debug. As with gdb, you can start lldb and
218+
First you need to set the program to debug. As with GDB, you can start LLDB and
219219
specify the file you wish to debug on the command line:
220220

221221
::
@@ -273,16 +273,16 @@ address it corresponds to gets loaded into the program you are debugging. For
273273
instance if you set a breakpoint in a shared library that then gets unloaded,
274274
that breakpoint location will remain, but it will no longer be resolved.
275275

276-
One other thing to note for gdb users is that lldb acts like gdb with:
276+
One other thing to note for GDB users is that LLDB acts like GDB with:
277277

278278
::
279279

280280
(gdb) set breakpoint pending on
281281

282-
Which means that lldb will always make a breakpoint from your specification, even if it
282+
Which means that LLDB will always make a breakpoint from your specification, even if it
283283
could not find any locations that match the specification. You can tell whether
284284
the expression was resolved or not by checking the locations field in
285-
``breakpoint list``, and lldb reports the breakpoint as ``pending`` when you set it so
285+
``breakpoint list``, and LLDB reports the breakpoint as ``pending`` when you set it so
286286
you can tell you have made a typo more easily, if that was indeed the reason no
287287
locations were found:
288288

@@ -304,12 +304,12 @@ command to print a backtrace when you hit this breakpoint you could do:
304304
> bt
305305
> DONE
306306

307-
By default, the breakpoint command add command takes lldb command line
307+
By default, the breakpoint command add command takes LLDB command line
308308
commands. You can also specify this explicitly by passing the ``--command``
309309
option. Use ``--script`` if you want to implement your breakpoint command using
310310
the Python script instead.
311311

312-
This is a convenient point to bring up another feature of the lldb command
312+
This is a convenient point to bring up another feature of the LLDB command
313313
``help``. Do:
314314

315315
::
@@ -447,7 +447,7 @@ a variable called ``global`` for write operation, but only stop if the condition
447447
Starting or Attaching to Your Program
448448
-------------------------------------
449449

450-
To launch a program in lldb you will use the ``process launch`` command or one of
450+
To launch a program in LLDB you will use the ``process launch`` command or one of
451451
its built in aliases:
452452

453453
::
@@ -457,7 +457,7 @@ its built in aliases:
457457
(lldb) r
458458

459459
You can also attach to a process by process ID or process name. When attaching
460-
to a process by name, lldb also supports the ``--waitfor`` option which waits for
460+
to a process by name, LLDB also supports the ``--waitfor`` option which waits for
461461
the next process that has that name to show up, and attaches to it
462462

463463
::
@@ -497,49 +497,49 @@ for process control all exist under the "thread" command:
497497

498498
At present you can only operate on one thread at a time, but the design will
499499
ultimately support saying "step over the function in Thread 1, and step into the
500-
function in Thread 2, and continue Thread 3" etc. When lldb eventually supports
500+
function in Thread 2, and continue Thread 3" etc. When LLDB eventually supports
501501
keeping some threads running while others are stopped this will be particularly
502502
important. For convenience, however, all the stepping commands have easy aliases.
503503
So ``thread continue`` is just ``c``, etc.
504504

505-
The other program stepping commands are pretty much the same as in gdb. You have got:
505+
The other program stepping commands are pretty much the same as in GDB. You have got:
506506

507507
::
508508

509-
(lldb) thread step-in // The same as gdb's "step" or "s"
510-
(lldb) thread step-over // The same as gdb's "next" or "n"
511-
(lldb) thread step-out // The same as gdb's "finish" or "f"
509+
(lldb) thread step-in // The same as GDB's "step" or "s"
510+
(lldb) thread step-over // The same as GDB's "next" or "n"
511+
(lldb) thread step-out // The same as GDB's "finish" or "f"
512512

513-
By default, lldb does defined aliases to all common gdb process control commands
514-
(``s``, ``step``, ``n``, ``next``, ``finish``). If lldb is missing any, please add
513+
By default, LLDB does defined aliases to all common GDB process control commands
514+
(``s``, ``step``, ``n``, ``next``, ``finish``). If LLDB is missing any, please add
515515
them to your ``~/.lldbinit`` file using the ``command alias`` command.
516516

517-
lldb also supports the step by instruction versions:
517+
LLDB also supports the step by instruction versions:
518518

519519
::
520520

521521

522-
(lldb) thread step-inst // The same as gdb's "stepi" / "si"
523-
(lldb) thread step-over-inst // The same as gdb's "nexti" / "ni"
522+
(lldb) thread step-inst // The same as GDB's "stepi" / "si"
523+
(lldb) thread step-over-inst // The same as GDB's "nexti" / "ni"
524524

525-
Finally, lldb has a run until line or frame exit stepping mode:
525+
Finally, LLDB has a run until line or frame exit stepping mode:
526526

527527
::
528528

529529
(lldb) thread until 100
530530

531531
This command will run the thread in the current frame until it reaches line 100
532532
in this frame or stops if it leaves the current frame. This is a pretty close
533-
equivalent to gdb's ``until`` command.
533+
equivalent to GDB's ``until`` command.
534534

535-
A process, by default, will share the lldb terminal with the inferior process.
536-
When in this mode, much like when debugging with gdb, when the process is
535+
A process, by default, will share the LLDB terminal with the inferior process.
536+
When in this mode, much like when debugging with GDB, when the process is
537537
running anything you type will go to the ``STDIN`` of the inferior process. To
538538
interrupt your inferior program, type ``CTRL+C``.
539539

540540
If you attach to a process, or launch a process with the ``--no-stdin`` option,
541541
the command interpreter is always available to enter commands. It might be a
542-
little disconcerting to gdb users to always have an ``(lldb)`` prompt. This allows
542+
little disconcerting to GDB users to always have an ``(lldb)`` prompt. This allows
543543
you to set a breakpoint, or use any other command without having to explicitly
544544
interrupt the program you are debugging:
545545

@@ -563,16 +563,16 @@ and memory reading and writing (``memory [read|write] ...``).
563563
The question of disabling stdio when running brings up a good opportunity to
564564
show how to set debugger properties. If you always want to run in
565565
the ``--no-stdin`` mode, you can set this as a generic process property using the
566-
lldb ``settings`` command, which is equivalent to gdb's ``set`` command.
566+
LLDB ``settings`` command, which is equivalent to GDB's ``set`` command.
567567
In this case you would say:
568568

569569
::
570570

571571
(lldb) settings set target.process.disable-stdio true
572572

573-
Over time, gdb's ``set`` command became a wilderness of disordered options, so
574-
that there were useful options that even experienced gdb users did not know
575-
about because they were too hard to find. lldb instead organizes the settings
573+
Over time, GDB's ``set`` command became a wilderness of disordered options, so
574+
that there were useful options that even experienced GDB users did not know
575+
about because they were too hard to find. LLDB instead organizes the settings
576576
hierarchically using the structure of the basic entities in the debugger. For
577577
the most part anywhere you can specify a setting on a generic entity (threads,
578578
for example) you can also apply the option to a particular instance. You can
@@ -582,7 +582,7 @@ on the settings command explaining how it works more generally.
582582
Examining Thread State
583583
----------------------
584584

585-
Once you have stopped, lldb will choose a current thread, usually the one that
585+
Once you have stopped, LLDB will choose a current thread, usually the one that
586586
stopped "for a reason", and a current frame in that thread (on stop this is
587587
always the bottom-most frame). Many the commands for inspecting state work on
588588
this current thread/frame.
@@ -685,7 +685,7 @@ pointers as arrays:
685685
(char const *) argv[0] = 0x00007fff5fbffaf8 "/Projects/Sketch/build/Debug/Sketch.app/Contents/MacOS/Sketch"
686686

687687
The frame variable command will also perform "object printing" operations on
688-
variables (currently lldb only supports ObjC printing, using the object's
688+
variables (currently LLDB only supports ObjC printing, using the object's
689689
``description`` method. Turn this on by passing the ``-o`` flag to frame variable:
690690

691691
::
@@ -697,4 +697,4 @@ variables (currently lldb only supports ObjC printing, using the object's
697697
frame #9: 0x0000000100015ae3, where = Sketch`function1 + 33 at /Projects/Sketch/SKTFunctions.m:11
698698

699699
You can also move up and down the stack by passing the ``--relative`` (``-r``) option.
700-
We also have built-in aliases ``u`` and ``d`` which behave like their gdb equivalents.
700+
We also have built-in aliases ``u`` and ``d`` which behave like their GDB equivalents.

0 commit comments

Comments
 (0)