diff options
author | Eugene V. Lyubimkin <jackyf@debian.org> | 2012-12-01 11:55:43 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:32 +0200 |
commit | 204a191cc68fa15147b2dcfc2711665bd88f758e (patch) | |
tree | d7c63186e2aca725938bc4a308d58a5f8789df16 /CRT.c | |
parent | d8bd1d8d45f42b28bd4674a5e88d0aa349f887c3 (diff) | |
parent | 2004bbc3ef28ada3acca05f5d5fa9108121a6784 (diff) | |
download | debian_htop-204a191cc68fa15147b2dcfc2711665bd88f758e.tar.gz debian_htop-204a191cc68fa15147b2dcfc2711665bd88f758e.tar.bz2 debian_htop-204a191cc68fa15147b2dcfc2711665bd88f758e.zip |
Imported Debian patch 1.0.2-1debian/1.0.2-1
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(); |