Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
cb7a0637
Commit
cb7a0637
authored
8 years ago
by
Diederik de Groot
Browse files
Options
Download
Email Patches
Plain Diff
Enh: Add support for backtrace using execinfo
parent
cba69596
master
fixedgray
lua
next
perfcounters
pkgconfig-on-linux
solaris
3.0.0beta5
3.0.0beta4
3.0.0beta3
3.0.0beta2
3.0.0beta1
2.2.0
2.1.0
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile.am
+1
-1
Makefile.am
dragonflybsd/DragonFlyBSDCRT.c
+15
-1
dragonflybsd/DragonFlyBSDCRT.c
dragonflybsd/DragonFlyBSDCRT.h
+3
-0
dragonflybsd/DragonFlyBSDCRT.h
with
19 additions
and
2 deletions
+19
-2
Makefile.am
View file @
cb7a0637
...
...
@@ -54,7 +54,7 @@ freebsd/FreeBSDProcess.h freebsd/FreeBSDCRT.h freebsd/Battery.h
endif
if
HTOP_DRAGONFLYBSD
htop_LDFLAGS
+=
-lkvm
-lkinfo
htop_LDFLAGS
+=
-lkvm
-lkinfo
-lexecinfo
myhtopplatsources
=
dragonflybsd/Platform.c dragonflybsd/DragonFlyBSDProcessList.c
\
dragonflybsd/DragonFlyBSDProcess.c dragonflybsd/DragonFlyBSDCRT.c dragonflybsd/Battery.c
...
...
This diff is collapsed.
Click to expand it.
dragonflybsd/DragonFlyBSDCRT.c
View file @
cb7a0637
...
...
@@ -10,12 +10,26 @@ in the source distribution for its full text.
#include "CRT.h"
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
#endif
void
CRT_handleSIGSEGV
(
int
sgn
)
{
(
void
)
sgn
;
CRT_done
();
fprintf
(
stderr
,
"
\n\n
htop "
VERSION
" aborting.
\n
"
);
fprintf
(
stderr
,
"
\n\n
htop "
VERSION
" aborting. Please report bug at http://hisham.hm/htop
\n
"
);
#ifdef HAVE_EXECINFO_H
size_t
size
=
backtrace
(
backtraceArray
,
sizeof
(
backtraceArray
)
/
sizeof
(
void
*
));
fprintf
(
stderr
,
"
\n
Please include in your report the following backtrace:
\n
"
);
backtrace_symbols_fd
(
backtraceArray
,
size
,
2
);
fprintf
(
stderr
,
"
\n
Additionally, in order to make the above backtrace useful,"
);
fprintf
(
stderr
,
"
\n
please 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\n
and then attach the file ~/htop.objdump to your bug report."
);
fprintf
(
stderr
,
"
\n\n
Thank you for helping to improve htop!
\n\n
"
);
#else
fprintf
(
stderr
,
"
\n
Please contact your DragonFlyBSD package maintainer!
\n\n
"
);
#endif
abort
();
}
This diff is collapsed.
Click to expand it.
dragonflybsd/DragonFlyBSDCRT.h
View file @
cb7a0637
...
...
@@ -10,6 +10,9 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
#ifdef HAVE_EXECINFO_H
#endif
void
CRT_handleSIGSEGV
(
int
sgn
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help