文档章节

lldb 与 chisel 使用说明

sqdxxx
 sqdxxx
发布于 2017/07/11 12:54
字数 2507
阅读 14
收藏 0
点赞 0
评论 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. 给一个对象中变量添加一个查看点

© 著作权归作者所有

共有 人打赏支持
sqdxxx
粉丝 0
博文 2
码字总数 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
Advanced+Apple+Debugging(12)

在这一段剩下的章节中, 你将会聚焦于Python脚本上. 正如前一章中指出的, image lookup -rn命令正在被淘汰的路上. 是时候来创建一个漂亮的脚本来显示内容了. 下面是你现在用image lookup -rn命...

土匪猿
06/09
0
0
LLDB调试增强工具Chisel的安装

参考Chisel官方:https://github.com/facebook/chisel 需要安装homebrew环境的支持 brew updatebrew install chisel (其实第一个命令brew update可以不用执行,直接install就可以,我是在u...

Feng_999
2015/12/10
96
0
大道至简——RISC-V架构之魂(转载)

1: https://blog.csdn.net/zoomdy/article/details/795805292: https://blog.csdn.net/zoomdy/article/details/795807723: https://blog.csdn.net/zoomdy/article/details/795809494: RISC-V......

whoisliang
06/21
0
0
基于RISC-V架构的开源处理器及SoC研究综述(二)

2 基于RISC-V的开源处理器研究现状 目前基于RISC-V架构的开源处理器有很多,既有标量处理器Rocket,也有超标量处理器BOOM,还有面向嵌入式领域的Z-scale、PicoRV32等。 2.1 标量处理器——R...

leishangwen
2017/02/12
0
0
用 Sysdig 监控服务器和 Docker 容器

前言 伴随着容器技术的普及和落地,许多围绕在容器的开源工具也逐渐获得关注。新版本 Sysdig 在设计上充分运用了容器技术的成果,这主要体现在两个方面。一方面是 Sysdig 提供了可以快速运行...

cstsncv
2017/11/15
0
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

OSChina 周一乱弹 —— 如果是你喜欢的女同学找你借钱

Osc乱弹歌单(2018)请戳(这里) 【今日歌曲】 @guanglun :分享Michael Learns To Rock的单曲《Fairy Tale》 《Fairy Tale》- Michael Learns To Rock 手机党少年们想听歌,请使劲儿戳(这...

小小编辑
38分钟前
9
3
NNS域名系统之域名竞拍

0x00 前言 其实在官方文档中已经对域名竞拍的过程有详细的描述,感兴趣的可以移步http://doc.neons.name/zh_CN/latest/nns_protocol.html#id30 此处查阅。 我这里主要对轻钱包开发中会用到的...

暖冰
今天
0
0
32.filter表案例 nat表应用 (iptables)

10.15 iptables filter表案例 10.16/10.17/10.18 iptables nat表应用 10.15 iptables filter表案例: ~1. 写一个具体的iptables小案例,需求是把80端口、22端口、21 端口放行。但是,22端口我...

王鑫linux
今天
0
0
shell中的函数&shell中的数组&告警系统需求分析

20.16/20.17 shell中的函数 20.18 shell中的数组 20.19 告警系统需求分析

影夜Linux
今天
0
0
Linux网络基础、Linux防火墙

Linux网络基础 ip addr 命令 :查看网口信息 ifconfig命令:查看网口信息,要比ip addr更明了一些 centos 7默认没安装ifconfig命令,可以使用yum install -y net-tools命令来安装。 ifconfig...

李超小牛子
今天
1
0
[机器学习]回归--Decision Tree Regression

CART决策树又称分类回归树,当数据集的因变量为连续性数值时,该树算法就是一个回归树,可以用叶节点观察的均值作为预测值;当数据集的因变量为离散型数值时,该树算法就是一个分类树,可以很...

wangxuwei
昨天
1
0
Redis做分布式无锁CAS的问题

因为Redis本身是单线程的,具备原子性,所以可以用来做分布式无锁的操作,但会有一点小问题。 public interface OrderService { public String getOrderNo();} public class OrderRe...

算法之名
昨天
11
0
143. Reorder List - LeetCode

Question 143. Reorder List Solution 题目大意:给一个链表,将这个列表分成前后两部分,后半部分反转,再将这两分链表的节点交替连接成一个新的链表 思路 :先将链表分成前后两部分,将后部...

yysue
昨天
1
0
数据结构与算法1

第一个代码,描述一个被称为BankAccount的类,该类模拟了银行中的账户操作。程序建立了一个开户金额,显示金额,存款,取款并显示余额。 主要的知识点联系为类的含义,构造函数,公有和私有。...

沉迷于编程的小菜菜
昨天
1
0
从为什么别的队伍总比你的快说起

在机场候检排队的时候,大多数情况下,别的队伍都要比自己所在的队伍快,并常常懊悔当初怎么没去那个队。 其实,最快的队伍只能有一个,而排队之前并不知道那个队快。所以,如果有六个队伍你...

我是菜鸟我骄傲
昨天
1
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

返回顶部
顶部