site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On 05/01/2005, at 7:04 AM, darwin-dev-request@lists.apple.com wrote: El 29/12/2004, a las 15:55, Geoffrey Schmit escribió: On 27/12/2004 at 8:08 PM, support@monkeybreadsoftware.de (Christian Schmitz) wrote: You see a stack trace in the crash report every time so I ask myself if this list of function names can be queried inside a thread so I could add it to an exception object. MoreBacktrace does: Unfortunately, I wasn't able to get MoreBacktraceTest to compile, at least under Mac OS X 10.3.7/Darwin 7.7.0, so can't confirm that it works. The MoreIsBetter library itself does seem to compile, but the test program doesn't. It complains that it can't find MoreMemory.h while compiling MoreControls.cp: ../../MoreControls/MoreControls.cp:89:24: MoreMemory.h: No such file or directory No idea why this might be so because the other files included from MoreControls.cp are found without any problems. If I cheat by copying MoreMemory.h over into the MoreControls directory, then the project compiles but doesn't link: ld: warning prebinding disabled because of undefined symbols ld: Undefined symbols: _MoreMemError I haven't looked at the MoreBacktrace code, but you should be able to generate backtraces pretty simply with the following code: typedef struct stack_frame { struct stack_frame* next; int junk; void* addr; }stack_frame_t; #define BT_MAX 32 #define SF_MAX 4096 #define BT_LOAD(bt) \ do \ { \ bzero(bt, sizeof(bt)); \ register stack_frame_t* sf; \ asm volatile("mr %0,r1" : "=r" (sf)); \ int i; \ for (i = 0; i < BT_MAX; i++) \ { \ bt[i] = sf->addr; \ if (sf->next < sf || sf->next > sf + SF_MAX) \ break; \ sf = sf->next; \ } \ } while(0); Then to use it: void* bt[BT_MAX]; BT_LOAD(bt); Sam _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... can a function get the list of which functions called itself for debug purpose? <http://developer.apple.com/samplecode/MoreIsBetter/listing41.html> This email sent to site_archiver@lists.apple.com
participants (1)
-
Sam Vaughan