diff options
author | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:32 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:32 +0200 |
commit | 2004bbc3ef28ada3acca05f5d5fa9108121a6784 (patch) | |
tree | 4b032c0acba5f80caf8b2802aa175f472334a26c /CRT.c | |
parent | e2b58f0ab81b2aafeb8c29a69abad7829fa21ab3 (diff) | |
download | debian_htop-2004bbc3ef28ada3acca05f5d5fa9108121a6784.tar.gz debian_htop-2004bbc3ef28ada3acca05f5d5fa9108121a6784.tar.bz2 debian_htop-2004bbc3ef28ada3acca05f5d5fa9108121a6784.zip |
Imported Upstream version 1.0.2upstream/1.0.2
Diffstat (limited to 'CRT.c')
-rw-r--r-- | CRT.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -11,8 +11,10 @@ in the source distribution for its full text. #include "String.h" #include <curses.h> +#include <errno.h> #include <signal.h> #include <stdlib.h> +#include <string.h> #ifdef HAVE_EXECINFO_H #include <execinfo.h> #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(); |