タグ

関連タグで絞り込む (1)

タグの絞り込みを解除

裏技とgdbに関するiwwのブックマーク (1)

  • GDBでプロセスID表示とdefine値表示 - tail -f /var/log/こうちかずお.log

    プロセスID表示 runした後、 (gdb) info proc id を使う。 define値表示 gオプションでコンパイルすると定義内容が表示できないので、 (gdb) p FOOBAR No symbol "FOOBAR" in current context. (gdb) shell grep FOOBAR /usr/include/bar.h としていたが、-g3オプションだとprintで表示可能でしかもinfo macroでどこに定義されているのかがわかる。 2つの例 $ cat test.h /** * test.h * $Id$ */ #ifndef _TEST_H #define _TEST_H 1 #define TEST_STR "This is test" #endif /* _TEST_H */ $ cat test.c /** * test.c * $Id$ *

    GDBでプロセスID表示とdefine値表示 - tail -f /var/log/こうちかずお.log
    iww
    iww 2021/03/26
    『-g3オプションだとprintで表示可能でしかもinfo macroでどこに定義されているのかがわかる。』
  • 1