IOS调试lldb命令常用,po,
2015-01-14 16:38
344 查看
实用LLDB命令
命令名
用法 说明
db不是万能的,可是没有gdb却是万万不能的。这里给大家简单介绍下iOS开发中最基本的gdb命令。
po是print-object的简写,可用来打印所有NSObject对象。使用举例如下:
(gdb) po self
<LauncherViewController: 0x552c570>
(gdb) po [self view]
<UIView: 0x544eb80; frame = (0 0; 320 411); autoresize = W+H; layer = <CALayer: 0x544ebb0>>
(gdb) print-object [self view]
<UIView: 0x544eb80; frame = (0 0; 320 411); autoresize = W+H; layer = <CALayer: 0x544ebb0>>
p是print的简写,可以用来打印所有的简单类型,如int, float,结构体等。使用举例如下:
(gdb) p self
$1 = (LauncherViewController *) 0x552c570
(gdb) p [[self view] size]
Unable to call function “objc_msgSend” at 0x1e7e08c: no return type information available.
To call this function anyway, you can cast the return type explicitly (e.g. ‘print (float) fabs (3.0)’)
(gdb) p (CGSize)[[self view] size]
$1 = {
width = 320,
height = 411
}
(gdb) print (CGSize)[[self view] size]
$2 = {
width = 320,
height = 411
}
call即是调用的意思。其实上述的po和p也有调用的功能。因此一般只在不需要显示输出,或是方法无返回值时使用call。使用举例如下:
(gdb) call [[self view]sizeToFit]
Unable to call function “objc_msgSend” at 0x1e7e08c: no return type information available.
To call this function anyway, you can cast the return type explicitly (e.g. ‘print (float) fabs (3.0)’)
(gdb) call (void)[[self view]sizeToFit]
(gdb) call [[self view] size]
Unable to call function “objc_msgSend” at 0x1e7e08c: no return type information available.
To call this function anyway, you can cast the return type explicitly (e.g. ‘print (float) fabs (3.0)’)
(gdb) call (void)[[self view] size]
**************************************************************************************************************
Xcode的调试器为用户提供了一个GDB的界面,GDB是GNU组织的开放源代码调试器。您可以在Xcode的图形界面里做任何事情;但是,如果您需要
您可以在命令行里使用GDB的命令。
要在一个调试的任务里输入GDB命令行命令:
在工具栏里点击Console Drawer (控制台抽屉窗口)按钮打开控制台。
您可以在控制台里查看Xcode调试器发送给GDB的命令,或者您可以直接在控制台里输入GDB命令。在控制台窗口里点击然后在gdb提示符后面 输入命令。
命 令 解释
break NUM 在指定的行上设置断点。
bt 显
示所有的调用栈帧。该命令可用来显示函数的调用顺序。
clear 删 除设置在特定源文件、特定行上的断点。其用法为:clear FILENAME:NUM。
continue 继续执行正在调试的程序。该命令用在程序
由于处理信号或断点而
导致停止运行
时。
display EXPR 每次程序停止后显示表达式的值。表达式由程序定 义的变量组成。
file FILE 装载指定的可执行文件进行调试。
help NAME 显 示指定命令的帮助信息。
info break 显
示当前断点清单,包括到达断点处的次数等。
info files 显 示被调试文件的详细信息。
info func 显示所有的函数名称。
info local 显 示当函数中的局部变量信息。
info prog 显示被调试程序的执行状 态。
info var 显示所有的全局和静态变量名称。
kill 终 止正被调试的程序。
list 显示源代码段。
make 在 不退出 gdb 的情况下运行 make 工具。
next 在 不单步执行进入其他函数的情况下,向前执行一行源代码。
print EXPR 显 示表达式 EXPR 的值。
print- object 打印一个对象
print (int) name 打印一个类型
print- object [artist description] 调用一个函数
set artist = @"test" 设置变量值
whatis 查
看变理的数据类型
命令名
用法 说明
expr | expr 表达式 | 可以在调试时动态执行指定表达式,并将结果打印出来,很有用的命令。 |
po | po 表达式 | 与expr类似,打印对象,会调用对象description方法。是print-object的简写 |
print (type) 表达式 | 也是打印命令,需要指定类型。 | |
bt | bt [all] | 打印调用堆栈,是thread backtrace的简写,加all可打印所有thread的堆栈。 |
br l | br l | 是breakpoint list的简写 |
process continue l | process continue | 简写:c |
thread step-in l | thread step-in l | 简写:s |
thread step-inst l | thread step-inst l | 简写:si |
thread step-over l | thread step-over l | 简写:n |
thread step-over-inst l | thread step-over-inst l | 简写:ni |
thread step-out l | thread step-out l | 简写:f |
thread list | thread list | 简写:th l |
po
po是print-object的简写,可用来打印所有NSObject对象。使用举例如下:(gdb) po self
<LauncherViewController: 0x552c570>
(gdb) po [self view]
<UIView: 0x544eb80; frame = (0 0; 320 411); autoresize = W+H; layer = <CALayer: 0x544ebb0>>
(gdb) print-object [self view]
<UIView: 0x544eb80; frame = (0 0; 320 411); autoresize = W+H; layer = <CALayer: 0x544ebb0>>
p
p是print的简写,可以用来打印所有的简单类型,如int, float,结构体等。使用举例如下:(gdb) p self
$1 = (LauncherViewController *) 0x552c570
(gdb) p [[self view] size]
Unable to call function “objc_msgSend” at 0x1e7e08c: no return type information available.
To call this function anyway, you can cast the return type explicitly (e.g. ‘print (float) fabs (3.0)’)
(gdb) p (CGSize)[[self view] size]
$1 = {
width = 320,
height = 411
}
(gdb) print (CGSize)[[self view] size]
$2 = {
width = 320,
height = 411
}
call
call即是调用的意思。其实上述的po和p也有调用的功能。因此一般只在不需要显示输出,或是方法无返回值时使用call。使用举例如下:(gdb) call [[self view]sizeToFit]
Unable to call function “objc_msgSend” at 0x1e7e08c: no return type information available.
To call this function anyway, you can cast the return type explicitly (e.g. ‘print (float) fabs (3.0)’)
(gdb) call (void)[[self view]sizeToFit]
(gdb) call [[self view] size]
Unable to call function “objc_msgSend” at 0x1e7e08c: no return type information available.
To call this function anyway, you can cast the return type explicitly (e.g. ‘print (float) fabs (3.0)’)
(gdb) call (void)[[self view] size]
**************************************************************************************************************
Xcode的调试器为用户提供了一个GDB的界面,GDB是GNU组织的开放源代码调试器。您可以在Xcode的图形界面里做任何事情;但是,如果您需要
您可以在命令行里使用GDB的命令。
要在一个调试的任务里输入GDB命令行命令:
在工具栏里点击Console Drawer (控制台抽屉窗口)按钮打开控制台。
您可以在控制台里查看Xcode调试器发送给GDB的命令,或者您可以直接在控制台里输入GDB命令。在控制台窗口里点击然后在gdb提示符后面 输入命令。
命 令 解释
break NUM 在指定的行上设置断点。
bt 显
示所有的调用栈帧。该命令可用来显示函数的调用顺序。
clear 删 除设置在特定源文件、特定行上的断点。其用法为:clear FILENAME:NUM。
continue 继续执行正在调试的程序。该命令用在程序
由于处理信号或断点而
导致停止运行
时。
display EXPR 每次程序停止后显示表达式的值。表达式由程序定 义的变量组成。
file FILE 装载指定的可执行文件进行调试。
help NAME 显 示指定命令的帮助信息。
info break 显
示当前断点清单,包括到达断点处的次数等。
info files 显 示被调试文件的详细信息。
info func 显示所有的函数名称。
info local 显 示当函数中的局部变量信息。
info prog 显示被调试程序的执行状 态。
info var 显示所有的全局和静态变量名称。
kill 终 止正被调试的程序。
list 显示源代码段。
make 在 不退出 gdb 的情况下运行 make 工具。
next 在 不单步执行进入其他函数的情况下,向前执行一行源代码。
print EXPR 显 示表达式 EXPR 的值。
print- object 打印一个对象
print (int) name 打印一个类型
print- object [artist description] 调用一个函数
set artist = @"test" 设置变量值
whatis 查
看变理的数据类型
相关文章推荐
- IOS调试lldb命令常用,po,
- IOS调试lldb命令常用po
- IOS调试lldb命令常用,po,
- IOS 调试lldb命令常用----po
- IOS调试lldb命令常用,po,
- IOS调试lldb命令常用,po, Xcode控制台调试
- iOS之 LLDB调试常用命令
- iOS开发之LLDB断点调试和常用命令
- IOS调试lldb命令常用
- xcode 中的LLDB常用调试命令
- iOS调试lldb命令
- ios 调试命令(oc用”po self“,swift用“frame variable self”)
- iOS_SN_LLDB常用命令
- (ios开发)lldb命令常用
- lldb常用调试命令
- IOS开发常用的调试命令
- ios 除了po命令之外的调试命令
- ios 调试技巧收藏二 lldb命令
- ios 调试技巧收藏二 lldb命令
- LLDB 调试常用命令