diff options
author | Tri Vo <trong@google.com> | 2020-08-04 22:22:35 -0700 |
---|---|---|
committer | Tri Vo <trong@google.com> | 2020-08-10 13:14:26 -0700 |
commit | 6b377c4d5f51d1f130d35863531ca519d9f66a00 (patch) | |
tree | e7723c0a2b6e6232f23902e9cfe62e3fe070936c /lib | |
parent | 609df7c479affb0ac001a17e76467a9c1981dd94 (diff) | |
download | common-6b377c4d5f51d1f130d35863531ca519d9f66a00.tar.gz |
[lib][debug] Dump backtrace on panic
Also remove backtraces on faults, as they have become redundant.
Bug: 149918767
Change-Id: Ieb4017ad34fb1ff0943c32485b91e420134e3a3d
Diffstat (limited to 'lib')
-rw-r--r-- | lib/debug/debug.c | 3 | ||||
-rw-r--r-- | lib/debug/rules.mk | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/debug/debug.c b/lib/debug/debug.c index 54a2612d..285844c9 100644 --- a/lib/debug/debug.c +++ b/lib/debug/debug.c @@ -27,6 +27,7 @@ #include <stdlib.h> #include <printf.h> #include <stdio.h> +#include <lib/backtrace/backtrace.h> #include <list.h> #include <arch/ops.h> #include <platform.h> @@ -52,6 +53,8 @@ void _panic(const char *fmt, ...) va_list ap; struct thread *curr = get_current_thread(); + dump_backtrace(); + if (curr && thread_get_flag_exit_on_panic(curr)) { thread_exit(ERR_FAULT); } diff --git a/lib/debug/rules.mk b/lib/debug/rules.mk index 8f67f00e..93636c37 100644 --- a/lib/debug/rules.mk +++ b/lib/debug/rules.mk @@ -5,4 +5,7 @@ MODULE := $(LOCAL_DIR) MODULE_SRCS += \ $(LOCAL_DIR)/debug.c +MODULE_DEPS += \ + trusty/kernel/lib/backtrace \ + include make/module.mk |