iPhone app開発ではデバッグにGDBを使うのですが、全然活用できていませんでした。しかしいちいちNSLogで出力しているのでは割に合わないというので、ちょっと調べて使ってみたらpコマンドが便利だというのが分かりました。
多分GDBをどれだけ流暢に使えるかでiPhone開発速度も全然変わってくるのだなぁというのが所感です。
###コマンド p(print)
shell>>
(gdb) p image
$2 = (UIImage *) 0x14f600
<<--
ポインタの場合 *変数とすることで中身を表示:
shell>>
(gdb) p *image
$2 = {
= { isa = 0x38a47510 },
members of UIImage:
_imageRef = 0x156270,
_imageFlags = {
named = 0,
imageOrientation = 3,
cached = 0,
stretchable = 0
}
}
<<--
###その他使うコマンド
- set
- next
- cont
- quit
- list
###Refs
http://rat.cis.k.hosei.ac.jp/article/devel/debugongccgdb3.html
http://www.dev.pei.jp/app/gdb/gdbcmd.html
http://www.madlabo.com/mad/edat/GDB/index.htm#SEC22
posted by
satoko on Mon 2 Feb 2009 at 15:33 with 0 comments