Add usage info for backtick to the lldb tutorial.
authorJim Ingham <jingham@apple.com>
Thu, 2 Feb 2023 21:46:42 +0000 (13:46 -0800)
committerJim Ingham <jingham@apple.com>
Thu, 2 Feb 2023 21:47:12 +0000 (13:47 -0800)
lldb/docs/use/tutorial.rst

index d4da0ba..9c807ce 100644 (file)
@@ -20,10 +20,23 @@ Unlike gdb's command set, which is rather free-form, we tried to make the lldb c
 The command line parsing is done before command execution, so it is uniform
 across all the commands. The command syntax for basic commands is very simple,
 arguments, options and option values are all white-space separated, and
-double-quotes are used to protect white-spaces in an argument. If you need to
-put a backslash or double-quote character in an argument you back-slash it in
-the argument. That makes the command syntax more regular, but it also means you
-may have to quote some arguments in lldb that you wouldn't in gdb.
+either single or double-quotes (in pairs) are used to protect white-spaces
+in an argument.  If you need to put a backslash or double-quote character in an
+argument you back-slash it in the argument. That makes the command syntax more
+regular, but it also means you may have to quote some arguments in lldb that
+you wouldn't in gdb.
+
+There is one other special quote character in lldb - the backtick.
+If you put backticks around an argument or option value, lldb will run the text
+of the value through the expression parser, and the result of the expression
+will be passed to the command.  So for instance, if "len" is a local
+int variable with the value 5, then the command:
+
+::
+
+   (lldb) memory read -c `len` 0x12345
+
+will receive the value 5 for the count option, rather than the string "len".
 
 
 Options can be placed anywhere on the command line, but if the arguments begin