Advanced+apple+debugging (2)

Source: Internet
Author: User

LLDB Official documents

Help commands

Open a terminal window and type Lldb. Lldb will quickly come out there and simply type in there. Help command:

(LLDB) Help
This will show all available commands, including custom commands loaded from ~/.lldbinit, but may be displayed later
Page32image6336.png
There are quite a few lldb commands to use here.
However, many commands contain several subcommands, and these subcommands have their own related documents.
Take the breakpoint command as an example. Type the document to view the breakpoint command by following the instructions:

(LLDB) Help Breakpoint
You will see the following output:

Commands for operating in breakpoints (see "Help B" for shorthand.)
Syntax:breakpoint <subcommand> [<command-options>]
The following subcommands is supported:
Clear--Delete or disable breakpoints matching the specified
source file and line.
Command--Commands for adding, removing and listing Lldb Commands
Executed when a breakpoint was hit.
Delete--delete the specified breakpoint (s). If No breakpoints
is specified, delete them all.
Disable--Disable the specified breakpoint (s) without deleting
them. If None is specified, disable all breakpoints.
Enable-enable the specified disabled breakpoint (s). If No
Breakpoints is specified, enable all of them.
List--list some or all breakpoints at configurable levels of
Detail.
Modify--Modify the options on a breakpoint or set of breakpoints
In the executable. If No breakpoint is specified,
Acts on the last created breakpoint. With the exception
OF-E,-D and-i, passing an empty argument clears
The modification.
Name--Commands to manage name tags for breakpoints
Set--Sets a breakpoint or set of breakpoints in the
Executable.
For particular subcommand, type ' help <command>
<subcommand> '.
Here you can see a few supported subcommands. To view the documentation for the breakpoint name command, you can enter the following:

(LLDB) Help breakpoint name
You will see the following output:

The following subcommands is supported:
Add--Add a name to the breakpoints provided.
Delete--delete a name from the breakpoints provided.
List--list either the names for a breakpoint or the breakpoints
For a given name.
For particular subcommand, type ' help <command>
<subcommand> '.
If you don't understand breakpoint name right now, don't worry that you will soon understand breakpoints and all the commands behind it. From now on, help is the most important command you have to remember.

The pertinent order

Sometimes you don't know the name of the command you want to search for, but you know that it contains keywords or phrases that can show you the right direction. Apropos is doing it for you. It's kind of like searching for something on the web with a search engine.
Apropos is case-insensitive and will return any results that match in the LLDB document, such as searching for anything related to Swift:

(LLDB) Apropos Swift
You will see the following output:

The following built-in commands may relate to ' swift ':
Breakpoint Set--sets a breakpoint or set of breakpoints in
The executable.
Expression--Evaluate an expression (objc++ or Swift) in
The current program context, using user defined variables and variables
Currently in scope.
Language Swift--A set of commands for operating on the Swift
Language Runtime.
Language Swift Demangle--Demangle a swift mangled name
Language Swift RefCount--Inspect The reference count data for a swift
Object
The following settings variables may relate to ' swift ':
Target.swift-framework-search-paths--List of directories to be
Searched when locating frameworks for Swift.
Target.swift-module-search-paths--List of directories to be searched
When locating modules for Swift.
Target.use-all-compiler-flags--Try to use compiler the flags for all
Modules when setting up the Swift expression parser, not just the main
Executable.
This will choose to remove all content related to the word Swift. The first is the related command, then the LLDB setting that controls the lldb operation.
You can also use apropos to search for a specific sentence. For example, if you are searching for content related to reference counting, you can use the following command:

(LLDB) Apropos "reference count"
The following built-in commands may relate to ' reference count ':
Language Swift RefCount--Inspect The reference count data for a swift
Object
Target Modules List--list current executable and dependent shared
Library images.
Note that love wraps the word "reference count" in double quotes. Apropos will only receive a search parameter, so double quotes can make them necessary as a separate parameter.
Not feeling neat? Apropos is a handy tool for querying. It's not as complex as a modern internet search engine, but you can find what you want in the usual practice.
Why are we learning this?
It is easy to forget the large number of LLDB commands we are going to learn, but simply keep the two commands of help and apropos in mind. These are the basics of querying command information and you'll be using them all the way through debugging.

Advanced+apple+debugging (2)

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.