2011-08-24 17 views
9

Sto utilizzando il seguente codice per ottenere segnalazioni di crash dalla mia applicazione iOS:Ottieni informazioni specifiche sui thread nel rapporto sugli arresti anomali di iOS?

void *frames[128]; 
int i,len = backtrace(frames, 128); 
char **symbols = backtrace_symbols(frames,len); 

NSMutableString *buffer = [[NSMutableString alloc] initWithCapacity:4096]; 

NSBundle *bundle = [NSBundle mainBundle]; 
[buffer appendFormat:@"PComp version %@ build %@\n\n", 
    [bundle objectForInfoDictionaryKey:@"CFBundleVersion"], 
    [bundle objectForInfoDictionaryKey:@"CIMBuildNumber"]]; 
[buffer appendString:@"Uncaught C++ Exception\n"]; 
[buffer appendString:@"Stack trace:\n\n"]; 
for (i = 0; i < len; ++i) { 
    [buffer appendFormat:@"%4d - %s\n",i,symbols[i]]; 
} 

Questo sarà solo dare informazioni sul thread corrente? Come posso ottenere questa traccia dello stack per tutti i thread?

risposta

Problemi correlati