mirror of
https://github.com/tmate-io/tmate.git
synced 2026-01-23 02:24:06 +00:00
Fix building with or without backtrace(3)
backtrace(3) and execinfo.h are GNU extensions and may or may not be available, and they may be provided via libexecinfo. Fix detection of libexecinfo and allow building without any support of backtrace, in which case we let kernel create core dump. Fixes #116 #117
This commit is contained in:
parent
608763a41a
commit
3f6c6d4447
2 changed files with 15 additions and 0 deletions
|
|
@ -1,10 +1,19 @@
|
|||
#ifdef HAVE_EXECINFO_H
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <regex.h>
|
||||
#include <signal.h>
|
||||
#include "tmate.h"
|
||||
|
||||
#ifndef HAVE_BACKTRACE
|
||||
|
||||
void tmate_print_stack_trace(void) {}
|
||||
void tmate_catch_sigsegv(void) {}
|
||||
|
||||
#else
|
||||
|
||||
#if DEBUG
|
||||
|
||||
static int print_resolved_stack_frame(const char *frame)
|
||||
|
|
@ -88,3 +97,4 @@ void tmate_catch_sigsegv(void)
|
|||
{
|
||||
signal(SIGSEGV, handle_sigsegv);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue