* Added some memory debugging utils.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1171 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2010-08-19 10:30:42 +00:00
parent 493843f223
commit 01738fd357
5 changed files with 47 additions and 3 deletions
+15
View File
@@ -804,6 +804,8 @@ do_panic(int signum) {
SignalHandler::set_default(signum);
display::Canvas::cleanup();
// Use printf here instead...
std::cout << "Caught " << SignalHandler::as_string(signum) << ", dumping stack:" << std::endl;
#ifdef USE_EXECINFO
@@ -820,6 +822,19 @@ do_panic(int signum) {
std::cout << "Stack dump not enabled." << std::endl;
#endif
// Dumping virtual memory map information to file:
// char dump_path[256];
// snprintf(dump_path, 256, "./rtorrent.map.%u", getpid());
// int dump_fd = open(dump_path, O_RDWR | O_CREAT);
// if (dump_fd == -1) {
// printf("Could not create vmmap dump file '%s'.", dump_path);
// goto do_panic_exit;
// }
// do_panic_exit:
if (signum == SIGBUS)
std::cout << "A bus error probably means you ran out of diskspace." << std::endl;