文档章节

lldb 与 chisel 使用说明

sqdxxx
 sqdxxx
发布于 2017/07/11 12:54
字数 2507
阅读 31
收藏 0

下面是来自lldb控制台中help命令的输出,自定义命令部分是来自chisel这个库的。做了一下简单翻译和说明。方便以后查阅。

For more information on any command, type 'help <command-name>'.

  • apropos -- List debugger commands related to a word or subject. 列出与所给关键词或主题相关的调试命令

  • breakpoint -- Commands for operating on breakpoints (see 'help b' for shorthand.) 对断点的一些操作命令

  • bugreport -- Commands for creating domain-specific bug reports. 创建特定领域bug报告单的命令 =.= 会生成详细的当前状态描述,应该是用于跟别人交流共同解决bug

  • command -- Commands for managing custom LLDB commands. 管理自定义的lldb命令

  • disassemble -- Disassemble specified instructions in the current target. Defaults to the current function for the current thread and stack frame.

  • expression -- Evaluate an expression on the current thread. Displays any returned value with LLDB's default formatting.在当前线程执行一个表达式,使用lldb默认格式展示任何返回结果

  • frame -- Commands for selecting and examing the current thread's stack frames.

  • gdb-remote -- Connect to a process via remote GDB server. If no host is specifed, localhost is assumed.

  • gui -- Switch into the curses based GUI mode.

  • help -- Show a list of all debugger commands, or give details about a specific command. 展示调试命令列表,或者给出关于特定命令的详细说明

  • kdp-remote -- Connect to a process via remote KDP server. If no UDP port is specified, port 41139 is assumed.

  • language -- Commands specific to a source language.

  • log -- Commands controlling LLDB internal logging.

  • memory -- Commands for operating on memory in the current target process.

  • platform -- Commands to manage and create platforms.

  • plugin -- Commands for managing LLDB plugins. 管理 插件

  • process -- Commands for interacting with processes on the current platform.

  • quit -- Quit the LLDB debugger. 退出LLDB调试器

  • register -- Commands to access registers for the current thread and stack frame.

  • script -- Invoke the script interpreter with provided code and display any results. Start the interactive interpreter if no code is supplied.

  • settings -- Commands for managing LLDB settings. 管理LLDB的设置

  • source -- Commands for examining source code described by debug information for the current target process. 通过调试信息查看当前进程源代码

  • target -- Commands for operating on debugger targets.

  • thread -- Commands for operating on one or more threads in the current process.对当前线程的操作 - 是很多命令的默认上下文

  • type -- Commands for operating on the type system.

  • version -- Show the LLDB debugger version. 展示LLDB调试器版本

  • watchpoint -- Commands for operating on watchpoints. 一些观测点相关的操作命令

