From 91979a226c674b18052e51707b84e4893d612a5c Mon Sep 17 00:00:00 2001 From: alexrayne Date: Tue, 14 Apr 2020 09:42:57 +0300 Subject: [PATCH] ubuntu18 + gcc5.4 miss some definitions of ucontext --- coffeecatch.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/coffeecatch.c b/coffeecatch.c index 9d7917c..33dab01 100644 --- a/coffeecatch.c +++ b/coffeecatch.c @@ -34,6 +34,9 @@ /* #undef NO_USE_SIGALTSTACK */ /* #undef USE_SILENT_SIGALTSTACK */ +// need by signal:ucontext for registers REG_xxx declare +#define _GNU_SOURCE + #include #include #include @@ -304,6 +307,9 @@ static native_code_global_struct native_code_g = pthread_key_t native_code_thread; #if (defined(USE_UNWIND) && !defined(USE_CORKSCREW)) +#ifndef _URC_OK +#define _URC_OK _URC_NO_REASON +#endif /* Unwind callback */ static _Unwind_Reason_Code coffeecatch_unwind_callback(struct _Unwind_Context* context, void* arg) { @@ -974,10 +980,14 @@ static const char* coffeecatch_desc_sig(int sig, int code) { break; case SIGTRAP: switch(code) { +#ifdef TRAP_BRKPT case TRAP_BRKPT: return "Process breakpoint"; +#endif +#ifdef TRAP_TRACE case TRAP_TRACE: return "Process trace trap"; +#endif default: return "Trap"; }