backtrace_symbols

Tom.Bucken at sybase.com Tom.Bucken at sybase.com
Sat Mar 7 06:39:15 EST 2009


Hi,

        I am producing stacktraces by calling backtrace to get the
stack and backtrace_symbols to print each frame.  backtrace_symbols
is returning some extra unprintable characters at the start of each
array entry.

        each array entry starts with this unprintable character (repeats
7 times followed by \n).

        0X8ff



void *arr[NUM_STACKFRAMES];
 int nSize = backtrace(arr, NUM_STACKFRAMES);
 char **sym = backtrace_symbols(arr, nSize);
  int ii;
  for (ii = 0; ii < nSize; ii++) {
     printf("%s\n", sym[ii]);
  }
  free(sym);


Is there a way to get each stack entry without seeing
the unprintable characters ?

Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20090306/b4965aee/attachment.htm>


More information about the Linuxppc-dev mailing list