diff --git a/src/os/unix/crashlog_unix.cpp b/src/os/unix/crashlog_unix.cpp --- a/src/os/unix/crashlog_unix.cpp +++ b/src/os/unix/crashlog_unix.cpp @@ -19,9 +19,6 @@ #if defined(__GLIBC__) /* Execinfo (and thus making stacktraces) is a GNU extension */ # include -#elif defined(SUNOS) -# include -# include #endif #if defined(__NetBSD__) @@ -70,38 +67,6 @@ class CrashLogUnix : public CrashLog { ); } -#if defined(SUNOS) - /** Data needed while walking up the stack */ - struct StackWalkerParams { - std::back_insert_iterator *output_iterator; ///< Buffer - int counter; ///< We are at counter-th stack level - }; - - /** - * Callback used while walking up the stack. - * @param pc program counter - * @param sig 'active' signal (unused) - * @param params parameters - * @return always 0, continue walking up the stack - */ - static int SunOSStackWalker(uintptr_t pc, int sig, void *params) - { - StackWalkerParams *wp = (StackWalkerParams *)params; - - /* Resolve program counter to file and nearest symbol (if possible) */ - Dl_info dli; - if (dladdr((void *)pc, &dli) != 0) { - fmt::format_to(*wp->output_iterator, " [{:02}] {}({}+0x{:x}) [0x{:x}]\n", - wp->counter, dli.dli_fname, dli.dli_sname, (int)((byte *)pc - (byte *)dli.dli_saddr), (uint)pc); - } else { - fmt::format_to(*wp->output_iterator, " [{:02}] [0x{:x}]\n", wp->counter, (uint)pc); - } - wp->counter++; - - return 0; - } -#endif - void LogStacktrace(std::back_insert_iterator &output_iterator) const override { fmt::format_to(output_iterator, "Stacktrace:\n"); @@ -114,15 +79,6 @@ class CrashLogUnix : public CrashLog { fmt::format_to(output_iterator, " [{:02}] {}\n", i, messages[i]); } free(messages); -#elif defined(SUNOS) - ucontext_t uc; - if (getcontext(&uc) != 0) { - fmt::format_to(output_iterator, " getcontext() failed\n\n"); - return buffer; - } - - StackWalkerParams wp = { &output_iterator, 0 }; - walkcontext(&uc, &CrashLogUnix::SunOSStackWalker, &wp); #else fmt::format_to(output_iterator, " Not supported.\n"); #endif