MCPcopy Create free account
hub / github.com/assaultcube/AC / stackdumper

Method stackdumper

source/src/tools.cpp:390–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388struct signalbinder
389{
390 static void stackdumper(int sig)
391 {
392 printf("stacktrace:\n");
393#if !defined(STANDALONE)
394 if(clientlogfile) clientlogfile->printf("stacktrace\n");
395#endif
396 const int BTSIZE = 25;
397 void *array[BTSIZE];
398 int n = backtrace(array, BTSIZE);
399 char **symbols = backtrace_symbols(array, n);
400 for(int i = 0; i < n; i++)
401 {
402 printf("%s\n", symbols[i]);
403#if !defined(STANDALONE)
404 if(clientlogfile) clientlogfile->printf("%s\n", symbols[i]);
405#endif
406 }
407 free(symbols);
408
409 fatal("AssaultCube error (%d)", sig);
410
411 }
412
413 signalbinder()
414 {

Callers

nothing calls this directly

Calls 2

fatalFunction · 0.70
printfMethod · 0.45

Tested by

no test coverage detected