[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

internt backtrace igen :)



Har fundet et library der lader mig lave backtraces,
og har lavet en dummy funktion der bruges som signal
handler til SIGSEGV signaler.

#include <execinfo.h>

void iBacktrace(int iSignal)
{
  void *aTrace[10];
  char **tString; 
  int size, i;
 
  size = backtrace(aTrace, 10);
  tString = backtrace_symbols(aTrace, size);
  for (i = 0; i < size; i++)
    printf("%s\n", tString[i]);

  exit(0);
}

Ved at tilfoje -rdymanic som et flag til ld, oversaettes dele
at outputtet til funktions kald, og ikke bare adresser, men
argumenterne gives til funktionerne gives som offsets [0x4006207e].

ex. paa en linie i et backtrace ville vaere

a.out(init_argument+0x289) [0x809f021]

Her er binaer filen a.out, og funktionen er init_argument(),
men argumentet gives til funktionen er bare en adresse,

Nogen ideer til hvordan man let faar argumentet i laeselig tekst ?

mvh

Brian Graversen


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *