Skip to content

Commit bd35386

Browse files
mflemingpmundt
authored andcommitted
sh: dwarf unwinder support.
This is a first cut at a generic DWARF unwinder for the kernel. It's still lacking DWARF64 support and the DWARF expression support hasn't been tested very well but it is generating proper stacktraces on SH for WARN_ON() and NULL dereferences. Signed-off-by: Matt Fleming <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
1 parent 0eff9f6 commit bd35386

File tree

10 files changed

+1322
-1
lines changed

10 files changed

+1322
-1
lines changed

arch/sh/Kconfig.debug

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ config DUMP_CODE
110110

111111
Those looking for more verbose debugging output should say Y.
112112

113+
config DWARF_UNWINDER
114+
bool "Enable the DWARF unwinder for stacktraces"
115+
select FRAME_POINTER
116+
default n
117+
help
118+
Enabling this option will make stacktraces more accurate, at
119+
the cost of an increase in overall kernel size.
120+
113121
config SH_NO_BSS_INIT
114122
bool "Avoid zeroing BSS (to speed-up startup on suitable platforms)"
115123
depends on DEBUG_KERNEL

arch/sh/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ ifeq ($(CONFIG_MCOUNT),y)
191191
KBUILD_CFLAGS += -pg
192192
endif
193193

194+
ifeq ($(CONFIG_DWARF_UNWINDER),y)
195+
KBUILD_CFLAGS += -fasynchronous-unwind-tables
196+
endif
197+
194198
libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y)
195199
libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y)
196200

0 commit comments

Comments
 (0)