Help & Apropos
2019-04-17 本文已影响0人
低吟浅唱1990
LLDB是新一代高性能调试器,是Xcode的默认调试器,并且支持调试C/C++程序。
LLDB命令繁多,下面开始接少一下常用的命令。
- 打开Mac终端输入lldb 进入lldb调试模式。
(lldb)help
Debugger commands:
apropos -- List debugger commands related to a word or subject.
breakpoint -- Commands for operating on breakpoints (see 'help b' for
shorthand.)
bugreport -- Commands for creating domain-specific bug reports.
command -- Commands for managing custom LLDB commands.
disassemble -- Disassemble specified instructions in the current
target. Defaults to the current function for the
current thread and stack frame.
expression -- Evaluate an expression on the current thread. Displays
any returned value with LLDB's default formatting.
frame -- Commands for selecting and examing the current thread's
stack frames.
gdb-remote -- Connect to a process via remote GDB server. If no host
is specifed, localhost is assumed.
gui -- Switch into the curses based GUI mode.
help -- Show a list of all debugger commands, or give details
about a specific command.
.
.
.
会出现全部的lldb命令,许多命令还有好多子命令。
以breakpoint命令为例:会列出详细的子命令及其解释等
(lldb) help breakpoint
Commands for operating on breakpoints (see 'help b' for shorthand.)
Syntax: breakpoint <subcommand> [<command-options>]
The following subcommands are supported:
clear -- Delete or disable breakpoints matching the specified source
file and line.
command -- Commands for adding, removing and listing LLDB commands
executed when a breakpoint is hit.
delete -- Delete the specified breakpoint(s). If no breakpoints are
specified, delete them all.
disable -- Disable the specified breakpoint(s) without deleting them. If
none are specified, disable all breakpoints.
enable -- Enable the specified disabled breakpoint(s). If no breakpoints
are specified, enable all of them.
list -- List some or all breakpoints at configurable levels of detail.
modify -- Modify the options on a breakpoint or set of breakpoints in
the executable. If no breakpoint is specified, acts on the
last created breakpoint. With the exception of -e, -d and -i,
passing an empty argument clears the modification.
name -- Commands to manage name tags for breakpoints
read -- Read and set the breakpoints previously saved to a file with
"breakpoint write".
set -- Sets a breakpoint or set of breakpoints in the executable.
write -- Write the breakpoints listed to a file that can be read in
with "breakpoint read". If given no arguments, writes all
breakpoints.
For more help on any particular subcommand, type 'help <command> <subcommand>'.
(lldb)
- apropos 命令作用在于搜索 例如
//搜索有关“swift”的命令
(lldb)apropos swift
//相关命令
The following commands may relate to 'swift':
swift -- A set of commands for operating on the Swift Language Runtime.
demangle -- Demangle a Swift mangled name
refcount -- Inspect the reference count data for a Swift object
//相关设置
The following settings variables may relate to 'swift':
target.swift-framework-search-paths -- List of directories to be searched
when locating frameworks for Swift.
target.swift-module-search-paths -- List of directories to be searched when
locating modules for Swift.
target.use-all-compiler-flags -- Try to use compiler flags for all modules
when setting up the Swift expression parser,
not just the main executable.
target.experimental.swift-create-module-contexts-in-parallel -- Create the per-module Swift AST contexts in parallel.