summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorGeunhae LEE <geunhae.lee@samsung.com>2014-03-12 15:44:58 +0900
committerGeunhae LEE <geunhae.lee@samsung.com>2014-03-17 15:32:47 +0900
commit9c68a9b8a7ec41864ca039ab828faa44ef7c75c8 (patch)
treec113d830b3f808317b08f2a4c9dfb77002805c56 /util
parent439e948c4859c4f85338d7f3e6efb25f48248fa1 (diff)
downloadqemu-9c68a9b8a7ec41864ca039ab828faa44ef7c75c8.tar.gz
qemu-9c68a9b8a7ec41864ca039ab828faa44ef7c75c8.tar.bz2
qemu-9c68a9b8a7ec41864ca039ab828faa44ef7c75c8.zip
debug utility : dump backtrace whenever exit called or signal catched
- tested on both Linux and Windows - stack trace is printed out in emulator.log by class of err - it only print stack trace for thread which either calls exit or catchs signals Change-Id: I45258234af329889226badb8e8455d355ded4de6 Signed-off-by: Geunhae LEE <geunhae.lee@samsung.com>
Diffstat (limited to 'util')
-rw-r--r--util/qemu-thread-posix.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c
index 37dd298631..d5dc50237b 100644
--- a/util/qemu-thread-posix.c
+++ b/util/qemu-thread-posix.c
@@ -409,13 +409,20 @@ void qemu_thread_create(QemuThread *thread,
/* Leave signal handling to the iothread. */
sigfillset(&set);
+#define DO_NOT_MASK_SYNC_SIGS
+#ifdef DO_NOT_MASK_SYNC_SIGS
+ sigdelset(&set, SIGSEGV);
+ sigdelset(&set, SIGBUS);
+ sigdelset(&set, SIGABRT);
+ sigdelset(&set, SIGFPE);
+ sigdelset(&set, SIGILL);
+#endif
pthread_sigmask(SIG_SETMASK, &set, &oldset);
err = pthread_create(&thread->thread, &attr, start_routine, arg);
if (err)
error_exit(err, __func__);
pthread_sigmask(SIG_SETMASK, &oldset, NULL);
-
pthread_attr_destroy(&attr);
}