69179bd8c07ccd71e56ea185862d4c9359132ee8
[lldb.git] / lldb / www / lldb-gdb.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5 <link href="style.css" rel="stylesheet" type="text/css" />
6 <title>LLDB to GDB Command Map</title>
7 </head>
8
9 <body>
10     <div class="www_title">
11       The <strong>LLDB</strong> Debugger
12     </div>
13
14 <div id="container">
15     <div id="content">
16          <!--#include virtual="sidebar.incl"-->
17         <div id="middle">
18             <div class="post">
19
20                 <h1 class ="postheader">GDB to LLDB Command Map</h1>
21                 <div class="post">
22
23                     <p>Below is a table of GDB commands with the LLDB counterparts.
24                         The built in GDB-compatibility aliases in LLDB are also
25                         listed.  The full lldb command names are often long, but any
26                         unique short form can be used.  Instead of "<b>breakpoint set</b>",
27                         "<b>br se</b>" is also acceptable.</p>
28                 </div>
29                 <div class="postfooter"></div>
30
31                 <h1 class ="postheader">Execution Commands</h1>
32                 <div class="post">
33
34                     <p>
35
36                     <table class="stats" width="620" cellspacing="0">
37                     <tr>
38                         <td class="hed" width="50%">GDB</td>
39                         <td class="hed" width="50%">LLDB</td>
40                     </tr>
41
42                     <tr><td class="header" colspan="2">Launch a process no arguments.</td></tr>
43                         <td class="content">
44                             <b>(gdb)</b> run<br>
45                             <b>(gdb)</b> r
46                         </td>
47                         <td class="content">
48                             <b>(lldb)</b> process launch<br>
49                             <b>(lldb)</b> run<br>
50                             <b>(lldb)</b> r
51                         </td>
52                     </tr>
53
54
55                     <tr><td class="header" colspan="2">Launch a process with arguments <code>&lt;args&gt;</code>.</td></tr>
56                         <td class="content">
57                             <b>(gdb)</b> run &lt;args&gt;<br>
58                             <b>(gdb)</b> r &lt;args&gt;
59                         </td>
60                         <td class="content">
61                             <b>(lldb)</b> process launch -- &lt;args&gt;<br>
62                             <b>(lldb)</b> r &lt;args&gt;
63                         </td>
64                     </tr>
65
66                     <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>
67                         <td class="content">
68                             <b>%</b> gdb --args a.out 1 2 3<br>
69                             <b>(gdb)</b> run<br>
70                             ...<br>
71                             <b>(gdb)</b> run<br>
72                             ...<br>
73                         </td>
74                         <td class="content">
75                             <b>%</b> lldb -- a.out 1 2 3<br>
76                             <b>(lldb)</b> run<br>
77                             ...<br>
78                             <b>(lldb)</b> run<br>
79                             ...<br>
80                         </td>
81                     </tr>
82
83                     <tr><td class="header" colspan="2">Or:</td></tr>
84                         <td class="content">
85                             <b>(gdb)</b> set args 1 2 3<br>
86                             <b>(gdb)</b> run<br>
87                             ...<br>
88                             <b>(gdb)</b> run<br>
89                             ...<br>
90                         </td>
91                         <td class="content">
92                             <b>(lldb)</b> settings set target.run-args 1 2 3<br>
93                             <b>(lldb)</b> run<br>
94                             ...<br>
95                             <b>(lldb)</b> run<br>
96                             ...<br>
97                         </td>
98                     </tr>
99
100                     <tr><td class="header" colspan="2">Launch a process with arguments in new terminal window (Mac OS X only).</td></tr>
101                         <td class="content">
102                         </td>
103                         <td class="content">
104                             <b>(lldb)</b> process launch --tty -- &lt;args&gt;<br>
105                             <b>(lldb)</b> pro la -t -- &lt;args&gt;<br>
106                         </td>
107                     </tr>
108
109                     <tr><td class="header" colspan="2">Launch a process with arguments in existing terminal <cope>/dev/ttys006</code> (Mac OS X only).</td></tr>
110                         <td class="content">
111                         </td>
112                         <td class="content">
113                             <b>(lldb)</b> process launch --tty=/dev/ttys006 -- &lt;args&gt;<br>
114                             <b>(lldb)</b> pro la -t/dev/ttys006 -- &lt;args&gt;<br>
115                         </td>
116                     </tr>
117
118                     <tr><td class="header" colspan="2">Set environment variables for process before launching.</td></tr>
119                         <td class="content">
120                             <b>(gdb)</b> set env DEBUG 1<br>
121                         </td>
122                         <td class="content">
123                             <b>(lldb)</b> settings set target.env-vars DEBUG=1<br>
124                             <b>(lldb)</b> set se target.env-vars DEBUG=1<br>
125                             <b>(lldb)</b> env DEBUG=1<br>
126                         </td>
127                     </tr>
128
129                     <tr><td class="header" colspan="2">Unset environment variables for process before launching.</td></tr>
130                         <td class="content">
131                             <b>(gdb)</b> unset env DEBUG<br>
132                         </td>
133                         <td class="content">
134                             <b>(lldb)</b> settings remove target.env-vars DEBUG<br>
135                             <b>(lldb)</b> set rem target.env-vars DEBUG<br>
136                         </td>
137                     </tr>
138
139                     <tr><td class="header" colspan="2">Show the arguments that will be or were passed to the program when run.</td></tr>
140                         <td class="content">
141                             <b>(gdb)</b> show args<br>
142                             Argument list to give program being debugged when it is started is &quot;1 2 3&quot.<br>
143                         </td>
144                         <td class="content">
145                             <b>(lldb)</b> settings show target.run-args<br>
146                             target.run-args (array of strings) =<br>
147                             [0]: &quot;1&quot;<br>
148                             [1]: &quot;2&quot;<br>
149                             [2]: &quot;3&quot;<br>
150                         </td>
151                     </tr>
152
153
154                     <tr><td class="header" colspan="2">Set environment variables for process and launch process in one command.</td></tr>
155                         <td class="content">
156                         </td>
157                         <td class="content">
158                             <b>(lldb)</b> process launch -v DEBUG=1<br>
159                         </td>
160                     </tr>
161
162                     <tr><td class="header" colspan="2">Attach to a process with process ID 123.</td></tr>
163                     <tr>
164                         <td class="content">
165                             <b>(gdb)</b> attach 123
166                         </td>
167                         <td class="content">
168                             <b>(lldb)</b> process attach --pid 123<br>
169                             <b>(lldb)</b> attach -p 123
170                         </td>
171                     </tr>
172
173                     <tr><td class="header" colspan="2">Attach to a process named "a.out".</td></tr>
174                     <tr>
175                         <td class="content">
176                             <b>(gdb)</b> attach a.out
177                         </td>
178                         <td class="content">
179                             <b>(lldb)</b> process attach --name a.out<br>
180                             <b>(lldb)</b> pro at -n a.out
181                         </td>
182                     </tr>
183
184                     <tr><td class="header" colspan="2">Wait for a process named "a.out" to launch and attach.</td></tr>
185                     <tr>
186                         <td class="content">
187                             <b>(gdb)</b> attach -waitfor a.out
188                         </td>
189                         <td class="content">
190                             <b>(lldb)</b> process attach --name a.out --waitfor<br>
191                             <b>(lldb)</b> pro at -n a.out -w
192                         </td>
193                     </tr>
194
195                     <tr><td class="header" colspan="2">Attach to a remote gdb protocol server running on system "eorgadd", port 8000.</td></tr>
196                     <tr>
197                         <td class="content">
198                             <b>(gdb)</b> target remote eorgadd:8000
199                         </td>
200                         <td class="content">
201                             <b>(lldb)</b> gdb-remote eorgadd:8000
202                         </td>
203                     </tr>
204
205                     <tr><td class="header" colspan="2">Attach to a remote gdb protocol server running on the local system, port 8000.</td></tr>
206                     <tr>
207                         <td class="content">
208                             <b>(gdb)</b> target remote localhost:8000
209                         </td>
210                         <td class="content">
211                             <b>(lldb)</b> gdb-remote 8000
212                         </td>
213                     </tr>
214
215                     <tr><td class="header" colspan="2">Attach to a Darwin kernel in kdp mode on system "eorgadd".</td></tr>
216                     <tr>
217                         <td class="content">
218                             <b>(gdb)</b> kdp-reattach eorgadd
219                         </td>
220                         <td class="content">
221                             <b>(lldb)</b> kdp-remote eorgadd
222                         </td>
223                     </tr>
224
225                     <tr><td class="header" colspan="2">Do a source level single step in the currently selected thread.</td></tr>
226                     <tr>
227                         <td class="content">
228                             <b>(gdb)</b> step<br>
229                             <b>(gdb)</b> s
230                         </td>
231                         <td class="content">
232                             <b>(lldb)</b> thread step-in<br>
233                             <b>(lldb)</b> step<br>
234                             <b>(lldb)</b> s
235                         </td>
236                     </tr>
237
238
239                     <tr><td class="header" colspan="2">Do a source level single step over in the currently selected thread.</td></tr>
240                     <tr>
241                         <td class="content">
242                             <b>(gdb)</b> next<br>
243                             <b>(gdb)</b> n
244                         </td>
245                         <td class="content">
246                             <b>(lldb)</b> thread step-over<br>
247                             <b>(lldb)</b> next<br>
248                             <b>(lldb)</b> n<br>
249                         </td>
250                     </tr>
251
252                     <tr><td class="header" colspan="2">Do an instruction level single step in the currently selected thread.</td></tr>
253                     <tr>
254                         <td class="content">
255                             <b>(gdb)</b> stepi<br>
256                             <b>(gdb)</b> si
257                         </td>
258                         <td class="content">
259                             <b>(lldb)</b> thread step-inst<br>
260                             <b>(lldb)</b> si<br>
261                         </td>
262                     </tr>
263
264                     <tr><td class="header" colspan="2">Do an instruction level single step over in the currently selected thread.</td></tr>
265                     <tr>
266                         <td class="content">
267                             <b>(gdb)</b> nexti<br>
268                             <b>(gdb)</b> ni
269                         </td>
270                         <td class="content">
271                             <b>(lldb)</b> thread step-inst-over<br>
272                             <b>(lldb)</b> ni
273                         </td>
274                     </tr>
275
276                     <tr><td class="header" colspan="2">Step out of the currently selected frame.</td></tr>
277                     <tr>
278                         <td class="content">
279                             <b>(gdb)</b> finish<br>
280                         </td>
281                         <td class="content">
282                             <b>(lldb)</b> thread step-out<br>
283                             <b>(lldb)</b> finish<br>
284                         </td>
285                     </tr>
286
287                     <tr><td class="header" colspan="2">Return immediately from the currently selected frame, with an optional return value.</td></tr>
288                     <tr>
289                         <td class="content">
290                             <b>(gdb)</b> return &lt;RETURN EXPRESSION&gt;<br>
291                         </td>
292                         <td class="content">
293                             <b>(lldb)</b> thread return &lt;RETURN EXPRESSION&gt;<br>
294                         </td>
295                     </tr>
296
297                     <tr><td class="header" colspan="2">Backtrace and disassemble every time you stop.</td></tr>
298                     <tr>
299                         <td class="content">
300                         </td>
301                         <td class="content">
302                             <b>(lldb)</b> target stop-hook add<br>
303                             Enter your stop hook command(s).  Type 'DONE' to end.<br>
304                             &gt; bt<br>
305                             &gt; disassemble --pc<br>
306                             &gt; DONE<br>
307                             Stop hook #1 added.<br>
308                         </td>
309                     </tr>
310                     <tr><td class="header" colspan="2">Run until we hit line <b>12</b> or control leaves the current function.</td></tr>
311                     <tr>
312                         <td class="content">
313                             <b>(gdb)</b> until 12
314                         </td>
315                         <td class="content">
316                             <b>(lldb)</b> thread until 12
317                         </td>
318                     </tr>
319
320                     </table>
321                     <p>
322                 </div>
323                 <div class="postfooter"></div>
324
325                 <h1 class ="postheader">Breakpoint Commands</h1>
326                 <div class="post">
327
328                     <p>
329
330                     <table class="stats" width="620" cellspacing="0">
331                     <tr>
332                         <td class="hed" width="50%">GDB</td>
333                         <td class="hed" width="50%">LLDB</td>
334                     </tr>
335
336                     <tr><td class="header" colspan="2">Set a breakpoint at all functions named <b>main</b>.</td></tr>
337                     <tr>
338                         <td class="content">
339                             <b>(gdb)</b> break main
340                         </td>
341                         <td class="content">
342                             <b>(lldb)</b> breakpoint set --name main<br>
343                             <b>(lldb)</b> br s -n main<br>
344                             <b>(lldb)</b> b main
345                         </td>
346                     </tr>
347
348                     <tr><td class="header" colspan="2">Set a breakpoint in file <b>test.c</b> at line <b>12</b>.</td></tr>
349                     <tr>
350                         <td class="content">
351                             <b>(gdb)</b> break test.c:12
352                         </td>
353                         <td class="content">
354                             <b>(lldb)</b> breakpoint set --file test.c --line 12<br>
355                             <b>(lldb)</b> br s -f test.c -l 12<br>
356                             <b>(lldb)</b> b test.c:12
357                         </td>
358                     </tr>
359
360                     <tr><td class="header" colspan="2">Set a breakpoint at all C++ methods whose basename is <b>main</b>.</td></tr>
361                     <tr>
362                         <td class="content">
363                             <b>(gdb)</b> break main<br>
364                             <i>(Hope that there are no C functions named <b>main</b>)</i>.
365                         </td>
366                         <td class="content">
367                             <b>(lldb)</b> breakpoint set --method main<br>
368                             <b>(lldb)</b> br s -M main<br>
369                         </td>
370                     </tr>
371
372                     <tr><td class="header" colspan="2">Set a breakpoint at and object C function: <b>-[NSString stringWithFormat:]</b>.</td></tr>
373                     <tr>
374                         <td class="content">
375                             <b>(gdb)</b> break -[NSString stringWithFormat:]<br>
376                         </td>
377                         <td class="content">
378                             <b>(lldb)</b> breakpoint set --name "-[NSString stringWithFormat:]"<br>
379                             <b>(lldb)</b> b -[NSString stringWithFormat:]<br>
380                         </td>
381                     </tr>
382
383                     <tr><td class="header" colspan="2">Set a breakpoint at all Objective C methods whose selector is <b>count</b>.</td></tr>
384                     <tr>
385                         <td class="content">
386                             <b>(gdb)</b> break count<br>
387                             <i>(Hope that there are no C or C++ functions named <b>count</b>)</i>.
388                         </td>
389                         <td class="content">
390                             <b>(lldb)</b> breakpoint set --selector count<br>
391                             <b>(lldb)</b> br s -S count<br>
392                         </td>
393                     </tr>
394                     <tr><td class="header" colspan="2">Set a breakpoint by regular expression on function name.</td></tr>
395
396                     <tr>
397                         <td class="content">
398                             <b>(gdb)</b> rbreak regular-expression<br>
399                         </td>
400                         <td class="content">
401                             <b>(lldb)</b> breakpoint set --func-regex regular-expression<br>
402                             <b>(lldb)</b> br s -r regular-expression<br>
403                         </td>
404                     </tr>
405
406                     <tr><td class="header" colspan="2">Ensure that breakpoints by file and line work for #included .c/.cpp/.m files.</td></tr>
407
408                     <tr>
409                         <td class="content">
410                             <b>(gdb)</b> b foo.c:12<br>
411                         </td>
412                         <td class="content">
413                             <b>(lldb)</b> settings set target.inline-breakpoint-strategy always<br>
414                             <b>(lldb)</b> br s -f foo.c -l 12<br>
415                         </td>
416                     </tr>
417
418                     <tr><td class="header" colspan="2">Set a breakpoint by regular expression on source file contents.</td></tr>
419
420                     <tr>
421                         <td class="content">
422                             <b>(gdb)</b> shell grep -e -n pattern source-file<br>
423                             <b>(gdb)</b> break source-file:CopyLineNumbers<br>
424                         </td>
425                         <td class="content">
426                             <b>(lldb)</b> breakpoint set --source-pattern regular-expression --file SourceFile<br>
427                             <b>(lldb)</b> br s -p regular-expression -f file<br>
428                         </td>
429                     </tr>
430
431                     <tr><td class="header" colspan="2">Set a conditional breakpoint</td></tr>
432
433                     <tr>
434                         <td class="content">
435                             <b>(gdb)</b> break foo if strcmp(y,&quot;hello&quot;) == 0<br>
436                         </td>
437                         <td class="content">
438                             <b>(lldb)</b> breakpoint set --name foo --condition '(int)strcmp(y,&quot;hello&quot;) == 0'<br>
439                             <b>(lldb)</b> br s -n foo -c '(int)strcmp(y,&quot;hello&quot;) == 0'<br>
440                         </td>
441                     </tr>
442
443                     <tr><td class="header" colspan="2">List all breakpoints.</td></tr>
444                     <tr>
445                         <td class="content">
446                             <b>(gdb)</b> info break<br>
447                         </td>
448                         <td class="content">
449                             <b>(lldb)</b> breakpoint list<br>
450                             <b>(lldb)</b> br l<br>
451                         </td>
452                     </tr>
453
454                     <tr><td class="header" colspan="2">Delete a breakpoint.</td></tr>
455                     <tr>
456                         <td class="content">
457                             <b>(gdb)</b> delete 1<br>
458                         </td>
459                         <td class="content">
460                             <b>(lldb)</b> breakpoint delete 1<br>
461                             <b>(lldb)</b> br del 1<br>
462                         </td>
463                     </tr>
464
465                     </table>
466                     <p>
467                 </div>
468                 <div class="postfooter"></div>
469
470                 <h1 class ="postheader">Watchpoint Commands</h1>
471                 <div class="post">
472
473                     <p>
474
475                     <table class="stats" width="620" cellspacing="0">
476                     <tr>
477                         <td class="hed" width="50%">GDB</td>
478                         <td class="hed" width="50%">LLDB</td>
479                     </tr>
480
481                     <tr><td class="header" colspan="2">Set a watchpoint on a variable when it is written to.</td></tr>
482                     <tr>
483                         <td class="content">
484                             <b>(gdb)</b> watch global_var
485                         </td>
486                         <td class="content">
487                             <b>(lldb)</b> watchpoint set variable global_var<br>
488                             <b>(lldb)</b> wa s v global_var<br>
489                         </td>
490                     </tr>
491
492                     <tr><td class="header" colspan="2">Set a watchpoint on a memory location when it is written into. The size of the region to watch for defaults to the pointer size if no '-x byte_size' is specified.
493                         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>
494                     <tr>
495                         <td class="content">
496                             <b>(gdb)</b> watch -location g_char_ptr
497                         </td>
498                         <td class="content">
499                             <b>(lldb)</b> watchpoint set expression -- my_ptr<br>
500                             <b>(lldb)</b> wa s e -- my_ptr<br>
501                       </td>
502                     </tr>
503
504                     <tr><td class="header" colspan="2">Set a condition on a watchpoint</b>.</td></tr>
505                     <tr>
506                         <td class="content">
507                         </td>
508                         <td class="content">
509                             <b>(lldb)</b> watch set var global<br>
510                             <b>(lldb)</b> watchpoint modify -c '(global==5)'<br>
511                             <b>(lldb)</b> c<br>
512                             ...<br>
513                             <b>(lldb)</b> bt<br>
514                             * thread #1: tid = 0x1c03, 0x0000000100000ef5 a.out`modify + 21 at main.cpp:16, stop reason = watchpoint 1<br>
515                               frame #0: 0x0000000100000ef5 a.out`modify + 21 at main.cpp:16<br>
516                               frame #1: 0x0000000100000eac a.out`main + 108 at main.cpp:25<br>
517                               frame #2: 0x00007fff8ac9c7e1 libdyld.dylib`start + 1<br>
518                             <b>(lldb)</b> frame var global<br>
519                             (int32_t) global = 5<br>
520                         </td>
521                    </tr>
522
523                    <tr><td class="header" colspan="2">List all watchpoints.</td></tr>
524                     <tr>
525                         <td class="content">
526                             <b>(gdb)</b> info break<br>
527                         </td>
528                         <td class="content">
529                             <b>(lldb)</b> watchpoint list<br>
530                             <b>(lldb)</b> watch l<br>
531                         </td>
532                     </tr>
533
534                     <tr><td class="header" colspan="2">Delete a watchpoint.</td></tr>
535                     <tr>
536                         <td class="content">
537                             <b>(gdb)</b> delete 1<br>
538                         </td>
539                         <td class="content">
540                             <b>(lldb)</b> watchpoint delete 1<br>
541                             <b>(lldb)</b> watch del 1<br>
542                         </td>
543                     </tr>
544
545                     </table>
546                     <p>
547                 </div>
548
549             <div class="postfooter"></div>
550             <h1 class ="postheader">Examining Variables</h1>
551                 <div class="post">
552                     <p>
553                     <table class="stats" width="620" cellspacing="0">
554                     <tr>
555                         <td class="hed" width="50%">GDB</td>
556                         <td class="hed" width="50%">LLDB</td>
557                     </tr>
558
559                     <tr><td class="header" colspan="2">Show the arguments and local variables for the current frame.</td></tr>
560                     <tr>
561                         <td class="content">
562                             <b>(gdb)</b> info args<br>
563                             and<br>
564                             <b>(gdb)</b> info locals<br>
565                         </td>
566                         <td class="content">
567                             <b>(lldb)</b> frame variable<br>
568                             <b>(lldb)</b> fr v<br>
569                         </td>
570                     </tr>
571
572                     <tr><td class="header" colspan="2">Show the local variables for the current frame.</td></tr>
573                     <tr>
574                         <td class="content">
575                             <b>(gdb)</b> info locals<br>
576                         </td>
577                         <td class="content">
578                             <b>(lldb)</b> frame variable --no-args<br>
579                             <b>(lldb)</b> fr v -a<br>
580                         </td>
581                     </tr>
582
583                     <tr><td class="header" colspan="2">Show the contents of local variable "bar".</td></tr>
584                     <tr>
585                         <td class="content">
586                             <b>(gdb)</b> p bar<br>
587                         </td>
588                         <td class="content">
589                             <b>(lldb)</b> frame variable bar <br>
590                             <b>(lldb)</b> fr v bar <br>
591                             <b>(lldb)</b> p bar <br>
592                         </td>
593                     </tr>
594
595                     <tr><td class="header" colspan="2">Show the contents of local variable "bar" formatted as hex.</td></tr>
596                     <tr>
597                         <td class="content">
598                             <b>(gdb)</b> p/x bar<br>
599                         </td>
600                         <td class="content">
601                             <b>(lldb)</b> frame variable --format x bar <br>
602                             <b>(lldb)</b> fr v -f x bar <br>
603                         </td>
604                     </tr>
605
606                     <tr><td class="header" colspan="2">Show the contents of global variable "baz".</td></tr>
607                     <tr>
608                         <td class="content">
609                             <b>(gdb)</b> p baz<br>
610                         </td>
611                         <td class="content">
612                             <b>(lldb)</b> target variable baz <br>
613                             <b>(lldb)</b> ta v baz <br>
614                         </td>
615                     </tr>
616
617                     <tr><td class="header" colspan="2">Show the global/static variables defined in the current source file.</td></tr>
618                     <tr>
619                         <td class="content">
620                             n/a<br>
621                         </td>
622                         <td class="content">
623                             <b>(lldb)</b> target variable <br>
624                             <b>(lldb)</b> ta v <br>
625                         </td>
626                     </tr>
627
628                     <tr><td class="header" colspan="2">Display the variables "argc" and "argv" every time you stop.</td></tr>
629                     <tr>
630                         <td class="content">
631                             <b>(gdb)</b> display argc<br>
632                             <b>(gdb)</b> display argv<br>
633                         </td>
634                         <td class="content">
635                             <b>(lldb)</b> target stop-hook add --one-liner "frame variable argc argv"<br>
636                             <b>(lldb)</b> ta st a -o "fr v argc argv"<br>
637                             <b>(lldb)</b> display argc<br>
638                             <b>(lldb)</b> display argv<br>
639                         </td>
640                     </tr>
641
642                     <tr><td class="header" colspan="2">Display the variables "argc" and "argv" only when you stop in the function named <b>main</b>.</td></tr>
643                     <tr>
644                         <td class="content">
645                         </td>
646                         <td class="content">
647                             <b>(lldb)</b> target stop-hook add --name main --one-liner "frame variable argc argv"<br>
648                             <b>(lldb)</b> ta st a -n main -o "fr v argc argv"<br>
649                         </td>
650                     </tr>
651
652                     <tr><td class="header" colspan="2">Display the variable "*this" only when you stop in c class named <b>MyClass</b>.</td></tr>
653                     <tr>
654                         <td class="content">
655                         </td>
656                         <td class="content">
657                             <b>(lldb)</b> target stop-hook add --classname MyClass --one-liner "frame variable *this"<br>
658                             <b>(lldb)</b> ta st a -c MyClass -o "fr v *this"<br>
659                         </td>
660                     </tr>
661
662                     </table>
663                     <p>
664                 </div>
665
666
667
668
669             <h1 class ="postheader">Evaluating expressions</h1>
670                 <div class="post">
671                     <p>
672                     <table class="stats" width="620" cellspacing="0">
673                     <tr>
674                         <td class="hed" width="50%">GDB</td>
675                         <td class="hed" width="50%">LLDB</td>
676                     </tr>
677
678                     <tr><td class="header" colspan="2">Evaluating a generalized expression in the current frame.</td></tr>
679                     <tr>
680                         <td class="content">
681                             <b>(gdb)</b> print (int) printf ("Print nine: %d.", 4 + 5)<br>
682                               or if you don't want to see void returns: <br>
683                             <b>(gdb)</b> call (int) printf ("Print nine: %d.", 4 + 5)<br>
684                         </td>
685                         <td class="content">
686                             <b>(lldb)</b> expr (int) printf ("Print nine: %d.", 4 + 5)<br>
687                               or using the print alias:<br>
688                             <b>(lldb)</b> print (int) printf ("Print nine: %d.", 4 + 5)<br>
689                         </td>
690                     </tr>
691
692                     <tr><td class="header" colspan="2">Creating and assigning a value to a convenience variable.</td></tr>
693                     <tr>
694                         <td class="content">
695                             <b>(gdb)</b> set $foo = 5<br>
696                             <b>(gdb)</b> set variable $foo = 5<br>
697                               or using the print command <br>
698                             <b>(gdb)</b> print $foo = 5<br>
699                               or using the call command <br>
700                             <b>(gdb)</b> call $foo = 5<br>
701                               and if you want to specify the type of the variable:
702                             <b>(gdb)</b> set $foo = (unsigned int) 5<br>
703
704                         </td>
705                         <td class="content">
706                           In lldb you evaluate a variable declaration expression as you would write it in C:<br>
707                             <b>(lldb)</b> expr unsigned int $foo = 5<br>
708                         </td>
709                     </tr>
710
711                     <tr><td class="header" colspan="2">Printing the ObjC "description" of an object.</td></tr>
712                     <tr>
713                         <td class="content">
714                             <b>(gdb)</b> po [SomeClass returnAnObject]<br>
715                         </td>
716                         <td class="content">
717                             <b>(lldb)</b> expr -o -- [SomeClass returnAnObject]<br>
718                               or using the po alias:<br>
719                             <b>(lldb)</b> po [SomeClass returnAnObject]<br>
720                         </td>
721                     </tr>
722
723                     <tr><td class="header" colspan="2">Print the dynamic type of the result of an expression.</td></tr>
724                     <tr>
725                         <td class="content">
726                             <b>(gdb)</b> set print object 1<br>
727                             <b>(gdb)</b> p someCPPObjectPtrOrReference<br>
728                               only works for C++ objects.<br>
729                         </td>
730                         <td class="content">
731                             <b>(lldb)</b> expr -d 1 -- [SomeClass returnAnObject]<br>
732                             <b>(lldb)</b> expr -d 1 -- someCPPObjectPtrOrReference<br>
733                               or set dynamic type printing to be the default:
734                             <b>(lldb)</b> settings set target.prefer-dynamic run-target<br>
735                         </td>
736                     </tr>
737
738                     <tr><td class="header" colspan="2">Calling a function so you can stop at a breakpoint in the function.</td></tr>
739                     <tr>
740                         <td class="content">
741                             <b>(gdb)</b> set unwindonsignal 0<br>
742                             <b>(gdb)</b> p function_with_a_breakpoint()<br>
743                         </td>
744                         <td class="content">
745                             <b>(lldb)</b> expr -i 0 -- function_with_a_breakpoint()<br>
746                         </td>
747                     </tr>
748
749                     <tr><td class="header" colspan="2">Calling a function that crashes, and stopping when the function crashes.</td></tr>
750                     <tr>
751                         <td class="content">
752                             <b>(gdb)</b> set unwindonsignal 0<br>
753                             <b>(gdb)</b> p function_which_crashes()<br>
754                         </td>
755                         <td class="content">
756                             <b>(lldb)</b> expr -u 0 -- function_which_crashes()<br>
757                         </td>
758                     </tr>
759
760
761                     </table>
762                     <p>
763                 </div>
764
765             <h1 class ="postheader">Examining Thread State</h1>
766                 <div class="post">
767                     <p>
768                     <table class="stats" width="620" cellspacing="0">
769                     <tr>
770                         <td class="hed" width="50%">GDB</td>
771                         <td class="hed" width="50%">LLDB</td>
772                     </tr>
773
774
775                     <tr><td class="header" colspan="2">List the threads in your program.</td></tr>
776                     <tr>
777                         <td class="content">
778                             <b>(gdb)</b> info threads<br>
779                         </td>
780                         <td class="content">
781                             <b>(lldb)</b> thread list<br>
782                         </td>
783                     </tr>
784
785                     <tr><td class="header" colspan="2">Select thread 1 as the default thread for subsequent commands.</td></tr>
786                     <tr>
787                         <td class="content">
788                             <b>(gdb)</b> thread 1<br>
789                         </td>
790                         <td class="content">
791                             <b>(lldb)</b> thread select 1<br>
792                             <b>(lldb)</b> t 1<br>
793                         </td>
794                     </tr>
795
796                     <tr><td class="header" colspan="2">Show the stack backtrace for the current thread.</td></tr>
797                     <tr>
798                         <td class="content">
799                             <b>(gdb)</b> bt<br>
800                         </td>
801                         <td class="content">
802                             <b>(lldb)</b> thread backtrace<br>
803                             <b>(lldb)</b> bt<br>
804                         </td>
805                     </tr>
806
807                     <tr><td class="header" colspan="2">Show the stack backtraces for all threads.</td></tr>
808                     <tr>
809                         <td class="content">
810                             <b>(gdb)</b> thread apply all bt
811                         </td>
812                         <td class="content">
813                             <b>(lldb)</b> thread backtrace all<br>
814                             <b>(lldb)</b> bt all
815                         </td>
816                     </tr>
817
818                     <tr><td class="header" colspan="2">Backtrace the first five frames of the current thread.</td></tr>
819                     <tr>
820                         <td class="content">
821                             <b>(gdb)</b> bt 5
822                         </td>
823                         <td class="content">
824                             <b>(lldb)</b> thread backtrace -c 5<br>
825                             <b>(lldb)</b> bt 5 (<i>lldb-169 and later</i>)<br>
826                             <b>(lldb)</b> bt -c 5 (<i>lldb-168 and earlier</i>)
827                         </td>
828                     </tr>
829
830                     <tr><td class="header" colspan="2">Select a different stack frame by index for the current thread.</td></tr>
831                     <tr>
832                         <td class="content">
833                             <b>(gdb)</b> frame 12
834                         </td>
835                         <td class="content">
836                             <b>(lldb)</b> frame select 12<br>
837                             <b>(lldb)</b> fr s 12<br>
838                             <b>(lldb)</b> f 12<br>
839                         </td>
840                     </tr>
841
842                     <tr><td class="header" colspan="2">List information about the currently selected frame in the current thread.</td></tr>
843                     <tr>
844                         <td class="content">
845                         </td>
846                         <td class="content">
847                             <b>(lldb)</b> frame info<br>
848                         </td>
849                    </tr>
850
851                     <tr><td class="header" colspan="2">Select the stack frame that called the current stack frame.</td></tr>
852                     <tr>
853                         <td class="content">
854                             <b>(gdb)</b> up
855                         </td>
856                         <td class="content">
857                             <b>(lldb)</b> up<br>
858                             <b>(lldb)</b> frame select --relative=1<br>
859                         </td>
860                     </tr>
861
862                     <tr><td class="header" colspan="2">Select the stack frame that is called by the current stack frame.</td></tr>
863                     <tr>
864                         <td class="content">
865                             <b>(gdb)</b> down
866                         </td>
867                         <td class="content">
868                             <b>(lldb)</b> down<br>
869                             <b>(lldb)</b> frame select --relative=-1<br>
870                             <b>(lldb)</b> fr s -r-1<br>
871                         </td>
872                     </tr>
873
874                     <tr><td class="header" colspan="2">Select a different stack frame using a relative offset.</td></tr>
875                     <tr>
876                         <td class="content">
877                             <b>(gdb)</b> up 2<br>
878                             <b>(gdb)</b> down 3<br>
879                         </td>
880                         <td class="content">
881                             <b>(lldb)</b> frame select --relative 2<br>
882                             <b>(lldb)</b> fr s -r2<br>
883                             <br>
884                             <b>(lldb)</b> frame select --relative -3<br>
885                             <b>(lldb)</b> fr s -r-3<br>
886                         </td>
887                     </tr>
888
889                     <tr><td class="header" colspan="2">Show the general purpose registers for the current thread.</td></tr>
890                     <tr>
891                         <td class="content">
892                             <b>(gdb)</b> info registers<br>
893                         </td>
894                         <td class="content">
895                             <b>(lldb)</b> register read<br>
896                         </td>
897                     </tr>
898
899                     <tr><td class="header" colspan="2">Write a new decimal value '123' to the current thread register 'rax'.</td></tr>
900                     <tr>
901                         <td class="content">
902                             <b>(gdb)</b> p $rax = 123<br>
903                         </td>
904                         <td class="content">
905                             <b>(lldb)</b> register write rax 123<br>
906                         </td>
907                     </tr>
908
909                     <tr><td class="header" colspan="2">Skip 8 bytes ahead of the current program counter (instruction pointer). Note that we use backticks to evaluate an expression and insert the scalar result in LLDB.</td></tr>
910                     <tr>
911                         <td class="content">
912                             <b>(gdb)</b> jump *$pc+8<br>
913                         </td>
914                         <td class="content">
915                             <b>(lldb)</b> register write pc `$pc+8`<br>
916                         </td>
917                     </tr>
918
919                     <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
920                          the same format characters as <b>printf(3)</b> when possible.  Type "help format" to see the full list of format specifiers.</td></tr>
921                     <tr>
922                         <td class="content">
923                         </td>
924                         <td class="content">
925                             <b>(lldb)</b> register read --format i<br>
926                             <b>(lldb)</b> re r -f i<br>
927                                                         <br>
928                                                         <i>LLDB now supports the GDB shorthand format syntax but there can't be space after the command:</i><br>
929                             <b>(lldb)</b> register read/d<br>
930                         </td>
931                     </tr>
932
933                     <tr><td class="header" colspan="2">Show all registers in all register sets for the current thread.</td></tr>
934                     <tr>
935                         <td class="content">
936                             <b>(gdb)</b> info all-registers<br>
937                         </td>
938                         <td class="content">
939                             <b>(lldb)</b> register read --all<br>
940                             <b>(lldb)</b> re r -a<br>
941                         </td>
942                     </tr>
943
944                     <tr><td class="header" colspan="2">Show the values for the registers named "rax", "rsp" and "rbp" in the current thread.</td></tr>
945                     <tr>
946                         <td class="content">
947                             <b>(gdb)</b> info all-registers rax rsp rbp<br>
948                         </td>
949                         <td class="content">
950                             <b>(lldb)</b> register read rax rsp rbp<br>
951                         </td>
952                     </tr>
953
954                     <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>
955                     <tr>
956                         <td class="content">
957                             <b>(gdb)</b> p/t $rax<br>
958                         </td>
959                         <td class="content">
960                             <b>(lldb)</b> register read --format binary rax<br>
961                             <b>(lldb)</b> re r -f b rax<br>
962                                                         <br>
963                                                         <i>LLDB now supports the GDB shorthand format syntax but there can't be space after the command:</i><br>
964                                                         <b>(lldb)</b> register read/t rax<br>
965                                                         <b>(lldb)</b> p/t $rax<br>
966                         </td>
967                     </tr>
968
969                     <tr><td class="header" colspan="2">Read memory from address 0xbffff3c0 and show 4 hex uint32_t values.</td></tr>
970                     <tr>
971                         <td class="content">
972                             <b>(gdb)</b> x/4xw 0xbffff3c0<br>
973                         </td>
974                         <td class="content">
975                             <b>(lldb)</b> memory read --size 4 --format x --count 4 0xbffff3c0<br>
976                             <b>(lldb)</b> me r -s4 -fx -c4 0xbffff3c0<br>
977                             <b>(lldb)</b> x -s4 -fx -c4 0xbffff3c0<br>
978                                                         <br>
979                                                         <i>LLDB now supports the GDB shorthand format syntax but there can't be space after the command:</i><br>
980                             <b>(lldb)</b> memory read/4xw 0xbffff3c0<br>
981                             <b>(lldb)</b> x/4xw 0xbffff3c0<br>
982                             <b>(lldb)</b> memory read --gdb-format 4xw 0xbffff3c0<br>
983                         </td>
984                     </tr>
985
986                     <tr><td class="header" colspan="2">Read memory starting at the expression "argv[0]".</td></tr>
987                     <tr>
988                         <td class="content">
989                             <b>(gdb)</b> x argv[0]<br>
990                         </td>
991                         <td class="content">
992                             <b>(lldb)</b> memory read `argv[0]`<br>
993                                                         <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>
994                             <b>(lldb)</b> memory read --size `sizeof(int)` `argv[0]`<br>
995                         </td>
996                     </tr>
997
998                     <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>
999                     <tr>
1000                         <td class="content">
1001                           <b>(gdb)</b> set logging on<br>
1002                           <b>(gdb)</b> set logging file /tmp/mem.txt<br>
1003                           <b>(gdb)</b> x/512bx 0xbffff3c0<br>
1004                           <b>(gdb)</b> set logging off<br>
1005                         </td>
1006                         <td class="content">
1007                             <b>(lldb)</b> memory read --outfile /tmp/mem.txt --count 512 0xbffff3c0<br>
1008                             <b>(lldb)</b> me r -o/tmp/mem.txt -c512 0xbffff3c0<br>
1009                             <b>(lldb)</b> x/512bx -o/tmp/mem.txt 0xbffff3c0<br>
1010                         </td>
1011                     </tr>
1012
1013                     <tr><td class="header" colspan="2">Save binary memory data starting at 0x1000 and ending at 0x2000 to a file.</td></tr>
1014                     <tr>
1015                         <td class="content">
1016                             <b>(gdb)</b> dump memory /tmp/mem.bin 0x1000 0x2000
1017                         </td>
1018                         <td class="content">
1019                             <b>(lldb)</b> memory read --outfile /tmp/mem.bin --binary  0x1000 0x2000<br>
1020                             <b>(lldb)</b> me r -o /tmp/mem.bin -b 0x1000 0x2000<br>
1021                         </td>
1022                     </tr>
1023                     <tr><td class="header" colspan="2">Get information about a specific heap allocation (available on Mac OS X only).</td></tr>
1024                     <tr>
1025                         <td class="content">
1026                             <b>(gdb)</b> info malloc 0x10010d680
1027                         </td>
1028                         <td class="content">
1029                             <b>(lldb)</b> command script import lldb.macosx.heap<br>
1030                             <b>(lldb)</b> process launch --environment MallocStackLogging=1 -- [ARGS]<br>       
1031                             <b>(lldb)</b> malloc_info --stack-history 0x10010d680<br>
1032                         </td>
1033                     </tr>
1034                     <tr><td class="header" colspan="2">Get information about a specific heap allocation and cast the result to any dynamic type that can be deduced (available on Mac OS X only)</td></tr>
1035                     <tr>
1036                         <td class="content">
1037                         </td>
1038                         <td class="content">
1039                             <b>(lldb)</b> command script import lldb.macosx.heap<br>
1040                             <b>(lldb)</b> malloc_info --type 0x10010d680<br>
1041                         </td>
1042                     </tr>
1043                     <tr><td class="header" colspan="2">Find all heap blocks that contain a pointer specified by an expression EXPR (available on Mac OS X only).</td></tr>
1044                     <tr>
1045                         <td class="content">
1046                         </td>
1047                         <td class="content">
1048                             <b>(lldb)</b> command script import lldb.macosx.heap<br>
1049                             <b>(lldb)</b> ptr_refs EXPR <br>
1050                         </td>
1051                     </tr>
1052                     <tr><td class="header" colspan="2">Find all heap blocks that contain a C string anywhere in the block (available on Mac OS X only).</td></tr>
1053                     <tr>
1054                         <td class="content">
1055                         </td>
1056                         <td class="content">
1057                             <b>(lldb)</b> command script import lldb.macosx.heap<br>
1058                             <b>(lldb)</b> cstr_refs CSTRING<br>
1059                         </td>
1060                     </tr>
1061                     <tr><td class="header" colspan="2">Disassemble the current function for the current frame.</td></tr>
1062                     <tr>
1063                         <td class="content">
1064                             <b>(gdb)</b> disassemble
1065                         </td>
1066                         <td class="content">
1067                             <b>(lldb)</b> disassemble --frame<br>
1068                             <b>(lldb)</b> di -f
1069                         </td>
1070                     </tr>
1071
1072                     <tr><td class="header" colspan="2">Disassemble any functions named <b>main</b>.</td></tr>
1073                     <tr>
1074                         <td class="content">
1075                             <b>(gdb)</b> disassemble main
1076                         </td>
1077                         <td class="content">
1078                             <b>(lldb)</b> disassemble --name main<br>
1079                             <b>(lldb)</b> di -n main
1080                         </td>
1081                     </tr>
1082
1083                     <tr><td class="header" colspan="2">Disassemble an address range.</td></tr>
1084                     <tr>
1085                         <td class="content">
1086                             <b>(gdb)</b> disassemble 0x1eb8 0x1ec3
1087                         </td>
1088                         <td class="content">
1089                             <b>(lldb)</b> disassemble --start-address  0x1eb8 --end-address 0x1ec3<br>
1090                             <b>(lldb)</b> di -s 0x1eb8 -e 0x1ec3<br>
1091                         </td>
1092                     </tr>
1093
1094                     <tr><td class="header" colspan="2">Disassemble 20 instructions from a given address.</td></tr>
1095                     <tr>
1096                         <td class="content">
1097                             <b>(gdb)</b> x/20i 0x1eb8
1098                         </td>
1099                         <td class="content">
1100                             <b>(lldb)</b> disassemble --start-address  0x1eb8 --count 20<br>
1101                             <b>(lldb)</b> di -s 0x1eb8 -c 20<br>
1102                         </td>
1103                     </tr>
1104
1105                     <tr><td class="header" colspan="2">Show mixed source and disassembly for the current function for the current frame.</td></tr>
1106                     <tr>
1107                         <td class="content">
1108                             n/a
1109                         </td>
1110                         <td class="content">
1111                             <b>(lldb)</b> disassemble --frame --mixed<br>
1112                             <b>(lldb)</b> di -f -m
1113                         </td>
1114                     </tr>
1115
1116                     <tr><td class="header" colspan="2">Disassemble the current function for the current frame and show the opcode bytes.</td></tr>
1117                     <tr>
1118                         <td class="content">
1119                             n/a
1120                         </td>
1121                         <td class="content">
1122                             <b>(lldb)</b> disassemble --frame --bytes<br>
1123                             <b>(lldb)</b> di -f -b
1124                         </td>
1125                     </tr>
1126
1127                     <tr><td class="header" colspan="2">Disassemble the current source line for the current frame.</td></tr>
1128                     <tr>
1129                         <td class="content">
1130                             n/a
1131                         </td>
1132                         <td class="content">
1133                             <b>(lldb)</b> disassemble --line<br>
1134                             <b>(lldb)</b> di -l
1135                         </td>
1136                     </tr>
1137
1138                     </table>
1139                     <p>
1140                 </div>
1141                 <div class="postfooter"></div>
1142
1143                 <h1 class ="postheader">Executable and Shared Library Query Commands</h1>
1144                 <div class="post">
1145
1146                     <p>
1147
1148                     <table class="stats" width="620" cellspacing="0">
1149                     <tr>
1150                         <td class="hed" width="50%">GDB</td>
1151                         <td class="hed" width="50%">LLDB</td>
1152                     </tr>
1153
1154
1155                     <tr><td class="header" colspan="2">List the main executable and all dependent shared libraries.</td></tr>
1156                     <tr>
1157                         <td class="content">
1158                             <b>(gdb)</b> info shared<br>
1159                         </td>
1160                         <td class="content">
1161                             <b>(lldb)</b> image list<br>
1162                         </td>
1163                     </tr>
1164
1165                     <tr><td class="header" colspan="2">Look up information for a raw address in the executable or any shared libraries.</td></tr>
1166                     <tr>
1167                         <td class="content">
1168                             <b>(gdb)</b> info symbol 0x1ec4<br>
1169                         </td>
1170                         <td class="content">
1171                             <b>(lldb)</b> image lookup --address 0x1ec4<br>
1172                             <b>(lldb)</b> im loo -a 0x1ec4<br>
1173                         </td>
1174                     </tr>
1175
1176                     <tr><td class="header" colspan="2">Look up functions matching a regular expression in a binary.</td></tr>
1177                     <tr>
1178                         <td class="content">
1179                             <b>(gdb)</b> info function &lt;FUNC_REGEX&gt;<br>
1180                         </td>
1181                         <td class="content">
1182                             This one finds debug symbols:<br>
1183                             <b>(lldb)</b> image lookup -r -n &lt;FUNC_REGEX&gt;<br><br>
1184                             This one finds non-debug symbols:<br>
1185                             <b>(lldb)</b> image lookup -r -s &lt;FUNC_REGEX&gt;<br><br>
1186                             Provide a list of binaries as arguments to limit the search.
1187                         </td>
1188                     </tr>
1189
1190                     <tr><td class="header" colspan="2">Find full source line information.</td></tr>
1191                     <tr>
1192                         <td class="content">
1193                             <b>(gdb)</b> info line 0x1ec4<br>
1194                         </td>
1195                         <td class="content">
1196                           This one is a bit messy at present.  Do:<br><br>
1197                             <b>(lldb)</b> image lookup -v --address 0x1ec4<br><br>
1198                           and look for the LineEntry line, which will have the full source path and
1199                           line range information.<br>
1200                         </td>
1201                     </tr>
1202
1203                     <tr><td class="header" colspan="2">Look up information for an address in <b>a.out</b> only.</td></tr>
1204                     <tr>
1205                         <td class="content">
1206                         </td>
1207                         <td class="content">
1208                             <b>(lldb)</b> image lookup --address 0x1ec4 a.out<br>
1209                             <b>(lldb)</b> im loo -a 0x1ec4 a.out<br>
1210                         </td>
1211                     </tr>
1212
1213                     <tr><td class="header" colspan="2">Look up information for for a type <code>Point</code> by name.</td></tr>
1214                     <tr>
1215                         <td class="content">
1216                             <b>(gdb)</b> ptype Point<br>
1217                         </td>
1218                         <td class="content">
1219                             <b>(lldb)</b> image lookup --type Point<br>
1220                             <b>(lldb)</b> im loo -t Point<br>
1221                         </td>
1222                     </tr>
1223
1224                     <tr><td class="header" colspan="2">Dump all sections from the main executable and any shared libraries.</td></tr>
1225                     <tr>
1226                         <td class="content">
1227                             <b>(gdb)</b> maintenance info sections<br>
1228                         </td>
1229                         <td class="content">
1230                             <b>(lldb)</b> image dump sections<br>
1231                         </td>
1232                     </tr>
1233
1234                     <tr><td class="header" colspan="2">Dump all sections in the <b>a.out</b> module.</td></tr>
1235                     <tr>
1236                         <td class="content">
1237                         </td>
1238                         <td class="content">
1239                             <b>(lldb)</b> image dump sections a.out<br>
1240                         </td>
1241                     </tr>
1242
1243                     <tr><td class="header" colspan="2">Dump all symbols from the main executable and any shared libraries.</td></tr>
1244                     <tr>
1245                         <td class="content">
1246                         </td>
1247                         <td class="content">
1248                             <b>(lldb)</b> image dump symtab<br>
1249                         </td>
1250                     </tr>
1251
1252                     <tr><td class="header" colspan="2">Dump all symbols in <b>a.out</b> and <b>liba.so</b>.</td></tr>
1253                     <tr>
1254                         <td class="content">
1255                         </td>
1256                         <td class="content">
1257                             <b>(lldb)</b> image dump symtab a.out liba.so<br>
1258                         </td>
1259                     </tr>
1260
1261                     </table>
1262                     <p>
1263                 </div>
1264             <div class="postfooter"></div>
1265             <h1 class ="postheader">Miscellaneous</h1>
1266                 <div class="post">
1267                     <p>
1268                     <table class="stats" width="620" cellspacing="0">
1269                     <tr>
1270                         <td class="hed" width="50%">GDB</td>
1271                         <td class="hed" width="50%">LLDB</td>
1272                     </tr>
1273
1274                     <tr><td class="header" colspan="2">Search command help for a keyword.</td></tr>
1275                     <tr>
1276                         <td class="content">
1277                             <b>(gdb)</b> apropos keyword<br>
1278                         </td>
1279                         <td class="content">
1280                             <b>(lldb)</b> apropos keyword<br>
1281                         </td>
1282                     </tr>
1283
1284                     <tr><td class="header" colspan="2">Echo text to the screen.</td></tr>
1285                     <tr>
1286                         <td class="content">
1287                             <b>(gdb)</b> echo Here is some text\n<br>
1288                         </td>
1289                         <td class="content">
1290                             <b>(lldb)</b> script print &quot;Here is some text&quot;<br>
1291                         </td>
1292                     </tr>
1293
1294                     <tr><td class="header" colspan="2">Remap source file pathnames for the debug session.  If your source files are no longer located in the same location as when the program was built --- maybe the program was built on a different computer --- you need to tell the debugger how to find the sources at their local file path instead of the build system's file path.</td></tr>
1295                     <tr>
1296                         <td class="content">
1297                             <b>(gdb)</b> set pathname-substitutions /buildbot/path /my/path<br>
1298                         </td>
1299                         <td class="content">
1300                             <b>(lldb)</b> settings set target.source-map /buildbot/path /my/path<br>
1301                         </td>
1302                     </tr>
1303
1304                     <tr><td class="header" colspan="2">Supply a catchall directory to search for source files in.</td></tr>
1305                     <tr>
1306                         <td class="content">
1307                             <b>(gdb)</b> directory /my/path<br>
1308                         </td>
1309                         <td class="content">
1310                             (<i>No equivalent command - use the source-map instead.</i>)<br>
1311                         </td>
1312                     </tr>
1313
1314                     </table>
1315                     <p>
1316                 </div>
1317
1318                 <div class="postfooter"></div>
1319
1320                 <p>
1321
1322
1323             </div>
1324         </div>
1325     </div>
1326 </div>
1327 </body>
1328 </html>