[Lldb-commits] [lldb] r142898 - /lldb/trunk/www/lldb-gdb.html

Jason Molenda jmolenda at apple.com
Mon Oct 24 18:28:31 PDT 2011


Author: jmolenda
Date: Mon Oct 24 20:28:31 2011
New Revision: 142898

URL: http://llvm.org/viewvc/llvm-project?rev=142898&view=rev
Log:
Add examples of shortest-possible lldb commands where appropriate.
Add new "Examining Variables" section.
Updated a few command entries to match current lldb behavior.

Modified:
    lldb/trunk/www/lldb-gdb.html

Modified: lldb/trunk/www/lldb-gdb.html
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/www/lldb-gdb.html?rev=142898&r1=142897&r2=142898&view=diff
==============================================================================
--- lldb/trunk/www/lldb-gdb.html (original)
+++ lldb/trunk/www/lldb-gdb.html Mon Oct 24 20:28:31 2011
@@ -10,27 +10,28 @@
     <div class="www_title">
       The <strong>LLDB</strong> Debugger
     </div>
-    
+
 <div id="container">
-	<div id="content">
+    <div id="content">
          <!--#include virtual="sidebar.incl"-->
-		<div id="middle">
-			<div class="post">
-				<h1 class ="postheader">LLDB to GDB Command Map</h1>
-    			<div class="post">
-
-              	    <p>Below is a table of LLDB commands with the GDB counterparts.
-              	        The built in GDB compatability aliases in GDB are also
-              	        listed.</p>
+        <div id="middle">
+            <div class="post">
+
+                <h1 class ="postheader">LLDB to GDB Command Map</h1>
+                <div class="post">
+
+                    <p>Below is a table of LLDB commands with the GDB counterparts.
+                        The built in GDB compatability aliases in GDB are also
+                        listed.</p>
                 </div>
-            	<div class="postfooter"></div>
+                <div class="postfooter"></div>
 
-				<h1 class ="postheader">Execution Commands</h1>
-    			<div class="post">
+                <h1 class ="postheader">Execution Commands</h1>
+                <div class="post">
 
                     <p>
 
-              	    <table class="stats" width="620" cellspacing="0">
+                    <table class="stats" width="620" cellspacing="0">
                     <tr>
                         <td class="hed" width="50%">LLDB</td>
                         <td class="hed" width="50%">GDB</td>
@@ -48,11 +49,10 @@
                         </td>
                     </tr>
 
-                    
+
                     <tr><td class="header" colspan="2">Launch a process with arguments <code><args></code>.</td></tr>
                         <td class="content">
                             <b>(lldb)</b> process launch -- <args><br>
-                            <b>(lldb)</b> run -- <args><br>
                             <b>(lldb)</b> r <args>
                         </td>
                         <td class="content">
@@ -81,7 +81,7 @@
                     <tr><td class="header" colspan="2">Launch a process with arguments in new terminal window (Mac OS X only).</td></tr>
                         <td class="content">
                             <b>(lldb)</b> process launch --tty -- <args><br>
-                            <b>(lldb)</b> process launch -t -- <args><br>
+                            <b>(lldb)</b> pro la -t -- <args><br>
                         </td>
                         <td class="content">
                         </td>
@@ -90,7 +90,7 @@
                     <tr><td class="header" colspan="2">Launch a process with arguments in existing terminal <cope>/dev/ttys006</code> (Mac OS X only).</td></tr>
                         <td class="content">
                             <b>(lldb)</b> process launch --tty=/dev/ttys006 -- <args><br>
-                            <b>(lldb)</b> process launch -t/dev/ttys006 -- <args><br>
+                            <b>(lldb)</b> pro la -t/dev/ttys006 -- <args><br>
                         </td>
                         <td class="content">
                         </td>
@@ -111,7 +111,7 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> process attach --name a.out<br>
-                            <b>(lldb)</b> process attach -n a.out
+                            <b>(lldb)</b> pro at -n a.out
                         </td>
                         <td class="content">
                             <b>(gdb)</b> attach a.out
