使用GDB调试iOS应用程序

问题描述:

有谁知道关于使用GDB for MacOS和iOS进行调试的非常好的教程,书籍或文章?特别是覆盖Apple添加的命令(如“po”(打印对象)以及标准GDB命令)的内容。谢谢!使用GDB调试iOS应用程序

您是否尝试过gdb本身?您可以在'(gdb)'提示符下键入'help'以获取命令类别列表,'help'获取给定类别中的命令列表,'help'可以获得特定命令的帮助。例如:

(gdb) help data 
Examining data. 

List of commands: 

append -- Append target code/data to a local file 
call -- Call a function in the program 
delete display -- Cancel some expressions to be displayed when program stops 
delete mem -- Delete memory region 
disable display -- Disable some expressions to be displayed when program stops 
disable mem -- Disable memory region 
disassemble -- Disassemble a specified section of memory 
display -- Print value of expression EXP each time the program stops 
dump -- Dump target code/data to a local file 
enable display -- Enable some expressions to be displayed when program stops 
enable mem -- Enable memory region 
inspect -- Same as "print" command 
invoke-block -- Invoke the function associated with the block passed in as the first 
mem -- Define attributes for memory region 
output -- Like "print" but don't put in value history and don't print newline 
print -- Print value of expression EXP 
print-object -- Ask an Objective-C object to print itself 
printf -- Printf "printf format string" 
ptype -- Print definition of type TYPE 
restore -- Restore the contents of FILE to target memory 
set -- Evaluate expression EXP and assign result to variable VAR 
set variable -- Evaluate expression EXP and assign result to variable VAR 
undisplay -- Cancel some expressions to be displayed when program stops 
whatis -- Print data type of expression EXP 
x -- Examine memory: x/FMT ADDRESS 

Type "help" followed by command name for full documentation. 
Command name abbreviations are allowed if unambiguous. 

这不会帮助你多少,如果你从来没有调试的程序,但是如果你知道如何使用调试器做它可能是你所需要的。