2011-06-17 223 views
2

有誰知道關於使用GDB for MacOS和iOS進行調試的非常好的教程,書籍或文章?特別是覆蓋Apple添加的命令(如「po」(打印對象)以及標準GDB命令)的內容。謝謝!使用GDB調試iOS應用程序

回答

6

您是否嘗試過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. 

這不會幫助你多少,如果你從來沒有調試的程序,但是如果你知道如何使用調試器做它可能是你所需要的。