Created
          May 15, 2020 08:31 
        
      - 
      
 - 
        
Save Musinux/6c8a7d1ca50c31309a9d6745b842ad3b to your computer and use it in GitHub Desktop.  
Revisions
- 
        
Musinux created this gist
May 15, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #include <unistd.h> #include <execinfo.h> void print_backtrace () { void *array[10]; size_t size; // get void*'s for all entries on the stack size = backtrace(array, 10); // print out all the frames to stderr backtrace_symbols_fd(array, size, STDERR_FILENO); } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ #ifndef UTILS_H #define UTILS_H void print_backtrace (); #endif /* ifndef UTILS_H */