AiCPlayer
Interface of aic vm - for rendering aspect, sensors, video records
dump_trace.c
Go to the documentation of this file.
1 /* vim:set ft=c ts=2 sw=2 sts=2 et cindent: */
2 
3 #include <execinfo.h>
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <string.h>
7 #include "buffer_sizes.h"
8 
9 void dump_trace()
10 {
11  void* buffer[BIG_BUF_SIZE];
12  memset(buffer, 0, sizeof(buffer));
13  const int calls = backtrace(buffer, sizeof(buffer) / sizeof(void*));
14  printf("~ ~ ~ ~\n");
15  printf("Oooh I'm gonna die. Good luck!\n\n");
16  backtrace_symbols_fd(buffer, calls, 1);
17  exit(EXIT_FAILURE);
18 }
void dump_trace()
Dump a backtrace if there is a segfault.
Definition: dump_trace.c:9
Define common buffer sizes.
#define BIG_BUF_SIZE
Bigger fixed-size buffers.
Definition: buffer_sizes.h:11