JM プロジェクトは、主に Linux 関連のマニュアルページの日本語ページを翻訳・公開しています。
... このプログラムを動かした際の実行例である。 $ cc -rdynamic prog.c -o prog $ ./prog 3 backtrace() returned 8 addresses ./prog(myfunc3+0x5c) [0x80487f0] ./prog [0x8048871] ./prog(myfunc+0x21) [0x8048894] ./prog(myfunc+0x1a) [0x804888d] ./prog(myfunc+0x1a) ... ソース #include < execinfo.h > #include < stdio.h > #include < stdlib.h > #include < unistd.h > #define BT_BUF_SIZE 100 void myfunc3(void) { int nptrs; void *buffer[BT_BUF_SIZE]; char **strings; nptrs = backtrace(buffer, BT_BUF_SIZE); printf("backtrace() ... < nptrs; j++) printf("%s\n", strings[j]); free(strings); } static void /* "static" はシンボルを公開しないことを意味する */ myfunc2(void) { myfunc3(); } void myfunc(int ncalls) { if (ncalls > 1) myfunc(ncalls - 1); else myfunc2(); } int main(int argc, c ... ... このプログラムを動かした際の実行例である。 $ cc -rdynamic prog.c -o prog $ ./prog 3 backtrace() returned 8 addresses ./prog(myfunc3+0x5c) [0x80487f0] ./prog [0x8048871] ./prog(myfunc+0x21) [0x8048894] ./prog(myfunc+0x1a) [0x804888d] ./prog(myfunc+0x1a) ... ソース #include < execinfo.h > #include < stdio.h > #include < stdlib.h > #include < unistd.h > #define BT_BUF_SIZE 100 void myfunc3(void) { int nptrs; void *buffer[BT_BUF_SIZE]; char **strings; nptrs = backtrace(buffer, BT_BUF_SIZE); printf("backtrace() ... < nptrs; j++) printf("%s\n", strings[j]); free(strings); } static void /* "static" はシンボルを公開しないことを意味する */ myfunc2(void) { myfunc3(); } void myfunc(int ncalls) { if (ncalls > 1) myfunc(ncalls - 1); else myfunc2(); } int main(int argc, c ... ... このプログラムを動かした際の実行例である。 $ cc -rdynamic prog.c -o prog $ ./prog 3 backtrace() returned 8 addresses ./prog(myfunc3+0x5c) [0x80487f0] ./prog [0x8048871] ./prog(myfunc+0x21) [0x8048894] ./prog(myfunc+0x1a) [0x804888d] ./prog(myfunc+0x1a) ... ソース #include < execinfo.h > #include < stdio.h > #include < stdlib.h > #include < unistd.h > #define BT_BUF_SIZE 100 void myfunc3(void) { int nptrs; void *buffer[BT_BUF_SIZE]; char **strings; nptrs = backtrace(buffer, BT_BUF_SIZE); printf("backtrace() ... < nptrs; j++) printf("%s\n", strings[j]); free(strings); } static void /* "static" はシンボルを公開しないことを意味する */ myfunc2(void) { myfunc3(); } void myfunc(int ncalls) { if (ncalls > 1) myfunc(ncalls - 1); else myfunc2(); } int main(int argc, c ... 日本語の文書やマニュアルを配布している個人/プロジェクトへのリンクです。