@@ -122,7 +122,7 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> process attach --name a.out --waitfor<br>
-                            <b>(lldb)</b> process attach -n a.out -w
+                            <b>(lldb)</b> pro at -n a.out -w
                         </td>
                         <td class="content">
                             <b>(gdb)</b> attach -waitfor a.out
@@ -191,33 +191,6 @@
                         </td>
                     </tr>
 
-                    <tr><td class="header" colspan="2">Display a the variable "argc" and "argv" everytime you stop.</td></tr>
-                    <tr>
-                        <td class="content">
-                            <b>(lldb)</b> target stop-hook add --one-liner "frame variable argc argv"<br>
-                            <b>(lldb)</b> ta st a -o "fr v argc argv"<br>
-                        </td>
-                        <td class="content">
-                            <b>(gdb)</b> display argc<br>
-                            <b>(gdb)</b> display argv<br>
-                        </td>
-                    </tr>
-
-                    <tr><td class="header" colspan="2">Display a the variable "argc" and "argv" only when you stop in the function named <b>main</b>.</td></tr>
-                    <tr>
-                        <td class="content" colspan="2">
-                            <b>(lldb)</b> target stop-hook add --name main --one-liner "frame variable argc argv"<br>
-                            <b>(lldb)</b> ta st a -n main -o "fr v argc argv"<br>
-                        </td>
-                    </tr>
-
-                    <tr><td class="header" colspan="2">Display the variable "*this" only when you stop in c class named <b>MyClass</b>.</td></tr>
-                    <tr>
-                        <td class="content" colspan="2">
-                            <b>(lldb)</b> target stop-hook add --classname MyClass --one-liner "frame variable *this"<br>
-                        </td>
-                    </tr>
-
                     <tr><td class="header" colspan="2">Backtrace and disassemble every time you stop.</td></tr>
                     <tr>
                         <td class="content" colspan="2">
@@ -233,14 +206,14 @@
                     </table>
                     <p>
                 </div>
-        		<div class="postfooter"></div>
+                <div class="postfooter"></div>
 
-				<h1 class ="postheader">Breakpoint Commands</h1>
-    			<div class="post">
+                <h1 class ="postheader">Breakpoint Commands</h1>
+                <div class="post">
 
                     <p>
 
-              	    <table class="stats" width="620" cellspacing="0">
+                    <table class="stats" width="620" cellspacing="0">
                     <tr>
                         <td class="hed" width="50%">LLDB</td>
                         <td class="hed" width="50%">GDB</td>
@@ -254,7 +227,7 @@
                             <b>(lldb)</b> b main
                         </td>
                         <td class="content">
-                            <b>(lldb)</b> break main
+                            <b>(gdb)</b> break main
                         </td>
                     </tr>
 
@@ -262,11 +235,11 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> breakpoint set --file test.c --line 12<br>
-                            <b>(lldb)</b> breakpoint set -f test.c -l 12<br>
+                            <b>(lldb)</b> br s -f test.c -l 12<br>
                             <b>(lldb)</b> b test.c:12
                         </td>
                         <td class="content">
-                            <b>(lldb)</b> break test.c:12
+                            <b>(gdb)</b> break test.c:12
                         </td>
                     </tr>
 
@@ -274,10 +247,10 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> breakpoint set --method main<br>
-                            <b>(lldb)</b> breakpoint set -M main<br>
+                            <b>(lldb)</b> br s -M main<br>
                         </td>
                         <td class="content">
-                            <b>(lldb)</b> break main<br>
+                            <b>(gdb)</b> break main<br>
                             <i>(Hope that there are no C funtions named <b>main</b>)</i>.
                         </td>
                     </tr>
@@ -286,10 +259,10 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> breakpoint set --selector count<br>
-                            <b>(lldb)</b> breakpoint set -S count<br>
+                            <b>(lldb)</b> br s -S count<br>
                         </td>
                         <td class="content">
-                            <b>(lldb)</b> break count<br>
+                            <b>(gdb)</b> break count<br>
                             <i>(Hope that there are no C or C++ funtions named <b>count</b>)</i>.
                         </td>
                     </tr>
@@ -297,18 +270,18 @@
                     </table>
                     <p>
                 </div>
-        		<div class="postfooter"></div>
 
-				<h1 class ="postheader">Examining Thread State</h1>
-    			<div class="post">
+            <div class="postfooter"></div>
+
+            <h1 class ="postheader">Examining Variables</h1>
+                <div class="post">
                     <p>
-              	    <table class="stats" width="620" cellspacing="0">
+                    <table class="stats" width="620" cellspacing="0">
                     <tr>
                         <td class="hed" width="50%">LLDB</td>
                         <td class="hed" width="50%">GDB</td>
                     </tr>
 
-
                     <tr><td class="header" colspan="2">Show the arguments and local variables for the current frame.</td></tr>
                     <tr>
                         <td class="content">
@@ -321,6 +294,106 @@
                         </td>
                     </tr>
 
+                    <tr><td class="header" colspan="2">Show the local variables for the current frame.</td></tr>
+                    <tr>
+                        <td class="content">
+                            <b>(lldb)</b> frame variable --no-args<br>
+                            <b>(lldb)</b> fr v -a<br>
+                        </td>
+                        <td class="content">
+                            <b>(gdb)</b> info locals<br>
+                        </td>
+                    </tr>
+
+                    <tr><td class="header" colspan="2">Show the contents of local variable "bar".</td></tr>
+                    <tr>
+                        <td class="content">
+                            <b>(lldb)</b> frame variable bar <br>
+                            <b>(lldb)</b> fr v bar <br>
+                            <b>(lldb)</b> p bar <br>
+                        </td>
+                        <td class="content">
+                            <b>(gdb)</b> p bar<br>
+                        </td>
+                    </tr>
+
+                    <tr><td class="header" colspan="2">Show the contents of local variable "bar" formatted as hex.</td></tr>
+                    <tr>
+                        <td class="content">
+                            <b>(lldb)</b> frame variable --format x bar <br>
+                            <b>(lldb)</b> fr v -f x bar <br>
+                        </td>
+                        <td class="content">
+                            <b>(gdb)</b> p/x bar<br>
+                        </td>
+                    </tr>
+
+                    <tr><td class="header" colspan="2">Show the contents of global variable "baz".</td></tr>
+                    <tr>
+                        <td class="content">
+                            <b>(lldb)</b> target variable baz <br>
+                            <b>(lldb)</b> ta v baz <br>
+                        </td>
+                        <td class="content">
+                            <b>(gdb)</b> p baz<br>
+                        </td>
+                    </tr>
+
+                    <tr><td class="header" colspan="2">Show the global/static variables defined in the current source file.</td></tr>
+                    <tr>
+                        <td class="content">
+                            <b>(lldb)</b> target variable <br>
+                            <b>(lldb)</b> ta v <br>
+                        </td>
+                        <td class="content">
+                            n/a<br>
+                        </td>
+                    </tr>
+
+                    <tr><td class="header" colspan="2">Display a the variable "argc" and "argv" everytime you stop.</td></tr>
+                    <tr>
+                        <td class="content">
+                            <b>(lldb)</b> target stop-hook add --one-liner "frame variable argc argv"<br>
+                            <b>(lldb)</b> ta st a -o "fr v argc argv"<br>
+                            <b>(lldb)</b> display argc<br>
+                            <b>(lldb)</b> display argv<br>
+                        </td>
+                        <td class="content">
+                            <b>(gdb)</b> display argc<br>
+                            <b>(gdb)</b> display argv<br>
+                        </td>
+                    </tr>
+
+                    <tr><td class="header" colspan="2">Display a the variable "argc" and "argv" only when you stop in the function named <b>main</b>.</td></tr>
+                    <tr>
+                        <td class="content" colspan="2">
+                            <b>(lldb)</b> target stop-hook add --name main --one-liner "frame variable argc argv"<br>
+                            <b>(lldb)</b> ta st a -n main -o "fr v argc argv"<br>
+                        </td>
+                    </tr>
+
+                    <tr><td class="header" colspan="2">Display the variable "*this" only when you stop in c class named <b>MyClass</b>.</td></tr>
+                    <tr>
+                        <td class="content" colspan="2">
+                            <b>(lldb)</b> target stop-hook add --classname MyClass --one-liner "frame variable *this"<br>
+                            <b>(lldb)</b> ta st a -c MyClass -o "fr v *this"<br>
+                        </td>
+                    </tr>
+
+                    </table>
+                    <p>
+                </div>
+
+            <h1 class ="postheader">Examining Thread State</h1>
+                <div class="post">
+                    <p>
+                    <table class="stats" width="620" cellspacing="0">
+                    <tr>
+                        <td class="hed" width="50%">LLDB</td>
+                        <td class="hed" width="50%">GDB</td>
+                    </tr>
+
+
                     <tr><td class="header" colspan="2">Show the stack backtrace for the current thread.</td></tr>
                     <tr>
                         <td class="content">
