Skip to content

Instantly share code, notes, and snippets.

@rsc
Created October 25, 2016 13:34
Show Gist options
  • Save rsc/221b4231cdbdc55f40e067426b42a8d5 to your computer and use it in GitHub Desktop.
Save rsc/221b4231cdbdc55f40e067426b42a8d5 to your computer and use it in GitHub Desktop.
(lldb) b
Current breakpoints:
1: name = 'asdf', locations = 0 (pending)
2: name = 'Test1635', locations = 0 (pending)
3: name = '/Users/rsc/go/misc/cgo/test.Test1635', locations = 0 (pending)
4: address = test.test[0x000000000412dbc0], locations = 1, resolved = 1, hit count = 1
4.1: where = test.test`/Users/rsc/go/misc/cgo/test.Test1635, address = 0x000000000412dbc0, resolved, hit count = 1
5: address = test.test[0x000000000405cf10], locations = 1, resolved = 1, hit count = 5
5.1: where = test.test`runtime.raceread, address = 0x000000000405cf10, resolved, hit count = 5
(lldb) d 5
error: "disassemble" arguments are specified as options.
Command Options Usage:
disassemble [-bmr] -s <address-expression> [-C <num-lines>] [-P <plugin>] [-F <disassembly-flavor>] [-A <arch>] [-e <address-expression>]
disassemble [-bmr] -s <address-expression> [-C <num-lines>] [-P <plugin>] [-F <disassembly-flavor>] [-A <arch>] [-c <num-lines>]
disassemble [-bmr] [-C <num-lines>] [-P <plugin>] [-F <disassembly-flavor>] [-A <arch>] [-c <num-lines>] [-n <function-name>]
disassemble [-bfmr] [-C <num-lines>] [-P <plugin>] [-F <disassembly-flavor>] [-A <arch>] [-c <num-lines>]
disassemble [-bmpr] [-C <num-lines>] [-P <plugin>] [-F <disassembly-flavor>] [-A <arch>] [-c <num-lines>]
disassemble [-blmr] [-C <num-lines>] [-P <plugin>] [-F <disassembly-flavor>] [-A <arch>]
disassemble [-bmr] [-C <num-lines>] [-P <plugin>] [-F <disassembly-flavor>] [-A <arch>] [-a <address-expression>]
-A <arch> ( --arch <arch> )
Specify the architecture to use from cross disassembly.
-C <num-lines> ( --context <num-lines> )
Number of context lines of source to show.
-F <disassembly-flavor> ( --flavor <disassembly-flavor> )
Name of the disassembly flavor you want to use. Currently the only
valid options are default, and for Intel architectures, att and
intel.
-P <plugin> ( --plugin <plugin> )
Name of the disassembler plugin you want to use.
-a <address-expression> ( --address <address-expression> )
Disassemble function containing this address.
-b ( --bytes )
Show opcode bytes when disassembling.
-c <num-lines> ( --count <num-lines> )
Number of instructions to display.
-e <address-expression> ( --end-address <address-expression> )
Address at which to end disassembling.
-f ( --frame )
Disassemble from the start of the current frame's function.
-l ( --line )
Disassemble the current frame's current source line instructions if
there is debug line table information, else disassemble around the
pc.
-m ( --mixed )
Enable mixed source and assembly display.
-n <function-name> ( --name <function-name> )
Disassemble entire contents of the given function name.
-p ( --pc )
Disassemble around the current pc.
-r ( --raw )
Print raw disassembly with no symbol information.
-s <address-expression> ( --start-address <address-expression> )
Address at which to start disassembling.
(lldb) b
Current breakpoints:
1: name = 'asdf', locations = 0 (pending)
2: name = 'Test1635', locations = 0 (pending)
3: name = '/Users/rsc/go/misc/cgo/test.Test1635', locations = 0 (pending)
4: address = test.test[0x000000000412dbc0], locations = 1, resolved = 1, hit count = 1
4.1: where = test.test`/Users/rsc/go/misc/cgo/test.Test1635, address = 0x000000000412dbc0, resolved, hit count = 1
5: address = test.test[0x000000000405cf10], locations = 1, resolved = 1, hit count = 5
5.1: where = test.test`runtime.raceread, address = 0x000000000405cf10, resolved, hit count = 5
(lldb) b --help
lldb: unrecognized option `--help'
error: unknown or ambiguous option
(lldb) b d 5
Breakpoint 6: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
(lldb) b 5
error: Cannot use the selected frame to find the default file, it has no debug info.
error: No file supplied and no default file available.
(lldb) clear
error: 'clear' is not a valid command.
error: Unrecognized command 'clear'.
(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.
kdp-remote -- Connect to a process via remote KDP server. If no UDP
port is specified, port 41139 is assumed.
language -- Commands specific to a source language.
log -- Commands controlling LLDB internal logging.
memory -- Commands for operating on memory in the current target
process.
platform -- Commands to manage and create platforms.
plugin -- Commands for managing LLDB plugins.
process -- Commands for interacting with processes on the current
platform.
quit -- Quit the LLDB debugger.
register -- Commands to access registers for the current thread and
stack frame.
script -- Invoke the script interpreter with provided code and
display any results. Start the interactive interpreter
if no code is supplied.
settings -- Commands for managing LLDB settings.
source -- Commands for examining source code described by debug
information for the current target process.
target -- Commands for operating on debugger targets.
thread -- Commands for operating on one or more threads in the
current process.
type -- Commands for operating on the type system.
version -- Show the LLDB debugger version.
watchpoint -- Commands for operating on watchpoints.
Current command abbreviations (type 'help command alias' for more info):
add-dsym -- ('target symbols add') Add a debug symbol file to one of the
target's current modules by specifying a path to a debug symbols
file, or using the options to specify a module to download
symbols for.
attach -- ('_regexp-attach') Attach to process by ID or name.
b -- ('_regexp-break') Set a breakpoint using one of several
shorthand formats.
bt -- ('_regexp-bt') Show the current thread's call stack. Any
numeric argument displays at most that many frames. The
argument 'all' displays all threads.
c -- ('process continue') Continue execution of all threads in the
current process.
call -- ('expression --') Evaluate an expression on the current thread.
Displays any returned value with LLDB's default formatting.
continue -- ('process continue') Continue execution of all threads in the
current process.
detach -- ('process detach') Detach from the current target process.
di -- ('disassemble') Disassemble specified instructions in the
current target. Defaults to the current function for the
current thread and stack frame.
dis -- ('disassemble') Disassemble specified instructions in the
current target. Defaults to the current function for the
current thread and stack frame.
display -- ('_regexp-display') Evaluate an expression at every stop (see
'help target stop-hook'.)
down -- ('_regexp-down') Select a newer stack frame. Defaults to
moving one frame, a numeric argument can specify an arbitrary
number.
env -- ('_regexp-env') Shorthand for viewing and setting environment
variables.
exit -- ('quit') Quit the LLDB debugger.
f -- ('frame select') Select the current stack frame by index from
within the current thread (see 'thread backtrace'.)
file -- ('target create') Create a target using the argument as the
main executable.
finish -- ('thread step-out') Finish executing the current stack frame
and stop after returning. Defaults to current thread unless
specified.
image -- ('target modules') Commands for accessing information for one
or more target modules.
j -- ('_regexp-jump') Set the program counter to a new address.
jump -- ('_regexp-jump') Set the program counter to a new address.
kill -- ('process kill') Terminate the current target process.
l -- ('_regexp-list') List relevant source code using one of several
shorthand formats.
list -- ('_regexp-list') List relevant source code using one of several
shorthand formats.
n -- ('thread step-over') Source level single step, stepping over
calls. Defaults to current thread unless specified.
next -- ('thread step-over') Source level single step, stepping over
calls. Defaults to current thread unless specified.
nexti -- ('thread step-inst-over') Instruction level single step,
stepping over calls. Defaults to current thread unless
specified.
ni -- ('thread step-inst-over') Instruction level single step,
stepping over calls. Defaults to current thread unless
specified.
p -- ('expression --') Evaluate an expression on the current thread.
Displays any returned value with LLDB's default formatting.
parray -- ('expression -Z %1 --') Evaluate an expression on the current
thread. Displays any returned value with LLDB's default
formatting.
po -- Evaluate an expression on the current thread. Displays any
returned value with formatting controlled by the type's author.
poarray -- ('expression -O -Z %1 --') Evaluate an expression on the
current thread. Displays any returned value with LLDB's default
formatting.
print -- ('expression --') Evaluate an expression on the current thread.
Displays any returned value with LLDB's default formatting.
q -- ('quit') Quit the LLDB debugger.
r -- ('process launch -X true --') Launch the executable in the
debugger.
rbreak -- ('breakpoint set -r %1') Sets a breakpoint or set of
breakpoints in the executable.
repl -- ('expression -r -- ') Evaluate an expression on the current
thread. Displays any returned value with LLDB's default
formatting.
run -- ('process launch -X true --') Launch the executable in the
debugger.
s -- ('thread step-in') Source level single step, stepping into
calls. Defaults to current thread unless specified.
si -- ('thread step-inst') Instruction level single step, stepping
into calls. Defaults to current thread unless specified.
sif -- Step through the current block, stopping if you step directly
into a function whose name matches the TargetFunctionName.
step -- ('thread step-in') Source level single step, stepping into
calls. Defaults to current thread unless specified.
stepi -- ('thread step-inst') Instruction level single step, stepping
into calls. Defaults to current thread unless specified.
t -- ('thread select') Change the currently selected thread.
tbreak -- ('_regexp-tbreak') Set a one-shot breakpoint using one of
several shorthand formats.
undisplay -- ('_regexp-undisplay') Stop displaying expression at every stop
(specified by stop-hook index.)
up -- ('_regexp-up') Select an older stack frame. Defaults to moving
one frame, a numeric argument can specify an arbitrary number.
x -- ('memory read') Read from the memory of the current target
process.
For more information on any command, type 'help <command-name>'.
(lldb) 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
set -- Sets a breakpoint or set of breakpoints in the executable.
For more help on any particular subcommand, type 'help <command> <subcommand>'.
(lldb) breakpoint clear 5
error: invalid combination of options for the given command
(lldb) b
Current breakpoints:
1: name = 'asdf', locations = 0 (pending)
2: name = 'Test1635', locations = 0 (pending)
3: name = '/Users/rsc/go/misc/cgo/test.Test1635', locations = 0 (pending)
4: address = test.test[0x000000000412dbc0], locations = 1, resolved = 1, hit count = 1
4.1: where = test.test`/Users/rsc/go/misc/cgo/test.Test1635, address = 0x000000000412dbc0, resolved, hit count = 1
5: address = test.test[0x000000000405cf10], locations = 1, resolved = 1, hit count = 5
5.1: where = test.test`runtime.raceread, address = 0x000000000405cf10, resolved, hit count = 5
6: name = 'd 5', locations = 0 (pending)
(lldb) breakpoint clear
error: invalid combination of options for the given command
(lldb) breakpoint clear 0x000000000405cf10
error: invalid combination of options for the given command
(lldb) breakpoint list
Current breakpoints:
1: name = 'asdf', locations = 0 (pending)
2: name = 'Test1635', locations = 0 (pending)
3: name = '/Users/rsc/go/misc/cgo/test.Test1635', locations = 0 (pending)
4: address = test.test[0x000000000412dbc0], locations = 1, resolved = 1, hit count = 1
4.1: where = test.test`/Users/rsc/go/misc/cgo/test.Test1635, address = 0x000000000412dbc0, resolved, hit count = 1
5: address = test.test[0x000000000405cf10], locations = 1, resolved = 1, hit count = 5
5.1: where = test.test`runtime.raceread, address = 0x000000000405cf10, resolved, hit count = 5
6: name = 'd 5', locations = 0 (pending)
(lldb) breakpoint clear --help
lldb: unrecognized option `--help'
error: unknown or ambiguous option
(lldb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment