[Lldb-commits] [lldb] r165294 - /lldb/trunk/www/lldb-gdb.html
Jason Molenda
jmolenda at apple.com
Thu Oct 4 21:26:06 PDT 2012
Author: jmolenda
Date: Thu Oct 4 23:26:06 2012
New Revision: 165294
URL: http://llvm.org/viewvc/llvm-project?rev=165294&view=rev
Log:
Swap the columns in the lldb & gdb command comparison table. I
often hear feedback from people that having the lldb commands on
the left hand side is non-intuitive -- they say "I want a *gdb* to
*lldb* table, not a *lldb* to *gdb* table". It doesn't seem odious
to go from the right-hand column to the left hand column but I've
heard this same feedback enough that it's also pointless to keep
the format lldb-first, gdb-second when it was an arbitrary choice
to begin with.
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=165294&r1=165293&r2=165294&view=diff
==============================================================================
--- lldb/trunk/www/lldb-gdb.html (original)
+++ lldb/trunk/www/lldb-gdb.html Thu Oct 4 23:26:06 2012
@@ -33,197 +33,199 @@
<table class="stats" width="620" cellspacing="0">
<tr>
- <td class="hed" width="50%">LLDB</td>
<td class="hed" width="50%">GDB</td>
+ <td class="hed" width="50%">LLDB</td>
</tr>
<tr><td class="header" colspan="2">Launch a process no arguments.</td></tr>
<td class="content">
+ <b>(gdb)</b> run<br>
+ <b>(gdb)</b> r
+ </td>
+ <td class="content">
<b>(lldb)</b> process launch<br>
<b>(lldb)</b> run<br>
<b>(lldb)</b> r
</td>
- <td class="content">
- <b>(gdb)</b> run<br>
- <b>(gdb)</b> r
- </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> r <args>
- </td>
- <td class="content">
<b>(gdb)</b> run <args><br>
<b>(gdb)</b> r <args>
</td>
+ <td class="content">
+ <b>(lldb)</b> process launch -- <args><br>
+ <b>(lldb)</b> r <args>
+ </td>
</tr>
<tr><td class="header" colspan="2">Launch a process for with arguments <b><code>a.out 1 2 3</code></b> without having to supply the args every time.</td></tr>
<td class="content">
- <b>%</b> lldb -- a.out 1 2 3<br>
- <b>(lldb)</b> run<br>
+ <b>%</b> gdb --args a.out 1 2 3<br>
+ <b>(gdb)</b> run<br>
...<br>
- <b>(lldb)</b> run<br>
+ <b>(gdb)</b> run<br>
...<br>
</td>
<td class="content">
- <b>%</b> gdb --args a.out 1 2 3<br>
- <b>(gdb)</b> run<br>
+ <b>%</b> lldb -- a.out 1 2 3<br>
+ <b>(lldb)</b> run<br>
...<br>
- <b>(gdb)</b> run<br>
+ <b>(lldb)</b> run<br>
...<br>
</td>
</tr>
<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> pro la -t -- <args><br>
</td>
<td class="content">
+ <b>(lldb)</b> process launch --tty -- <args><br>
+ <b>(lldb)</b> pro la -t -- <args><br>
</td>
</tr>
<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> pro la -t/dev/ttys006 -- <args><br>
</td>
<td class="content">
+ <b>(lldb)</b> process launch --tty=/dev/ttys006 -- <args><br>
+ <b>(lldb)</b> pro la -t/dev/ttys006 -- <args><br>
</td>
</tr>
<tr><td class="header" colspan="2">Attach to a process with process ID 123.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> process attach --pid 123<br>
- <b>(lldb)</b> attach -p 123
+ <b>(gdb)</b> attach 123
</td>
<td class="content">
- <b>(gdb)</b> attach 123
+ <b>(lldb)</b> process attach --pid 123<br>
+ <b>(lldb)</b> attach -p 123
</td>
</tr>
<tr><td class="header" colspan="2">Attach to a process named "a.out".</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> process attach --name a.out<br>
- <b>(lldb)</b> pro at -n a.out
+ <b>(gdb)</b> attach a.out
</td>
<td class="content">
- <b>(gdb)</b> attach a.out
+ <b>(lldb)</b> process attach --name a.out<br>
+ <b>(lldb)</b> pro at -n a.out
</td>
</tr>
<tr><td class="header" colspan="2">Wait for a process named "a.out" to launch and attach.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> process attach --name a.out --waitfor<br>
- <b>(lldb)</b> pro at -n a.out -w
+ <b>(gdb)</b> attach -waitfor a.out
</td>
<td class="content">
- <b>(gdb)</b> attach -waitfor a.out
+ <b>(lldb)</b> process attach --name a.out --waitfor<br>
+ <b>(lldb)</b> pro at -n a.out -w
</td>
</tr>
<tr><td class="header" colspan="2">Attach to a remote gdb protocol server running on system "eorgadd", port 8000.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> gdb-remote eorgadd:8000
+ <b>(gdb)</b> target remote eorgadd:8000
</td>
<td class="content">
- <b>(gdb)</b> target remote eorgadd:8000
+ <b>(lldb)</b> gdb-remote eorgadd:8000
</td>
</tr>
<tr><td class="header" colspan="2">Attach to a remote gdb protocol server running on the local system, port 8000.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> gdb-remote 8000
+ <b>(gdb)</b> target remote localhost:8000
</td>
<td class="content">
- <b>(gdb)</b> target remote localhost:8000
+ <b>(lldb)</b> gdb-remote 8000
</td>
</tr>
<tr><td class="header" colspan="2">Attach to a Darwin kernel in kdp mode on system "eorgadd".</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> kdp-remote eorgadd
+ <b>(gdb)</b> kdp-reattach eorgadd
</td>
<td class="content">
- <b>(gdb)</b> kdp-reattach eorgadd
+ <b>(lldb)</b> kdp-remote eorgadd
</td>
</tr>
<tr><td class="header" colspan="2">Do a source level single step in the currently selected thread.</td></tr>
<tr>
<td class="content">
+ <b>(gdb)</b> step<br>
+ <b>(gdb)</b> s
+ </td>
+ <td class="content">
<b>(lldb)</b> thread step-in<br>
<b>(lldb)</b> step<br>
<b>(lldb)</b> s
</td>
- <td class="content">
- <b>(gdb)</b> step<br>
- <b>(gdb)</b> s
- </td>
</tr>
<tr><td class="header" colspan="2">Do a source level single step over in the currently selected thread.</td></tr>
<tr>
<td class="content">
+ <b>(gdb)</b> next<br>
+ <b>(gdb)</b> n
+ </td>
+ <td class="content">
<b>(lldb)</b> thread step-over<br>
<b>(lldb)</b> next<br>
<b>(lldb)</b> n<br>
</td>
- <td class="content">
- <b>(gdb)</b> next<br>
- <b>(gdb)</b> n
- </td>
</tr>
<tr><td class="header" colspan="2">Do an instruction level single step in the currently selected thread.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> thread step-inst<br>
- <b>(lldb)</b> si<br>
- </td>
- <td class="content">
<b>(gdb)</b> stepi<br>
<b>(gdb)</b> si
</td>
+ <td class="content">
+ <b>(lldb)</b> thread step-inst<br>
+ <b>(lldb)</b> si<br>
+ </td>
</tr>
<tr><td class="header" colspan="2">Do an instruction level single step over in the currently selected thread.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> thread step-inst-over<br>
- <b>(lldb)</b> ni
- </td>
- <td class="content">
<b>(gdb)</b> nexti<br>
<b>(gdb)</b> ni
</td>
+ <td class="content">
+ <b>(lldb)</b> thread step-inst-over<br>
+ <b>(lldb)</b> ni
+ </td>
</tr>
<tr><td class="header" colspan="2">Step out of the currently selected frame.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> thread step-out<br>
- <b>(lldb)</b> finish<br>
+ <b>(gdb)</b> finish<br>
</td>
<td class="content">
- <b>(gdb)</b> finish<br>
+ <b>(lldb)</b> thread step-out<br>
+ <b>(lldb)</b> finish<br>
</td>
</tr>
<tr><td class="header" colspan="2">Backtrace and disassemble every time you stop.</td></tr>
<tr>
- <td class="content" colspan="2">
+ <td class="content">
+ </td>
+ <td class="content">
<b>(lldb)</b> target stop-hook add<br>
Enter your stop hook command(s). Type 'DONE' to end.<br>
> bt<br>
@@ -245,88 +247,88 @@
<table class="stats" width="620" cellspacing="0">
<tr>
- <td class="hed" width="50%">LLDB</td>
<td class="hed" width="50%">GDB</td>
+ <td class="hed" width="50%">LLDB</td>
</tr>
<tr><td class="header" colspan="2">Set a breakpoint at all functions named <b>main</b>.</td></tr>
<tr>
<td class="content">
+ <b>(gdb)</b> break main
+ </td>
+ <td class="content">
<b>(lldb)</b> breakpoint set --name main<br>
<b>(lldb)</b> br s -n main<br>
<b>(lldb)</b> b main
</td>
- <td class="content">
- <b>(gdb)</b> break main
- </td>
</tr>
<tr><td class="header" colspan="2">Set a breakpoint in file <b>test.c</b> at line <b>12</b>.</td></tr>
<tr>
<td class="content">
+ <b>(gdb)</b> break test.c:12
+ </td>
+ <td class="content">
<b>(lldb)</b> breakpoint set --file test.c --line 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>(gdb)</b> break test.c:12
- </td>
</tr>
<tr><td class="header" colspan="2">Set a breakpoint at all C++ methods whose basename is <b>main</b>.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> breakpoint set --method main<br>
- <b>(lldb)</b> br s -M main<br>
- </td>
- <td class="content">
<b>(gdb)</b> break main<br>
<i>(Hope that there are no C funtions named <b>main</b>)</i>.
</td>
+ <td class="content">
+ <b>(lldb)</b> breakpoint set --method main<br>
+ <b>(lldb)</b> br s -M main<br>
+ </td>
</tr>
<tr><td class="header" colspan="2">Set a breakpoint at and object C function: <b>-[NSString stringWithFormat:]</b>.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> breakpoint set --name "-[NSString stringWithFormat:]"<br>
- <b>(lldb)</b> b -[NSString stringWithFormat:]<br>
+ <b>(gdb)</b> break -[NSString stringWithFormat:]<br>
</td>
<td class="content">
- <b>(gdb)</b> break -[NSString stringWithFormat:]<br>
+ <b>(lldb)</b> breakpoint set --name "-[NSString stringWithFormat:]"<br>
+ <b>(lldb)</b> b -[NSString stringWithFormat:]<br>
</td>
</tr>
<tr><td class="header" colspan="2">Set a breakpoint at all Objective C methods whose selector is <b>count</b>.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> breakpoint set --selector count<br>
- <b>(lldb)</b> br s -S count<br>
- </td>
- <td class="content">
<b>(gdb)</b> break count<br>
<i>(Hope that there are no C or C++ funtions named <b>count</b>)</i>.
</td>
+ <td class="content">
+ <b>(lldb)</b> breakpoint set --selector count<br>
+ <b>(lldb)</b> br s -S count<br>
+ </td>
</tr>
<tr><td class="header" colspan="2">List all breakpoints.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> breakpoint list<br>
- <b>(lldb)</b> br l<br>
+ <b>(gdb)</b> info break<br>
</td>
<td class="content">
- <b>(gdb)</b> info break<br>
+ <b>(lldb)</b> breakpoint list<br>
+ <b>(lldb)</b> br l<br>
</td>
</tr>
<tr><td class="header" colspan="2">Delete a breakpoint.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> breakpoint delete 1<br>
- <b>(lldb)</b> br del 1<br>
+ <b>(gdb)</b> delete 1<br>
</td>
<td class="content">
- <b>(gdb)</b> delete 1<br>
+ <b>(lldb)</b> breakpoint delete 1<br>
+ <b>(lldb)</b> br del 1<br>
</td>
</tr>
@@ -342,18 +344,18 @@
<table class="stats" width="620" cellspacing="0">
<tr>
- <td class="hed" width="50%">LLDB</td>
<td class="hed" width="50%">GDB</td>
+ <td class="hed" width="50%">LLDB</td>
</tr>
<tr><td class="header" colspan="2">Set a watchpoint on a variable when it is written to.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> watchpoint set variable -w write global_var<br>
- <b>(lldb)</b> watch set var -w write global_var<br>
+ <b>(gdb)</b> watch global_var
</td>
<td class="content">
- <b>(gdb)</b> watch global_var
+ <b>(lldb)</b> watchpoint set variable -w write global_var<br>
+ <b>(lldb)</b> watch set var -w write global_var<br>
</td>
</tr>
@@ -361,17 +363,19 @@
This command takes raw input, evaluated as an expression returning an unsigned integer pointing to the start of the region, after the '--' option terminator.</td></tr>
<tr>
<td class="content">
+ <b>(gdb)</b> watch -location g_char_ptr
+ </td>
+ <td class="content">
<b>(lldb)</b> watchpoint set expression -w write -- my_ptr<br>
<b>(lldb)</b> watch set exp -w write -- my_ptr<br>
</td>
- <td class="content">
- <b>(gdb)</b> watch -location g_char_ptr
- </td>
</tr>
<tr><td class="header" colspan="2">Set a condition on a watchpoint</b>.</td></tr>
<tr>
- <td class="content" colspan="2">
+ <td class="content">
+ </td>
+ <td class="content">
<b>(lldb)</b> watch set var -w write global<br>
<b>(lldb)</b> watchpoint modify -c '(global==5)'<br>
<b>(lldb)</b> c<br>
@@ -389,22 +393,22 @@
<tr><td class="header" colspan="2">List all watchpoints.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> watchpoint list<br>
- <b>(lldb)</b> watch l<br>
+ <b>(gdb)</b> info break<br>
</td>
<td class="content">
- <b>(gdb)</b> info break<br>
+ <b>(lldb)</b> watchpoint list<br>
+ <b>(lldb)</b> watch l<br>
</td>
</tr>
<tr><td class="header" colspan="2">Delete a watchpoint.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> watchpoint delete 1<br>
- <b>(lldb)</b> watch del 1<br>
+ <b>(gdb)</b> delete 1<br>
</td>
<td class="content">
- <b>(gdb)</b> delete 1<br>
+ <b>(lldb)</b> watchpoint delete 1<br>
+ <b>(lldb)</b> watch del 1<br>
</td>
</tr>
@@ -418,95 +422,97 @@
<p>
<table class="stats" width="620" cellspacing="0">
<tr>
- <td class="hed" width="50%">LLDB</td>
<td class="hed" width="50%">GDB</td>
+ <td class="hed" width="50%">LLDB</td>
</tr>
<tr><td class="header" colspan="2">Show the arguments and local variables for the current frame.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> frame variable<br>
- </td>
- <td class="content">
<b>(gdb)</b> info args<br>
and<br>
<b>(gdb)</b> info locals<br>
</td>
+ <td class="content">
+ <b>(lldb)</b> frame variable<br>
+ </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>
+ <b>(gdb)</b> info locals<br>
</td>
<td class="content">
- <b>(gdb)</b> info locals<br>
+ <b>(lldb)</b> frame variable --no-args<br>
+ <b>(lldb)</b> fr v -a<br>
</td>
</tr>
<tr><td class="header" colspan="2">Show the contents of local variable "bar".</td></tr>
<tr>
<td class="content">
+ <b>(gdb)</b> p bar<br>
+ </td>
+ <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>
+ <b>(gdb)</b> p/x bar<br>
</td>
<td class="content">
- <b>(gdb)</b> p/x bar<br>
+ <b>(lldb)</b> frame variable --format x bar <br>
+ <b>(lldb)</b> fr v -f 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>
+ <b>(gdb)</b> p baz<br>
</td>
<td class="content">
- <b>(gdb)</b> p baz<br>
+ <b>(lldb)</b> target variable baz <br>
+ <b>(lldb)</b> ta v 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>
+ n/a<br>
</td>
<td class="content">
- n/a<br>
+ <b>(lldb)</b> target variable <br>
+ <b>(lldb)</b> ta v <br>
</td>
</tr>
<tr><td class="header" colspan="2">Display a the variable "argc" and "argv" every time you stop.</td></tr>
<tr>
<td class="content">
+ <b>(gdb)</b> display argc<br>
+ <b>(gdb)</b> display argv<br>
+ </td>
+ <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">
+ <td class="content">
+ </td>
+ <td class="content">
<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>
@@ -514,7 +520,9 @@
<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">
+ <td class="content">
+ </td>
+ <td class="content">
<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>
@@ -532,49 +540,49 @@
<p>
<table class="stats" width="620" cellspacing="0">
<tr>
- <td class="hed" width="50%">LLDB</td>
<td class="hed" width="50%">GDB</td>
+ <td class="hed" width="50%">LLDB</td>
</tr>
<tr><td class="header" colspan="2">Evaluating a generalized expression in the current frame.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> expr (int) printf ("Print nine: %d.", 4 + 5)<br>
- or using the print alias:<br>
- <b>(lldb)</b> print (int) printf ("Print nine: %d.", 4 + 5)<br>
- </td>
- <td class="content">
<b>(gdb)</b> print (int) printf ("Print nine: %d.", 4 + 5)<br>
or if you don't want to see void returns: <br>
<b>(gdb)</b> call (int) printf ("Print nine: %d.", 4 + 5)<br>
</td>
+ <td class="content">
+ <b>(lldb)</b> expr (int) printf ("Print nine: %d.", 4 + 5)<br>
+ or using the print alias:<br>
+ <b>(lldb)</b> print (int) printf ("Print nine: %d.", 4 + 5)<br>
+ </td>
</tr>
<tr><td class="header" colspan="2">Printing the ObjC "description" of an object.</td></tr>
<tr>
<td class="content">
+ <b>(gdb)</b> po [SomeClass returnAnObject]<br>
+ </td>
+ <td class="content">
<b>(lldb)</b> expr -o -- [SomeClass returnAnObject]<br>
or using the po alias:<br>
<b>(lldb)</b> po [SomeClass returnAnObject]<br>
</td>
- <td class="content">
- <b>(gdb)</b> po [SomeClass returnAnObject]<br>
- </td>
</tr>
<tr><td class="header" colspan="2">Print the dynamic type of the result of an expression.</td></tr>
<tr>
<td class="content">
+ <b>(gdb)</b> set print object 1<br>
+ <b>(gdb)</b> p someCPPObjectPtrOrReference<br>
+ only works for C++ objects.<br>
+ </td>
+ <td class="content">
<b>(lldb)</b> expr -d 1 -- [SomeClass returnAnObject]<br>
<b>(lldb)</b> expr -d 1 -- someCPPObjectPtrOrReference<br>
or set dynamic type printing to be the default:
<b>(lldb)</b> settings set target.prefer-dynamic run-target<br>
</td>
- <td class="content">
- <b>(gdb)</b> set print object 1<br>
- <b>(gdb)</b> p someCPPObjectPtrOrReference<br>
- only works for C++ objects.<br>
- </td>
</tr>
@@ -587,97 +595,97 @@
<p>
<table class="stats" width="620" cellspacing="0">
<tr>
- <td class="hed" width="50%">LLDB</td>
<td class="hed" width="50%">GDB</td>
+ <td class="hed" width="50%">LLDB</td>
</tr>
<tr><td class="header" colspan="2">Show the stack backtrace for the current thread.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> thread backtrace<br>
- <b>(lldb)</b> bt<br>
+ <b>(gdb)</b> bt<br>
</td>
<td class="content">
- <b>(gdb)</b> bt<br>
+ <b>(lldb)</b> thread backtrace<br>
+ <b>(lldb)</b> bt<br>
</td>
</tr>
<tr><td class="header" colspan="2">Show the stack backtraces for all threads.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> thread backtrace all<br>
- <b>(lldb)</b> bt all
+ <b>(gdb)</b> thread apply all bt
</td>
<td class="content">
- <b>(gdb)</b> thread apply all bt
+ <b>(lldb)</b> thread backtrace all<br>
+ <b>(lldb)</b> bt all
</td>
</tr>
<tr><td class="header" colspan="2">Select a different stack frame by index for the current thread.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> frame select 12<br>
+ <b>(gdb)</b> frame 12
</td>
<td class="content">
- <b>(gdb)</b> frame 12
+ <b>(lldb)</b> frame select 12<br>
</td>
</tr>
<tr><td class="header" colspan="2">List information about the currently selected frame in the current thread.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> frame info<br>
</td>
<td class="content">
+ <b>(lldb)</b> frame info<br>
</td>
</tr>
<tr><td class="header" colspan="2">Select the stack frame that called the current stack frame.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> up<br>
- <b>(lldb)</b> frame select --relative=1<br>
+ <b>(gdb)</b> up
</td>
<td class="content">
- <b>(gdb)</b> up
+ <b>(lldb)</b> up<br>
+ <b>(lldb)</b> frame select --relative=1<br>
</td>
</tr>
<tr><td class="header" colspan="2">Select the stack frame that is called by the current stack frame.</td></tr>
<tr>
<td class="content">
+ <b>(gdb)</b> down
+ </td>
+ <td class="content">
<b>(lldb)</b> down<br>
<b>(lldb)</b> frame select --relative=-1<br>
<b>(lldb)</b> fr s -r-1<br>
</td>
- <td class="content">
- <b>(gdb)</b> down
- </td>
</tr>
<tr><td class="header" colspan="2">Select a different stack frame using a relative offset.</td></tr>
<tr>
<td class="content">
+ <b>(gdb)</b> up 2<br>
+ <b>(gdb)</b> down 3<br>
+ </td>
+ <td class="content">
<b>(lldb)</b> frame select --relative 2<br>
<b>(lldb)</b> fr s -r2<br>
<br>
<b>(lldb)</b> frame select --relative -3<br>
<b>(lldb)</b> fr s -r-3<br>
</td>
- <td class="content">
- <b>(gdb)</b> up 2<br>
- <b>(gdb)</b> down 3<br>
- </td>
</tr>
<tr><td class="header" colspan="2">Show the general purpose registers for the current thread.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> register read<br>
+ <b>(gdb)</b> info registers<br>
</td>
<td class="content">
- <b>(gdb)</b> info registers<br>
+ <b>(lldb)</b> register read<br>
</td>
</tr>
@@ -685,40 +693,43 @@
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">
+ </td>
+ <td class="content">
<b>(lldb)</b> register read --format i<br>
<b>(lldb)</b> re r -f i<br>
<br>
<i>LLDB now supports the GDB shorthand format syntax but there can't be space after the command:</i><br>
<b>(lldb)</b> register read/d<br>
</td>
- <td class="content">
- </td>
</tr>
<tr><td class="header" colspan="2">Show all registers in all register sets for the current thread.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> register read --all<br>
- <b>(lldb)</b> re r -a<br>
+ <b>(gdb)</b> info all-registers<br>
</td>
<td class="content">
- <b>(gdb)</b> info all-registers<br>
+ <b>(lldb)</b> register read --all<br>
+ <b>(lldb)</b> re r -a<br>
</td>
</tr>
<tr><td class="header" colspan="2">Show the values for the registers named "rax", "rsp" and "rbp" in the current thread.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> register read rax rsp rbp<br>
+ <b>(gdb)</b> info all-registers rax rsp rbp<br>
</td>
<td class="content">
- <b>(gdb)</b> info all-registers rax rsp rbp<br>
+ <b>(lldb)</b> register read rax rsp rbp<br>
</td>
</tr>
<tr><td class="header" colspan="2">Show the values for the register named "rax" in the current thread formatted as <b>binary</b>.</td></tr>
<tr>
<td class="content">
+ <b>(gdb)</b> p/t $rax<br>
+ </td>
+ <td class="content">
<b>(lldb)</b> register read --format binary rax<br>
<b>(lldb)</b> re r -f b rax<br>
<br>
@@ -726,14 +737,14 @@
<b>(lldb)</b> register read/t rax<br>
<b>(lldb)</b> p/t $rax<br>
</td>
- <td class="content">
- <b>(gdb)</b> p/t $rax<br>
- </td>
</tr>
<tr><td class="header" colspan="2">Read memory from address 0xbffff3c0 and show 4 hex uint32_t values.</td></tr>
<tr>
<td class="content">
+ <b>(gdb)</b> x/4xw 0xbffff3c0<br>
+ </td>
+ <td class="content">
<b>(lldb)</b> memory read --size 4 --format x --count 4 0xbffff3c0<br>
<b>(lldb)</b> me r -s4 -fx -c4 0xbffff3c0<br>
<b>(lldb)</b> x -s4 -fx -c4 0xbffff3c0<br>
@@ -743,124 +754,119 @@
<b>(lldb)</b> x/4xw 0xbffff3c0<br>
<b>(lldb)</b> memory read --gdb-format 4xw 0xbffff3c0<br>
</td>
- <td class="content">
- <b>(gdb)</b> x/4xw 0xbffff3c0<br>
- </td>
</tr>
<tr><td class="header" colspan="2">Read memory starting at the expression "argv[0]".</td></tr>
<tr>
<td class="content">
+ <b>(gdb)</b> x argv[0]<br>
+ </td>
+ <td class="content">
<b>(lldb)</b> memory read `argv[0]`<br>
<i><b>NOTE:</b> any command can inline a scalar expression result (as long as the target is stopped) using backticks around any expression:</i><br>
<b>(lldb)</b> memory read --size `sizeof(int)` `argv[0]`<br>
</td>
- <td class="content">
- <b>(gdb)</b> x argv[0]<br>
- </td>
</tr>
<tr><td class="header" colspan="2">Read 512 bytes of memory from address 0xbffff3c0 and save results to a local file as <b>text</b>.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> memory read --outfile /tmp/mem.txt --count 512 0xbffff3c0<br>
- <b>(lldb)</b> me r -o/tmp/mem.txt -c512 0xbffff3c0<br>
- <b>(lldb)</b> x/512bx -o/tmp/mem.txt 0xbffff3c0<br>
- </td>
- <td class="content">
<b>(gdb)</b> set logging on<br>
<b>(gdb)</b> set logging file /tmp/mem.txt<br>
<b>(gdb)</b> x/512bx 0xbffff3c0<br>
<b>(gdb)</b> set logging off<br>
</td>
+ <td class="content">
+ <b>(lldb)</b> memory read --outfile /tmp/mem.txt --count 512 0xbffff3c0<br>
+ <b>(lldb)</b> me r -o/tmp/mem.txt -c512 0xbffff3c0<br>
+ <b>(lldb)</b> x/512bx -o/tmp/mem.txt 0xbffff3c0<br>
+ </td>
</tr>
<tr><td class="header" colspan="2">Save binary memory data starting at 0x1000 and ending at 0x2000 to a file.</td></tr>
<tr>
- <td class="content"colspan=2>
+ <td class="content">
+ <b>(gdb)</b> dump memory /tmp/mem.bin 0x1000 0x2000
+ </td>
+ <td class="content">
<b>(lldb)</b> memory read --outfile /tmp/mem.bin --binary 0x1000 0x1200<br>
<b>(lldb)</b> me r -o /tmp/mem.bin -b 0x1000 0x1200<br>
</td>
</tr>
- <tr>
- <td class="content" colspan="2">
- <b>(gdb)</b> dump memory /tmp/mem.bin 0x1000 0x2000
- </td>
- </tr>
<tr><td class="header" colspan="2">Disassemble the current function for the current frame.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> disassemble --frame<br>
- <b>(lldb)</b> di -f
+ <b>(gdb)</b> disassemble
</td>
<td class="content">
- <b>(gdb)</b> disassemble
+ <b>(lldb)</b> disassemble --frame<br>
+ <b>(lldb)</b> di -f
</td>
</tr>
<tr><td class="header" colspan="2">Disassemble any functions named <b>main</b>.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> disassemble --name main<br>
- <b>(lldb)</b> di -n main
+ <b>(gdb)</b> disassemble main
</td>
<td class="content">
- <b>(gdb)</b> disassemble main
+ <b>(lldb)</b> disassemble --name main<br>
+ <b>(lldb)</b> di -n main
</td>
</tr>
<tr><td class="header" colspan="2">Disassemble an address range.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> disassemble --start-address 0x1eb8 --end-address 0x1ec3<br>
- <b>(lldb)</b> di -s 0x1eb8 -e 0x1ec3<br>
+ <b>(gdb)</b> disassemble 0x1eb8 0x1ec3
</td>
<td class="content">
- <b>(gdb)</b> disassemble 0x1eb8 0x1ec3
+ <b>(lldb)</b> disassemble --start-address 0x1eb8 --end-address 0x1ec3<br>
+ <b>(lldb)</b> di -s 0x1eb8 -e 0x1ec3<br>
</td>
</tr>
<tr><td class="header" colspan="2">Disassemble 20 instructions from a given address.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> disassemble --start-address 0x1eb8 --count 20<br>
- <b>(lldb)</b> di -s 0x1eb8 -c 20<br>
+ <b>(gdb)</b> x/20i 0x1eb8
</td>
<td class="content">
- <b>(gdb)</b> x/20i 0x1eb8
+ <b>(lldb)</b> disassemble --start-address 0x1eb8 --count 20<br>
+ <b>(lldb)</b> di -s 0x1eb8 -c 20<br>
</td>
</tr>
<tr><td class="header" colspan="2">Show mixed source and disassembly for the current function for the current frame.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> disassemble --frame --mixed<br>
- <b>(lldb)</b> di -f -m
+ n/a
</td>
<td class="content">
- n/a
+ <b>(lldb)</b> disassemble --frame --mixed<br>
+ <b>(lldb)</b> di -f -m
</td>
</tr>
<tr><td class="header" colspan="2">Disassemble the current function for the current frame and show the opcode bytes.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> disassemble --frame --bytes<br>
- <b>(lldb)</b> di -f -b
+ n/a
</td>
<td class="content">
- n/a
+ <b>(lldb)</b> disassemble --frame --bytes<br>
+ <b>(lldb)</b> di -f -b
</td>
</tr>
<tr><td class="header" colspan="2">Disassemble the current source line for the current frame.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> disassemble --line<br>
- <b>(lldb)</b> di -l
+ n/a
</td>
<td class="content">
- n/a
+ <b>(lldb)</b> disassemble --line<br>
+ <b>(lldb)</b> di -l
</td>
</tr>
@@ -876,101 +882,101 @@
<table class="stats" width="620" cellspacing="0">
<tr>
- <td class="hed" width="50%">LLDB</td>
<td class="hed" width="50%">GDB</td>
+ <td class="hed" width="50%">LLDB</td>
</tr>
<tr><td class="header" colspan="2">List the main executable and all dependent shared libraries.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> image list<br>
+ <b>(gdb)</b> info shared<br>
</td>
<td class="content">
- <b>(gdb)</b> info shared<br>
+ <b>(lldb)</b> image list<br>
</td>
</tr>
<tr><td class="header" colspan="2">Lookup information for a raw address in the executable or any shared libraries.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> image lookup --address 0x1ec4<br>
- <b>(lldb)</b> im loo -a 0x1ec4<br>
+ <b>(gdb)</b> info symbol 0x1ec4<br>
</td>
<td class="content">
- <b>(gdb)</b> info symbol 0x1ec4<br>
+ <b>(lldb)</b> image lookup --address 0x1ec4<br>
+ <b>(lldb)</b> im loo -a 0x1ec4<br>
</td>
</tr>
<tr><td class="header" colspan="2">Lookup functions matching a regular expression in a binary.</td></tr>
<tr>
<td class="content">
+ <b>(gdb)</b> info function <FUNC_REGEX><br>
+ </td>
+ <td class="content">
This one finds debug symbols:<br>
<b>(lldb)</b> image lookup -r -n <FUNC_REGEX><br><br>
This one finds non-debug symbols:<br>
<b>(lldb)</b> image lookup -r -s <FUNC_REGEX><br><br>
Provide a list of binaries as arguments to limit the search.
</td>
- <td class="content">
- <b>(gdb)</b> info function <FUNC_REGEX><br>
- </td>
</tr>
<tr><td class="header" colspan="2">Lookup information for an address in <b>a.out</a> only.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> image lookup --address 0x1ec4 a.out<br>
- <b>(lldb)</b> im loo -a 0x1ec4 a.out<br>
</td>
<td class="content">
+ <b>(lldb)</b> image lookup --address 0x1ec4 a.out<br>
+ <b>(lldb)</b> im loo -a 0x1ec4 a.out<br>
</td>
</tr>
<tr><td class="header" colspan="2">Lookup information for for a type <code>Point</code> by name.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> image lookup --type Point<br>
- <b>(lldb)</b> im loo -t Point<br>
+ <b>(lldb)</b> ptype Point<br>
</td>
<td class="content">
- <b>(lldb)</b> ptype Point<br>
+ <b>(lldb)</b> image lookup --type Point<br>
+ <b>(lldb)</b> im loo -t Point<br>
</td>
</tr>
<tr><td class="header" colspan="2">Dump all sections from the main executable and any shared libraries.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> image dump sections<br>
+ <b>(gdb)</b> maintenance info sections<br>
</td>
<td class="content">
- <b>(gdb)</b> maintenance info sections<br>
+ <b>(lldb)</b> image dump sections<br>
</td>
</tr>
<tr><td class="header" colspan="2">Dump all sections in the <b>a.out</b> module.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> image dump sections a.out<br>
</td>
<td class="content">
+ <b>(lldb)</b> image dump sections a.out<br>
</td>
</tr>
<tr><td class="header" colspan="2">Dump all symbols from the main executable and any shared libraries.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> image dump symtab<br>
</td>
<td class="content">
+ <b>(lldb)</b> image dump symtab<br>
</td>
</tr>
<tr><td class="header" colspan="2">Dump all symbols in <b>a.out</b> and <b>liba.so</b>.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> image dump symtab a.out liba.so<br>
</td>
<td class="content">
+ <b>(lldb)</b> image dump symtab a.out liba.so<br>
</td>
</tr>
@@ -983,17 +989,17 @@
<p>
<table class="stats" width="620" cellspacing="0">
<tr>
- <td class="hed" width="50%">LLDB</td>
<td class="hed" width="50%">GDB</td>
+ <td class="hed" width="50%">LLDB</td>
</tr>
<tr><td class="header" colspan="2">Echo text to the screen.</td></tr>
<tr>
<td class="content">
- <b>(lldb)</b> script print "Here is some text"<br>
+ <b>(gdb)</b> echo Here is some text\n<br>
</td>
<td class="content">
- <b>(gdb)</b> echo Here is some text\n<br>
+ <b>(lldb)</b> script print "Here is some text"<br>
</td>
</tr>
More information about the lldb-commits
mailing list