- 论坛徽章:
- 0
|
回复 #3 hugbee 的帖子
mt__trce Subroutine\r\n\r\nPurpose\r\nDumps traceback information into a lightweight core file.\r\n\r\nLibrary\r\nPTools Library (libptools_ptr.a)\r\n\r\nSyntax\r\n\r\nvoid mt__trce (int FileDescriptor, int Signal, struct sigcontext *Context, int Node);\r\n\r\nHere is an example fyi...\r\n#cat test.c\r\n//xlc test.c -lptools_ptr\r\n#include <stdio.h>\r\n\r\nint testfun1(int* i)\r\n{\r\n \r\n mt__trce(2, 0, NULL, 0);\r\n return (*i)++;\r\n}\r\n\r\nint testfun(int* i)\r\n{\r\n (*i)++;\r\n return testfun1(i);\r\n}\r\n\r\nint main(int argc, char* argv)\r\n{\r\n int a = 1;\r\n return testfun(&a);\r\n} \r\n\r\n#xlc test.c -lptools_ptr\r\n[root@test170b:/tmp]#./a.out\r\n+++PARALLEL TOOLS CONSORTIUM LIGHTWEIGHT COREFILE FORMAT version 1.0\r\n+++LCB 1.0 Mon Apr 28 17:41:05 2008 Generated by IBM AIX 5.3\r\n#\r\n+++ID Node 0 Process 2207826 Thread 1\r\n+++STACK\r\ntestfun1 : 0x00000020\r\ntestfun : 0x00000024\r\nmain : 0x00000020\r\n---STACK\r\n---ID Node 0 Process 2207826 Thread 1\r\n---LCB |
|