Current command abbreviations (type 'help command alias' for more info):

  • add-dsym -- Add a debug symbol file to one of the target's current modules by specifying a path to a debug symbols file, or using the options to specify a module to download symbols for.
  • attach -- Attach to process by ID or name.
  • b -- Set a breakpoint using one of several shorthand formats. 设置断点
  • bt -- Show the current thread's call stack. Any numeric argument displays at most that many frames. The argument 'all' displays all threads. 展示当前线程调用栈。
  • c -- Continue execution of all threads in the current process. 继续执行当前进程的所有线程
  • call -- Evaluate an expression on the current thread. Displays any returned value with LLDB's default formatting. 在当前线程执行一个表达式,使用LLDB默认的格式展示所有返回结果。
  • continue -- Continue execution of all threads in the current process.继续执行当前进程的所有线程
  • detach -- Detach from the current target process.
  • di -- Disassemble specified instructions in the current target. Defaults to the current function for the current thread and stack frame.
  • dis -- Disassemble specified instructions in the current target. Defaults to the current function for the current thread and stack frame.
  • display -- Evaluate an expression at every stop (see 'help target stop-hook'.)
  • down -- Select a newer stack frame. Defaults to moving one frame, anumeric argument can specify an arbitrary number.
  • env -- Shorthand for viewing and setting environment variables.
  • exit -- Quit the LLDB debugger.
  • f -- Select the current stack frame by index from within the current thread (see 'thread backtrace'.)
  • file -- Create a target using the argument as the main executable.
  • finish -- Finish executing the current stack frame and stop after returning. Defaults to current thread unless specified.
  • image -- Commands for accessing information for one or more target modules.
  • j -- Set the program counter to a new address.
  • jump -- Set the program counter to a new address.
  • kill -- Terminate the current target process.
  • l -- List relevant source code using one of several shorthand formats.
  • list -- List relevant source code using one of several shorthand formats.
  • n -- Source level single step, stepping over calls. Defaults to current thread unless specified.
  • next -- Source level single step, stepping over calls. Defaults to current thread unless specified.
  • nexti -- Instruction level single step, stepping over calls. Defaults to current thread unless specified.
  • ni -- Instruction level single step, stepping over calls. Defaults to current thread unless specified.
  • p -- Evaluate an expression on the current thread. Displays any returned value with LLDB's default formatting.
  • parray -- Evaluate an expression on the current thread. Displays any returned value with LLDB's default formatting.
  • po -- Evaluate an expression on the current thread. Displays any returned value with formatting controlled by the type's author.
  • poarray -- Evaluate an expression on the current thread. Displays any returned value with LLDB's default formatting.
  • print -- Evaluate an expression on the current thread. Displays any returned value with LLDB's default formatting.
  • q -- Quit the LLDB debugger.
  • r -- Launch the executable in the debugger.
  • rbreak -- Sets a breakpoint or set of breakpoints in the executable.
  • repl -- Evaluate an expression on the current thread. Displays any returned value with LLDB's default formatting.
  • run -- Launch the executable in the debugger.
  • s -- Source level single step, stepping into calls. Defaults to current thread unless specified.
  • si -- Instruction level single step, stepping into calls. Defaults to current thread unless specified.
  • sif -- Step through the current block, stopping if you step directly into a function whose name matches the -TargetFunctionName.
  • step -- Source level single step, stepping into calls. Defaults to current thread unless specified.
  • stepi -- Instruction level single step, stepping into calls. Defaults to current thread unless specified.
  • t -- Change the currently selected thread.
  • tbreak -- Set a one-shot breakpoint using one of several shorthand formats.
  • undisplay -- Stop displaying expression at every stop (specified by stop-hook index.)
  • up -- Select an older stack frame. Defaults to moving one frame, a numeric argument can specify an arbitrary number.
  • x -- Read from the memory of the current target process.读取当前进程的内存

Current user-defined commands: (define by chisel)

