From cb646ea1f83b49eb121a625f1073dfed6a82bf2c Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Wed, 28 May 2008 15:57:52 +0000 Subject: [PATCH] 1.0.17.1: describe_tread_state() for GDB convenience * Add describe_thread_state() to runtime, intended to be mainly called from GDB: prints out important bits of the current signal mask, and values of some special variables. --- src/runtime/backtrace.c | 23 +++++++++++++++++++++++ version.lisp-expr | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/runtime/backtrace.c b/src/runtime/backtrace.c index 52d3ce2..dc5b1e8 100644 --- a/src/runtime/backtrace.c +++ b/src/runtime/backtrace.c @@ -528,6 +528,29 @@ print_entry_points (struct code *code) } } +void +describe_thread_state(void) +{ + sigset_t mask; + struct thread *thread = arch_os_get_current_thread(); + pthread_sigmask(SIG_SETMASK, NULL, &mask); + printf("Signal mask:\n"); + printf(" SIGALRM = %d\n", sigismember(&mask, SIGALRM)); + printf(" SIGINT = %d\n", sigismember(&mask, SIGINT)); + printf(" SIGPROF = %d\n", sigismember(&mask, SIGPROF)); + printf(" SIG_INTERRUPT_THREAD = %d\n", sigismember(&mask, SIG_INTERRUPT_THREAD)); +#ifdef SIG_STOP_FOR_GC + printf(" SIG_STOP_FOR_GC = %d\n", sigismember(&mask, SIG_STOP_FOR_GC)); +#endif + printf("Specials:\n"); + printf(" *GC-INHIBIT* = %s\n", (SymbolValue(GC_INHIBIT, thread) == T) ? "T" : "NIL"); + printf(" *GC-PENDING* = %s\n", (SymbolValue(GC_PENDING, thread) == T) ? "T" : "NIL"); + printf(" *INTERRUPTS-ENABLED* = %s\n", (SymbolValue(INTERRUPTS_ENABLED, thread) == T) ? "T" : "NIL"); +#ifdef STOP_FOR_GC_PENDING + printf(" *STOP-FOR-GC-PENDING* = %s\n", (SymbolValue(STOP_FOR_GC_PENDING, thread) == T) ? "T" : "NIL"); +#endif +} + /* This function has been split from backtrace() to enable Lisp * backtraces from gdb with call backtrace_from_fp(...). Useful for * example when debugging threading deadlocks. diff --git a/version.lisp-expr b/version.lisp-expr index c4e4e39..7b6d9ef 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.17" +"1.0.17.1" -- 1.7.10.4