From 66d4822838e6a50c748f54cc854186fd3fcfbfe5 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Sat, 8 Jan 2022 18:15:23 +0100 Subject: RISC-V: add stacktrace support via frame pointer walking Make debugging more convenient by implementing stack_dump() and changing exception handlers to print stack trace along with the register dump. Signed-off-by: Ahmad Fatoum Link: https://lore.barebox.org/20220108171524.587144-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ab9d3e677e..a6b6a5be20 100644 --- a/Makefile +++ b/Makefile @@ -632,6 +632,11 @@ endif # need-config KBUILD_CFLAGS += -ggdb3 +ifdef CONFIG_FRAME_POINTER +KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls +KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) +endif + # Force gcc to behave correct even for buggy distributions KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector) -- cgit v1.2.1