@@ -369,7 +442,7 @@
                         <td class="content">
                             <b>(lldb)</b> down<br>
                             <b>(lldb)</b> frame select --relative=-1<br>
-                            <b>(lldb)</b> frame select -r-1<br>
+                            <b>(lldb)</b> fr s -r-1<br>
                         </td>
                         <td class="content">
                             <b>(gdb)</b> down
@@ -380,10 +453,10 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> frame select --relative 2<br>
-                            <b>(lldb)</b> frame select -r2<br>
+                            <b>(lldb)</b> fr s -r2<br>
                             <br>
                             <b>(lldb)</b> frame select --relative -3<br>
-                            <b>(lldb)</b> frame select -r-3<br>
+                            <b>(lldb)</b> fr s -r-3<br>
                         </td>
                         <td class="content">
                             <b>(gdb)</b> up 2<br>
@@ -401,12 +474,12 @@
                         </td>
                     </tr>
 
-                    <tr><td class="header" colspan="2">Show the general purpose registers for the current thread formatted as <b>unsigned decimal</b>. LLDB tries to use
-                         the same format characters as <b>printf</b> when possible.</td></tr>
+                    <tr><td class="header" colspan="2">Show the general purpose registers for the current thread formatted as <b>signed decimal</b>. LLDB tries to use
+                         the same format characters as <b>printf(3)</b> when possible.  Type "help format" to see the full list of format specifiers.</td></tr>
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> register read --format i<br>
-                            <b>(lldb)</b> register read -f i<br>
+                            <b>(lldb)</b> re r -f i<br>
                         </td>
                         <td class="content">
                         </td>
@@ -416,7 +489,7 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> register read --all<br>
-                            <b>(lldb)</b> register read -a<br>
+                            <b>(lldb)</b> re r -a<br>
                         </td>
                         <td class="content">
                             <b>(gdb)</b> info all-registers<br>
@@ -437,7 +510,7 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> register read --format binary rax<br>
-                            <b>(lldb)</b> register read -f b rax<br>
+                            <b>(lldb)</b> re r -f b rax<br>
                         </td>
                         <td class="content">
                             <b>(gdb)</b> p/t $rax<br>
@@ -448,7 +521,7 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> memory read --size 4 --format x --count 4 0xbffff3c0<br>
-                            <b>(lldb)</b> memory read -s4 -fx -c4 0xbffff3c0<br>
+                            <b>(lldb)</b> me r -s4 -fx -c4 0xbffff3c0<br>
                             <b>(lldb)</b> x -s4 -fx -c4 0xbffff3c0<br>
                         </td>
                         <td class="content">
@@ -460,7 +533,7 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> memory read --outfile /tmp/mem.txt --count 512 0xbffff3c0<br>
-                            <b>(lldb)</b> memory read -o/tmp/mem.txt -c512 0xbffff3c0<br>
+                            <b>(lldb)</b> me r -o/tmp/mem.txt -c512 0xbffff3c0<br>
                         </td>
                         <td class="content">
                           <b>(gdb)</b> set logging on<br>
@@ -474,7 +547,7 @@
                     <tr>
                         <td class="content"colspan=2>
                             <b>(lldb)</b> memory read --outfile /tmp/mem.bin --binary  0x1000 0x1200<br>
-                            <b>(lldb)</b> memory read -o /tmp/mem.bin -b 0x1000 0x1200<br>
+                            <b>(lldb)</b> me r -o /tmp/mem.bin -b 0x1000 0x1200<br>
                         </td>
                     </tr>
 
