iOS debug lldb commands commonly used, po,

Source: Internet
Author: User
<span id="Label3"></p><p><p>LLDB Command Common (memo)</p></p><p><p>If you are going to run this in the simulator, you can enter the following in the "(lldb)" prompt:</p></p><pre><pre>(lldb) PO $eax</pre></pre><p><p>LLDB is the default debugger in xcode4.3 or later Versions. If you are using an older version of xcode, you are also gdb debugger. They have some basic same commands, so if your xcode uses a "(gdb)" hint instead of a "(lldb)" hint, you can do it more, without problems.</p></p><p><p>The "po" command is shorthand for "print object". "$eax" is a register of CUPS. In the case of an exception, this register will contain a pointer to an exception object. Note: $eax will only work in the emulator, if you debug on the device, you will need to use the "$r 0″ register.</p></p><p><p>For example, If you enter:</p></p><pre><pre>(lldb) PO [$eax class]</pre></pre><p><p>You will see something like this:</p></p><pre><pre>(id) $ = 0x01446e84 nsexception</pre></pre><p><p>These numbers are not important, but it is clear that the NSException object you are dealing with is Here.</p></p><p><p>You can call any method on this Object. For example:</p></p><pre><pre>(lldb) PO [$eax name]</pre></pre><p><p>This will output the name of the exception, here is the nsinvalidargumentexception, and:</p></p><pre><pre>(lldb) PO [$eax reason]</pre></pre><p><p>This will output an error message:</p></p><pre><pre>(unsigned Int) $4 = 114784400 Receiver () have no segue with identifier ' Modalsegue '</pre></pre><p><p></p></p><p><p>Note: When you use only the "po $eax", this command will call the "description" method and print out the object, in which case you will get the wrong message.</p></p><p><p></p></p><p><p></p></p><p><p></p></p><p><p>Utility LLDB Command</p></p><p><p>Command name Usage description</p></p> <table> <tbody> <tr> <td></td> </tr> <tr> <td>Expr</td> <td>Expr expression</td> <td>A useful command that can dynamically execute a specified expression and print the result at debug Time.</td> </tr> <tr> <td>Po</td> <td>PO Expression</td> <td>Similar to expr, the object description method is called when the object is Printed. It's a shorthand for <em>print-object</em> .</td> </tr> <tr> <td>Print</td> <td>Print (type) expression</td> <td>is also a print command, you need to specify a type.</td> </tr> <tr> <td>Bt</td> <td>BT [all]</td> <td>The print call stack is a shorthand for the <em>thread BackTrace</em> , plus all to print the stack of all the Thread.</td> </tr> <tr> <td>BR L</td> <td>BR L</td> <td>It's a shorthand for the <em>breakpoint list</em> .</td> </tr> <tr> <td>Process Continue L</td> <td>Process continue</td> <td>Shorthand:<em>C</em></td> </tr> <tr> <td>Thread step-in L</td> <td>Thread step-in L</td> <td>Abbreviation:<em>S</em></td> </tr> <tr> <td>Thread Step-inst L</td> <td>Thread Step-inst L</td> <td>Abbreviation:<em>si</em></td> </tr> <tr> <td>Thread Step-over L</td> <td>Thread Step-over L</td> <td>Shorthand:<em>N</em></td> </tr> <tr> <td>Thread Step-over-inst L</td> <td>Thread Step-over-inst L</td> <td>Abbreviation:<em>ni</em></td> </tr> <tr> <td>Thread Step-out L</td> <td>Thread Step-out L</td> <td>Abbreviation:<em>F</em></td> </tr> <tr> <td>Thread List</td> <td>Thread List</td> <td>abbreviation:<em>th L</em></td> </tr> </tbody> </table><p><p></p></p><p><p>iOS debug lldb commands commonly used, po,</p></p></span>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.