当前用户自定义命令

  • alamborder -- Put a border around views with an ambiguous layout

  • alamunborder -- Removes the border around views with an ambiguous layout

  • binside -- Set a breakpoint for a relative address within the framework/library that's currently running. This does the work of finding the offset for the framework/library and sliding your address accordingly.

  • bmessage -- Set a breakpoint for a selector on a class, even if the class itself doesn't override that selector. It walks the hierarchy until it finds a class that does implement the selector and sets a conditional breakpoint there. 给一个类的方法添加一个断点,如果这个类本身没有重写这个方法。将会沿着继承关系寻找直到找到实现了这个方法的类并且添加一个条件断点。

  • border -- Draws a border around <viewOrLayer>. Color and width can be optionally provided. Additionally depth can be provided in order to recursively border subviews.在View或layer 上绘制一个边界。颜色宽度可以作为可选项提供。为了递归添加子View边界层次可以提供。

  • caflush -- Force Core Animation to flush. This will 'repaint' the UI but also may mess with ongoing animations. 强制核心动画刷新。这将重新绘制UI界面。但也可能打乱正在进行的动画

  • dcomponents -- Set debugging options for components.

  • dismiss -- Dismiss a presented view controller. 执行控制器模态消失

  • fa11y -- Find the views whose accessibility labels match labelRegex and puts the address of the first result on the clipboard.

  • flicker -- Quickly show and hide a view to quickly help visualize where it is.

  • fv -- Find the views whose class names match classNameRegex and puts the address of first on the clipboard. 通过正则匹配类名来查找一个View,并且把第一个地址放在剪切板上。

  • fvc -- Find the view controllers whose class names match classNameRegex and puts the address of first on the clipboard. 通过正则匹配类名来查找一个ViewController,并且把第一个地址放在剪切板上。

  • hide -- Hide a view or layer. 隐藏一个view或layer

  • mask -- Add a transparent rectangle to the window to reveal a possibly obscured or hidden view or layer's bounds 在窗口中添加一个透明矩形,以显示模糊或者隐藏的view和layer的边界。

  • mwarning -- simulate a memory warning 模拟一个内存警告

  • pa11y -- Print accessibility labels of all views in hierarchy of <aView>

  • pa11yi -- Print accessibility identifiers of all views in hierarchy of <aView>

  • pactions -- Print the actions and targets of a control. 打印NSControl的目标和动作

  • paltrace -- Print the Auto Layout trace for the given view. Defaults to the key window. 打印给定view的自动布局路径,默认view是keywindow。

  • panim -- Prints if the code is currently execution with a UIView animation block. 打印正在运行的UIView动画block

  • pbcopy -- Print object and copy output to clipboard 打印对象并且拷贝输出到剪切板

  • pblock -- Print the block`s implementation address and signature 打印block的实现地址和签名

  • pbundlepath -- Print application's bundle directory path. 打印应用bundle目录地址

  • pca -- Print layer tree from the perspective of the render server.

  • pcells -- Print the visible cells of the highest table view in the hierarchy. 打印最高层的tableview的可见cell

  • pclass -- Print the inheritance starting from an instance of any class. 打印从任何类的实例开始的继承

  • pcomponents -- Print a recursive description of components found starting from <aView>.

  • pcurl -- Print the NSURLRequest (HTTP) as curl command. 打印NSURLRequest对应的curl命令

  • pdata -- Print the contents of NSData object as string. 打印NSData对应的字符串

  • pdocspath -- Print application's 'Documents' directory path. 打印应用的Documents目录路径

  • pinternals -- Show the internals of an object by dereferencing it as a pointer. 通过将其解引用为指针来显示对象的内部。

  • pinvocation -- Print the stack frame, receiver, and arguments of the current invocation. It will fail to print all arguments if any arguments are variadic (varargs). 只支持32位系统模拟器和macOS

  • pivar -- Print the value of an object's named instance variable.

  • pjson -- Print JSON representation of NSDictionary or NSArray object 使用json格式打印字典或数组

  • pkp -- Print out the value of the key path expression using -valueForKeyPath: 使用kvc打印一个值

  • pmethods -- Print the class and instance methods of a class. 打印一个类的类方法和对象方法

  • poobjc -- Print the expression result, with the expression run in an ObjC++ context. (Shortcut for "expression -O -l ObjC++ -- " )

  • pproperties -- Print the properties of an instance or Class 打印一个对象或类的属性 - 不知道为什么执行报错

  • present -- Present a view controller. 呈现一个viewcontroller

  • presponder -- Print the responder chain starting from a specific responder. 打印给定的响应者开始的响应链

  • ptv -- Print the highest table view in the hierarchy. 打印最高层tableview

  • pvc -- Print the recursion descriedtion of <aViewController>. 递归打印控制器描述

  • pviews -- Print the recursion description of <aView>. 递归打印view及子view的描述

  • rcomponents -- Synchronously reflow and update root components found starting from <aView>.

  • setinput -- Input text into text field or text view that is first responder. 给第一响应者设置文字内容

  • settext -- Set text on text on a view by accessibility id.

  • show -- Show a view or layer. 显示一个view或者layer

  • slowanim -- Slows down animations. Works on the iOS Simulator and a device. 慢速动画,在模拟器和真机中都有效

  • taplog -- Log tapped view to the console. 打印一个view的点击事件

  • unborder -- Removes border around <viewOrLayer>. 移除边界

  • unmask -- Remove mask from a view or layer 从一个view或layer移除mask

  • unslowanim -- Turn off slow animations. 关闭慢速动画

  • visualize -- Open a UIImage, CGImageRef, UIView, or CALayer in Preview.app on your Mac. 使用预览应用打开UIImage、CGImageRef、UIView、CaLayer等类的截图

  • vs -- Interactively search for a view by walking the hierarchy. 交互式view视图树搜索

  • wivar -- Set a watchpoint for an object's instance variable. 给一个对象中变量添加一个查看点

© 著作权归作者所有

共有 人打赏支持
上一篇: NSString
sqdxxx
粉丝 0
博文 3
码字总数 6454
作品 0
海淀
程序员
私信 提问
通过Chisel加强LLDB的UI调试能力

引言: Chisel是一个加强LLDB调试能力的小插件.主要特点在于辅助界面开发调试时在控制台以尽可能直观的方式查看界面的元素和情况.为我们梳理视图,控制器以及类关系层级. 以及一些临时的界面调...

Snaiper
2016/02/16
47
0
教你使用faceBook的chisel来提高调试效率

首先如果使用lldb,最好你要学着使用chisel来提高效率,否则你会浪费很多的时间,除非你自己会写python脚本,自己封装一些lldb的命令。 安装chisel chisel的安装是十分简单,它是在终端通过b...

Snaiper
2016/02/17
27
0
LLDB 指令集合--Chisel

Chisel 是一个 LLDB 指令集合,用户辅助 iOS 应用差错。 示例代码: #!/usr/bin/python Example file with custom commands, located at /magical/commands/example.py import lldbimport f......

孔小菜
2015/04/10
1K
0
ios逆向小试牛刀之操作手记

一、环境准备 1、vmware中安装osx系统,参照链接:http://jingyan.baidu.com/article/ff411625b9011212e48237b4.html 2、osx上安装lldb命令行版(安装xcode6.4后lldb版本太低,会造成调试时指...

fallrain
2016/04/01
337
0
(转载)与调试器共舞 - LLDB 的华尔兹

你是否曾经苦恼于理解你的代码,而去尝试打印一个变量的值? 或者跳过一个函数调用来简化程序的行为? 或者短路一个逻辑检查? 或者伪造一个函数实现? 并且每次必须重新编译,从头开始? 构...

帅炸乌冬
2016/10/19
15
0

没有更多内容

加载失败,请刷新页面

加载更多

码云项目100,水一发

简单回顾一下: 早期构想最多的,是希望能将PHP一些类和编码分区做得更细,所以很多尝试。但不得不说,PHP的功能过于单一,是的,也许写C/C++扩展,可以解决问题,那我为什么不用C#或者Golan...

曾建凯
今天
3
0
Spring应用学习——AOP

1. AOP 1. AOP:即面向切面编程,采用横向抽取机制,取代了传统的继承体系的重复代码问题,如下图所示,性能监控、日志记录等代码围绕业务逻辑代码,而这部分代码是一个高度重复的代码,也就...

江左煤郎
今天
4
0
eclipse的版本

Eclipse各版本代号一览表 Eclipse的设计思想是:一切皆插件。Eclipse核心很小,其它所有功能都以插件的形式附加于Eclipse核心之上。 Eclipse基本内核包括:图形API(SWT/Jface),Java开发环...

mdoo
今天
3
0
SpringBoot源码:启动过程分析(一)

本文主要分析 SpringBoot 的启动过程。 SpringBoot的版本为:2.1.0 release,最新版本。 一.时序图 还是老套路,先把分析过程的时序图摆出来:时序图-SpringBoot2.10启动分析 二.源码分析 首...

Jacktanger
今天
6
0
小白带你认识netty(二)之netty服务端启动(上)

上一章 中的标准netty启动代码中,ServerBootstrap到底是如何启动的呢?这一章我们来瞅下。 server.group(bossGroup, workGroup);server.channel(NioServerSocketChannel.class).optio...

天空小小
今天
4
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部