Skip to content

Instantly share code, notes, and snippets.

@kybr

kybr/error.txt Secret

Created February 21, 2019 00:34
Show Gist options
  • Save kybr/fd4b50767f76c074dd51cd23a7c58c4b to your computer and use it in GitHub Desktop.
Save kybr/fd4b50767f76c074dd51cd23a7c58c4b to your computer and use it in GitHub Desktop.
Debug option (./run.sh -d) does not work on macOS
$ ./run.sh -d example/foo.cpp
...
lldb: unrecognized option `- '
Usage:
lldb -h
lldb -v [[--] <PROGRAM-ARG-1> [<PROGRAM_ARG-2> ...]]
lldb -a <arch> -f <filename> [-c <filename>] [-s <filename>] [-o <none>] [-S <filename>] [-O <none>] [-k <none>] [-K <filename>] [-Q] [-b] [-e] [-x] [-X] [-l <script-language>] [-d] [[--] <PROGRAM-ARG-1> [<PROGRAM_ARG-2> ...]]
lldb -n <process-name> -w [-s <filename>] [-o <none>] [-S <filename>] [-O <none>] [-k <none>] [-K <filename>] [-Q] [-b] [-e] [-x] [-X] [-l <script-language>] [-d]
lldb -p <pid> [-s <filename>] [-o <none>] [-S <filename>] [-O <none>] [-k <none>] [-K <filename>] [-Q] [-b] [-e] [-x] [-X] [-l <script-language>] [-d]
lldb -P
lldb -r [<none>] -R <none>
-h
--help
Prints out the usage information for the LLDB debugger.
-v
--version
Prints out the current version number of the LLDB debugger.
-a <arch>
--arch <arch>
Tells the debugger to use the specified architecture when starting
and running the program. <architecture> must be one of the
architectures for which the program was compiled.
-f <filename>
--file <filename>
Tells the debugger to use the file <filename> as the program to be
debugged.
-c <filename>
--core <filename>
Tells the debugger to use the fullpath to <path> as the core file.
-p <pid>
--attach-pid <pid>
Tells the debugger to attach to a process with the given pid.
-n <process-name>
--attach-name <process-name>
Tells the debugger to attach to a process with the given name.
-w
--wait-for
Tells the debugger to wait for a process with the given pid or name
to launch before attaching.
-s <filename>
--source <filename>
Tells the debugger to read in and execute the lldb commands in the
given file, after any file provided on the command line has been
loaded.
-o
--one-line
Tells the debugger to execute this one-line lldb command after any
file provided on the command line has been loaded.
-S <filename>
--source-before-file <filename>
Tells the debugger to read in and execute the lldb commands in the
given file, before any file provided on the command line has been
loaded.
-O
--one-line-before-file
Tells the debugger to execute this one-line lldb command before any
file provided on the command line has been loaded.
-k
--one-line-on-crash
When in batch mode, tells the debugger to execute this one-line
lldb command if the target crashes.
-K <filename>
--source-on-crash <filename>
When in batch mode, tells the debugger to source this file of lldb
commands if the target crashes.
-Q
--source-quietly
Tells the debugger to execute this one-line lldb command before any
file provided on the command line has been loaded.
-b
--batch
Tells the debugger to run the commands from -s, -S, -o & -O, and
then quit. However if any run command stopped due to a signal or
crash, the debugger will return to the interactive prompt at the
place of the crash.
-e
--editor
Tells the debugger to open source files using the host's "external
editor" mechanism.
-x
--no-lldbinit
Do not automatically parse any '.lldbinit' files.
-X
--no-use-colors
Do not use colors.
-P
--python-path
Prints out the path to the lldb.py file for this version of lldb.
-l <script-language>
--script-language <script-language>
Tells the debugger to use the specified scripting language for
user-defined scripts, rather than the default. Valid scripting
languages that can be specified include Python, Perl, Ruby and Tcl.
Currently only the Python extensions have been implemented.
-d
--debug
Tells the debugger to print out extra information for debugging
itself.
-r
--repl
Runs lldb in REPL mode with a stub process.
-R
--repl-language
Chooses the language for the REPL.
Notes:
Multiple "-s" and "-o" options can be provided. They will be processed
from left to right in order, with the source files and commands
interleaved. The same is true of the "-S" and "-O" options. The before
file and after file sets can intermixed freely, the command parser will
sort them out. The order of the file specifiers ("-c", "-f", etc.) is
not significant in this regard.
If you don't provide -f then the first argument will be the file to be
debugged which means that 'lldb -- <filename> [<ARG1> [<ARG2>]]' also
works. But remember to end the options with "--" if any of your
arguments have a "-" in them.
error: unknown or ambiguous option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment