From 2004bbc3ef28ada3acca05f5d5fa9108121a6784 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Mon, 11 Apr 2016 13:00:32 +0200 Subject: Imported Upstream version 1.0.2 --- CRT.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'CRT.c') diff --git a/CRT.c b/CRT.c index 621adfc..6cc979f 100644 --- a/CRT.c +++ b/CRT.c @@ -11,8 +11,10 @@ in the source distribution for its full text. #include "String.h" #include +#include #include #include +#include #ifdef HAVE_EXECINFO_H #include #endif @@ -129,8 +131,13 @@ static void CRT_handleSIGSEGV(int sgn) { fprintf(stderr, "\n\nhtop " VERSION " aborting. Please report bug at http://htop.sf.net\n"); #ifdef HAVE_EXECINFO_H size_t size = backtrace(backtraceArray, sizeof(backtraceArray) / sizeof(void *)); - fprintf(stderr, "Backtrace: \n"); + fprintf(stderr, "\n Please include in your report the following backtrace: \n"); backtrace_symbols_fd(backtraceArray, size, 2); + fprintf(stderr, "\nAdditionally, in order to make the above backtrace useful,"); + fprintf(stderr, "\nplease also run the following command to generate a disassembly of your binary:"); + fprintf(stderr, "\n\n objdump -d `which htop` > ~/htop.objdump"); + fprintf(stderr, "\n\nand then attach the file ~/htop.objdump to your bug report."); + fprintf(stderr, "\n\nThank you for helping to improve htop!\n\n"); #endif #else fprintf(stderr, "\n\nhtop " VERSION " aborting. Unsupported platform.\n"); @@ -193,6 +200,13 @@ void CRT_done() { endwin(); } +void CRT_fatalError(const char* note) { + char* sysMsg = strerror(errno); + CRT_done(); + fprintf(stderr, "%s: %s\n", note, sysMsg); + exit(2); +} + int CRT_readKey() { nocbreak(); cbreak(); -- cgit v1.2.3