@@ -482,7 +555,7 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> disassemble --frame<br>
-                            <b>(lldb)</b> disassemble -f
+                            <b>(lldb)</b> di -f
                         </td>
                         <td class="content">
                             <b>(gdb)</b> disassemble
@@ -493,7 +566,7 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> disassemble --name main<br>
-                            <b>(lldb)</b> disassemble -n main
+                            <b>(lldb)</b> di -n main
                         </td>
                         <td class="content">
                             <b>(gdb)</b> disassemble main
@@ -504,7 +577,7 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> disassemble --start-address  0x1eb8 --end-address 0x1ec3<br>
-                            <b>(lldb)</b> disassemble -s 0x1eb8 -e 0x1ec3<br>
+                            <b>(lldb)</b> di -s 0x1eb8 -e 0x1ec3<br>
                         </td>
                         <td class="content">
                             <b>(gdb)</b> disassemble 0x1eb8 0x1ec3
@@ -515,7 +588,7 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> disassemble --start-address  0x1eb8 --count 20<br>
-                            <b>(lldb)</b> disassemble -s 0x1eb8 -c 20<br>
+                            <b>(lldb)</b> di -s 0x1eb8 -c 20<br>
                         </td>
                         <td class="content">
                             <b>(gdb)</b> x/20i 0x1eb8
@@ -526,7 +599,7 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> disassemble --frame --mixed<br>
-                            <b>(lldb)</b> disassemble -f -m
+                            <b>(lldb)</b> di -f -m
                         </td>
                         <td class="content">
                             n/a
@@ -537,7 +610,7 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> disassemble --frame --bytes<br>
-                            <b>(lldb)</b> disassemble -f -b
+                            <b>(lldb)</b> di -f -b
                         </td>
                         <td class="content">
                             n/a
@@ -548,7 +621,7 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> disassemble --line<br>
-                            <b>(lldb)</b> disassemble -l
+                            <b>(lldb)</b> di -l
                         </td>
                         <td class="content">
                             n/a
@@ -558,14 +631,14 @@
                     </table>
                     <p>
                 </div>
-        		<div class="postfooter"></div>
+                <div class="postfooter"></div>
 
-				<h1 class ="postheader">Executable and Shared Library Query Commands</h1>
-    			<div class="post">
+                <h1 class ="postheader">Executable and Shared Library Query Commands</h1>
+                <div class="post">
 
                     <p>
 
-              	    <table class="stats" width="620" cellspacing="0">
+                    <table class="stats" width="620" cellspacing="0">
                     <tr>
                         <td class="hed" width="50%">LLDB</td>
                         <td class="hed" width="50%">GDB</td>
@@ -586,7 +659,7 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> image lookup --address 0x1ec4<br>
-                            <b>(lldb)</b> image lookup -a 0x1ec4<br>
+                            <b>(lldb)</b> im loo -a 0x1ec4<br>
                         </td>
                         <td class="content">
                             <b>(gdb)</b> info symbol 0x1ec4<br>
@@ -597,7 +670,7 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> image lookup --address 0x1ec4 a.out<br>
-                            <b>(lldb)</b> image lookup -a 0x1ec4 a.out<br>
+                            <b>(lldb)</b> im loo -a 0x1ec4 a.out<br>
                         </td>
                         <td class="content">
                         </td>
@@ -607,7 +680,7 @@
                     <tr>
                         <td class="content">
                             <b>(lldb)</b> image lookup --type Point<br>
-                            <b>(lldb)</b> image lookup -t Point<br>
+                            <b>(lldb)</b> im loo -t Point<br>
                         </td>
                         <td class="content">
                             <b>(lldb)</b> ptype Point<br>
@@ -654,14 +727,14 @@
                     </table>
                     <p>
                 </div>
-        		<div class="postfooter"></div>
+                <div class="postfooter"></div>
 
                 <p>
 
-    			
+
             </div>
-      	</div>
-	</div>
+        </div>
+    </div>
 </div>
 </body>
 </html>





More information about the lldb-commits mailing list