IOS development diary 10-Bug debugging (lldb), 10-buglldb

Source: Internet
Author: User

IOS development diary 10-Bug debugging (lldb), 10-buglldb

Today, the blogger has some Bug debugging needs and encountered some difficulties. I would like to share with you the hope to make common progress.

Xcode has the following Bug debugging methods:

1. breakpoint, Global breakpoint, and conditional breakpoint used with Nslog to locate bugs

2. Static Analysis tools: Analyze, static detection memory

3. Dynamic Analysis tools: Profile. The most common tools are Leaks (detecting memory Leaks) and Allocations (detecting memory overflow)

4. gdb debugging: debugging tool before Xcode4.0

5. lldb debugging: debugging tool after Xcode4.0

Today, I will share with you how to use lldb to become a Bug handler.

LLDB

LLDB is an open-source debugger with REPL features and C ++ and Python plug-ins. LLDB is bound to Xcode and exists in the console at the bottom of the main window. The debugger allows you to pause the program at a specific time. You can view the value of the variable, execute custom commands, and perform the program progress according to the steps you think are appropriate.

At the same time, let's start our journey by printing variables in the debugger.

Basic

Here is a simple applet that prints a string. Note that the breakpoint has been added to 8th rows. You can click the side slot of the Xcode source code window to create a breakpoint.

The program stops running on this line, and the console is opened, allowing us to interact with the debugger. So what should we do?

Help

The simplest command isHelpIt lists all the commands. If you forget what a command is for or want to know more, you can useHelp <command>To learn more details, suchHelp printOrHelp thread. If you even forgetHelpWhat is a command? You can try it.Help. However, if you know how to do this, you probably haven't forgotten this command.

Related Article

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.