[Lldb-commits] [lldb] d980860 - Add usage info for backtick to the lldb tutorial.

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 2 13:47:19 PST 2023


Author: Jim Ingham
Date: 2023-02-02T13:47:12-08:00
New Revision: d98086036a62e4e9c912c3b15bf16893d3df41da

URL: https://github.com/llvm/llvm-project/commit/d98086036a62e4e9c912c3b15bf16893d3df41da
DIFF: https://github.com/llvm/llvm-project/commit/d98086036a62e4e9c912c3b15bf16893d3df41da.diff

LOG: Add usage info for backtick to the lldb tutorial.

Added: 
    

Modified: 
    lldb/docs/use/tutorial.rst

Removed: 
    


################################################################################
diff  --git a/lldb/docs/use/tutorial.rst b/lldb/docs/use/tutorial.rst
index d4da0bae5aaf0..9c807ce4bb55d 100644
--- a/lldb/docs/use/tutorial.rst
+++ b/lldb/docs/use/tutorial.rst
@@ -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


        


More information about the lldb-commits mailing list