gdb実行方法

もうgdbがわっけわからんのでいろいろと。

準備


gcc -g ソースファイル


として、gdb実行用のファイルを作る必要がある。

gcc -g main.c


とすれば、

main.dSYM


というファイルが出来る。
これでgdbを使用してデバッグできるようになる。

起動


gdb 実行ファイル


これで起動。

GNU gdb 6.3.50-20050815 (Apple version gdb-1705) (Fri Jul 1 10:50:06 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .. done

(gdb)


がーっと出てくる。最初びっくりしたが、こんなもん。プログラムむっちゃいっぱいある。

コメント

このブログの人気の投稿

相互インクルード対策

make error "Circular"

gdb操作