mirror of
https://github.com/tmate-io/tmate.git
synced 2026-01-22 18:14:09 +00:00
Unify tmate-debug.c with tmate-ssh-server
This commit is contained in:
parent
9fc6e96444
commit
e5f6e68fad
2 changed files with 10 additions and 2 deletions
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
void tmate_print_stack_trace(void) {}
|
||||
void tmate_catch_sigsegv(void) {}
|
||||
void tmate_preload_trace_lib(void) {}
|
||||
|
||||
#else
|
||||
|
||||
|
|
@ -84,8 +85,7 @@ void tmate_print_stack_trace(void)
|
|||
free (strings);
|
||||
}
|
||||
|
||||
|
||||
static void handle_crash(__unused int sig)
|
||||
static void handle_crash(int sig)
|
||||
{
|
||||
/* TODO send stack trace to server */
|
||||
const char *what = sig == SIGSEGV ? "SIGSEGV" : "SIGABRT";
|
||||
|
|
@ -102,4 +102,11 @@ void tmate_catch_sigsegv(void)
|
|||
signal(SIGSEGV, handle_crash);
|
||||
signal(SIGABRT, handle_crash);
|
||||
}
|
||||
|
||||
void tmate_preload_trace_lib(void)
|
||||
{
|
||||
void *array[1];
|
||||
backtrace(array, 1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
1
tmate.h
1
tmate.h
|
|
@ -203,6 +203,7 @@ extern void tmate_reconnect_session(struct tmate_session *session, const char *m
|
|||
/* tmate-debug.c */
|
||||
extern void tmate_print_stack_trace(void);
|
||||
extern void tmate_catch_sigsegv(void);
|
||||
extern void tmate_preload_trace_lib(void);
|
||||
|
||||
/* tmate-msg.c */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue