diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-11-20 14:53:37 -0800 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-11-21 10:04:11 -0800 |
| commit | bb775bee21258f93cd5844b3540c0ec2569c1e22 (patch) | |
| tree | f8ceb0e649607db96cfd4e0ca46e3f6fb4a022c4 /lldb/docs/man | |
| parent | f1a9a83232230e1c848a91270ebe0d4089f0a803 (diff) | |
| download | bcm5719-llvm-bb775bee21258f93cd5844b3540c0ec2569c1e22.tar.gz bcm5719-llvm-bb775bee21258f93cd5844b3540c0ec2569c1e22.zip | |
[Docs] Generate the LLDB man page with Sphinx
This patch replaces the existing out-of-date man page for lldb and
replaces it with an RST file from which sphinx generates the actual
troff file. This is similar to how man pages are generated for the rest
of the LLVM utilities.
The man page is generated by building the `docs-lldb-man` target.
Differential revision: https://reviews.llvm.org/D70514
Diffstat (limited to 'lldb/docs/man')
| -rw-r--r-- | lldb/docs/man/lldb.rst | 316 |
1 files changed, 316 insertions, 0 deletions
diff --git a/lldb/docs/man/lldb.rst b/lldb/docs/man/lldb.rst new file mode 100644 index 00000000000..20ad93a8478 --- /dev/null +++ b/lldb/docs/man/lldb.rst @@ -0,0 +1,316 @@ +:orphan: + +lldb -- The Debugger +==================== + +.. program:: lldb + +SYNOPSIS +-------- + +| :program:`lldb` [*options*] *executable* + +DESCRIPTION +----------- + +:program:`lldb` is a fully featured debugger. It is a command line interface to +the LLDB debugger library. + +ATTACHING +--------- + +.. option:: --attach-name <name> + + Tells the debugger to attach to a process with the given name. + +.. option:: --attach-pid <pid> + + Tells the debugger to attach to a process with the given pid. + +.. option:: -n <value> + + Alias for --attach-name + +.. option:: -p <value> + + Alias for --attach-pid + +.. option:: --wait-for + + Tells the debugger to wait for a process with the given pid or name to launch before attaching. + +.. option:: -w + + Alias for --wait-for + +COMMANDS +-------- + +.. option:: --batch + + Tells the debugger to run the commands from -s, -S, -o & -O, and then quit. + +.. option:: -b + + Alias for --batch + +.. option:: -K <value> + + Alias for --source-on-crash + +.. option:: -k <value> + + Alias for --one-line-on-crash + +.. option:: --local-lldbinit + + Allow the debugger to parse the .lldbinit files in the current working directory, unless --no-lldbinit is passed. + +.. option:: --no-lldbinit + + Do not automatically parse any '.lldbinit' files. + +.. option:: --one-line-before-file <command> + + Tells the debugger to execute this one-line lldb command before any file provided on the command line has been loaded. + +.. option:: --one-line-on-crash <command> + + When in batch mode, tells the debugger to run this one-line lldb command if the target crashes. + +.. option:: --one-line <command> + + Tells the debugger to execute this one-line lldb command after any file provided on the command line has been loaded. + +.. option:: -O <value> + + Alias for --one-line-before-file + +.. option:: -o <value> + + Alias for --one-line + +.. option:: -Q + + Alias for --source-quietly + +.. option:: --source-before-file <file> + + Tells the debugger to read in and execute the lldb commands in the given file, before any file has been loaded. + +.. option:: --source-on-crash <file> + + When in batch mode, tells the debugger to source this file of lldb commands if the target crashes. + +.. option:: --source-quietly + + Tells the debugger to execute this one-line lldb command before any file has been loaded. + +.. option:: --source <file> + + Tells the debugger to read in and execute the lldb commands in the given file, after any file has been loaded. + +.. option:: -S <value> + + Alias for --source-before-file + +.. option:: -s <value> + + Alias for --source + +.. option:: -x + + Alias for --no-lldbinit + +OPTIONS +------- + +.. option:: --arch <architecture> + + Tells the debugger to use the specified architecture when starting and running the program. + +.. option:: -a <value> + + Alias for --arch + +.. option:: --capture-path <filename> + + Tells the debugger to use the given filename for the reproducer. + +.. option:: --capture + + Tells the debugger to capture a reproducer. + +.. option:: --core <filename> + + Tells the debugger to use the full path to <filename> as the core file. + +.. option:: -c <value> + + Alias for --core + +.. option:: --debug + + Tells the debugger to print out extra information for debugging itself. + +.. option:: -d + + Alias for --debug + +.. option:: --editor + + Tells the debugger to open source files using the host's "external editor" mechanism. + +.. option:: -e + + Alias for --editor + +.. option:: --file <filename> + + Tells the debugger to use the file <filename> as the program to be debugged. + +.. option:: -f <value> + + Alias for --file + +.. option:: --help + + Prints out the usage information for the LLDB debugger. + +.. option:: -h + + Alias for --help + +.. option:: --no-use-colors + + Do not use colors. + +.. option:: --replay <filename> + + Tells the debugger to replay a reproducer from <filename>. + +.. option:: --version + + Prints out the current version number of the LLDB debugger. + +.. option:: -v + + Alias for --version + +.. option:: -X + + Alias for --no-use-color + +REPL +---- + +.. option:: -r=<flags> + + Alias for --repl=<flags> + +.. option:: --repl-language <language> + + Chooses the language for the REPL. + +.. option:: --repl=<flags> + + Runs lldb in REPL mode with a stub process with the given flags. + +.. option:: -R <value> + + Alias for --repl-language + +SCRIPTING +--------- + +.. option:: -l <value> + + Alias for --script-language + +.. option:: --python-path + + Prints out the path to the lldb.py file for this version of lldb. + +.. option:: -P + + Alias for --python-path + +.. option:: --script-language <language> + + Tells the debugger to use the specified scripting language for user-defined scripts. + +EXAMPLES +-------- + +The debugger can be started in several modes. + +Passing an executable as a positional argument prepares :program:`lldb` to +debug the given executable. Arguments passed after -- are considered arguments +to the debugged executable. + + lldb --arch x86_64 /path/to/program -- --arch arvm7 + +Passing one of the attach options causes :program:`lldb` to immediately attach +to the given process. + + lldb -p <pid> + lldb -n <process-name> + +Passing --repl starts :program:`lldb` in REPL mode. + + lldb -r + +Passing --core causes :program:`lldb` to debug the core file. + + lldb -c /path/to/core + +Command options can be combined with these modes and cause :program:`lldb` to +run the specified commands before or after events, like loading the file or +crashing, in the order provided on the command line. + + lldb -O 'settings set stop-disassembly-count 20' -o 'run' -o 'bt' + lldb -S /source/before/file -s /source/after/file + lldb -K /source/before/crash -k /source/after/crash + +Note: In REPL mode no file is loaded, so commands specified to run after +loading the file (via -o or -s) will be ignored. + +USING LLDB +---------- + +In :program:`lldb` there is a help command which can be used to find +descriptions and examples of all :program:`lldb` commands. To get help on +"breakpoint set" you would type "help breakpoint set". + +There is also an apropos command which will search the help text of all +commands for a given term ‐‐ this is useful for locating a command by topic. +For instance, "apropos breakpoint" will list any command that has the word +"breakpoint" in its help text. + +CONFIGURATION FILES +------------------- + +:program:`lldb` reads things like settings, aliases and commands from the +.lldbinit file. It will first look for ~/.lldbinit and load that first. +Secondly, it will look for an .lldbinit file in the current working directory. +For security reasons, :program:`lldb` will print a warning and not source this +file by default. This behavior can be changed by changing the +target.load-cwd-lldbinit setting. + +To always load the .lldbinit file in the current working directory, add the +following command to ~/.lldbinit: + + settings set target.load-cwd-lldbinit true + +To never load the .lldbinit file in the current working directory and silence +the warning, add the following command to ~/.lldbinit: + + settings set target.load-cwd-lldbinit false + +SEE ALSO +-------- + +The LLDB project page https://lldb.llvm.org has many different resources +for :program:`lldb` users ‐‐ the gdb/lldb command equivalence page +https://lldb.llvm.org/use/map.html can be especially helpful for users +coming from gdb. |

