mirror of
https://github.com/tmate-io/tmate.git
synced 2025-04-23 10:58:50 +02:00
Unify tmate-debug.c with tmate-ssh-server
This commit is contained in:
parent
9fc6e96444
commit
e5f6e68fad
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
void tmate_print_stack_trace(void) {}
|
void tmate_print_stack_trace(void) {}
|
||||||
void tmate_catch_sigsegv(void) {}
|
void tmate_catch_sigsegv(void) {}
|
||||||
|
void tmate_preload_trace_lib(void) {}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@ -84,8 +85,7 @@ void tmate_print_stack_trace(void)
|
|||||||
free (strings);
|
free (strings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void handle_crash(int sig)
|
||||||
static void handle_crash(__unused int sig)
|
|
||||||
{
|
{
|
||||||
/* TODO send stack trace to server */
|
/* TODO send stack trace to server */
|
||||||
const char *what = sig == SIGSEGV ? "SIGSEGV" : "SIGABRT";
|
const char *what = sig == SIGSEGV ? "SIGSEGV" : "SIGABRT";
|
||||||
@ -102,4 +102,11 @@ void tmate_catch_sigsegv(void)
|
|||||||
signal(SIGSEGV, handle_crash);
|
signal(SIGSEGV, handle_crash);
|
||||||
signal(SIGABRT, handle_crash);
|
signal(SIGABRT, handle_crash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tmate_preload_trace_lib(void)
|
||||||
|
{
|
||||||
|
void *array[1];
|
||||||
|
backtrace(array, 1);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#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 */
|
/* tmate-debug.c */
|
||||||
extern void tmate_print_stack_trace(void);
|
extern void tmate_print_stack_trace(void);
|
||||||
extern void tmate_catch_sigsegv(void);
|
extern void tmate_catch_sigsegv(void);
|
||||||
|
extern void tmate_preload_trace_lib(void);
|
||||||
|
|
||||||
/* tmate-msg.c */
|
/* tmate-msg.c */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user