A Practical breakpoint debugging technique

Source: Internet
Author: User

"1. Normal breakpoint"

This has nothing to say, all the programmers will, the normal breakpoint is no conditional breakpoint, run to the breakpoint will debug, in a row to create a breakpoint shortcut key is: command+\

The next point is to highlight

"2. Conditional breakpoint"

Normal breakpoints can be added or not, we can also configure the properties of the breakpoint, set conditions, make the breakpoint more intelligent, right click on the breakpoint:

I use a loop as the test code:

The code in the loop is executed one step at a time, and if I want to interrupt the program at the time I is 3, write the conditions as follows:

When you set a condition for i==3, the program breaks when that condition occurs, not every time you arrive at that location. The output of the interrupt is as follows:

You can also set the Ignore parameter, ignoring the first n times of the breakpoint run, will be interrupted n+1.

The debug output is as follows:

Also, you can see how many times a function has been called, set the action parameter as follows, and note that you want to select automatically continue after evaluating actions.

The output results are as follows:

"3. Exception Breakpoint"

Sometimes crash will be inside the Mian function, and this breakpoint may stop at the problematic code. The Create exception breakpoint legend is as follows:

"4. Symbol Breakpoint Symbolic Breakpoint"

The creation of a symbolic breakpoint is also the same as an exception breakpoint. A generic symbolic breakpoint can break execution when you specify a [class name method name].

Configure the symbol breakpoint as follows: You can break execution when you execute the Viewdidload method to the Viewcontroller class.

If your symbol only writes a function name, it will break execution where the function name appears. will be interrupted when running to doanimation.

A Practical breakpoint debugging technique

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.