カテゴリ:C

2007-01-17 Wed


既に起動しているプロセスをgdbで制御する方法 [開発][C]


http://www.geekpage.jp/blog/?id=2007/1/17

-g付きでコンパイルしている必要はありますが、

$ gdb -p プロセス番号


こんな感じで、起動時に指定しなくても、あとからでも指定できるんですね。



2006-05-20 Sat


valgrind の使い方 [C]


メモリ周りのバグを見つけるのに役立つツール Valgrind の使い方について

http://221.112.61.214/~kzk/column/valgrind.html

via 忘れた……


2006-02-24 Fri


ポインタ不要論 [C]


http://www.01-tec.com/document/without_pointer.html

NEW PROGRAMING MAGAZINE Spring2001 の記事。
ポインタはバグを誘発しやすいので、STL(StandardTemplateLibrary)を使おうという話し。

ちなみにポインタの理解、という話しでは、



正誤表
http://kmaebashi.com/seiha/

POINTER (書籍の元となったページ)
http://kmaebashi.com/programmer/pointer.html

がお奨め。ポインタが苦手な私としては、目から鱗がポロポロだった。


2006-01-13 Fri


colorgcc 出力を色付けしてくれる gcc の wrapper [C]


http://vimrc.hp.infoseek.co.jp/diary/2005-11.html

で取り上げられていた話題。試してみた。

~$ colorgcc hello.c -o hello
In file included from /usr/include/fuse/fuse.h:19,
                 from /usr/include/fuse.h:9,
from hello.c:9:
 /usr/include/fuse/fuse_common.h:31:2: error: #error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
 hello.c:86: error: unknown field 'readdir' specified in initializer
 hello.c:86: warning: initialization from incompatible pointer type
 hello.c:87: warning: initialization from incompatible pointer type
 hello.c:88: warning: initialization from incompatible pointer type


実際には出力はカラーで、結構見やすい。