From 981e9728390b401404c36241e2ce6bd4cfcb723d Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Mon, 16 May 2022 14:33:26 +0100 Subject: mips: add native backtrace implementation Should make debugging crashes on native MIPS targets far easier. This is by no means a 100% complete or robust implementation but it seems to handle the vast majority of functions. Change-Id: Id5f430270e02b5092b79026b6876675c784aa649 --- lib/mipsunwinder/mipsunwinder.make | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lib/mipsunwinder/mipsunwinder.make (limited to 'lib/mipsunwinder/mipsunwinder.make') diff --git a/lib/mipsunwinder/mipsunwinder.make b/lib/mipsunwinder/mipsunwinder.make new file mode 100644 index 0000000000..ddd1ce078f --- /dev/null +++ b/lib/mipsunwinder/mipsunwinder.make @@ -0,0 +1,23 @@ +# __________ __ ___. +# Open \______ \ ____ ____ | | _\_ |__ _______ ___ +# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / +# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < +# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +# \/ \/ \/ \/ \/ +# + +MIPSUNWINDERLIB_DIR = $(ROOTDIR)/lib/mipsunwinder +MIPSUNWINDERLIB_SRC = $(call preprocess, $(MIPSUNWINDERLIB_DIR)/SOURCES) +MIPSUNWINDERLIB_OBJ := $(call c2obj, $(MIPSUNWINDERLIB_SRC)) + +OTHER_SRC += $(MIPSUNWINDERLIB_SRC) + +MIPSUNWINDERLIB = $(BUILDDIR)/lib/libmipsunwinder.a +CORE_LIBS += $(MIPSUNWINDERLIB) + +INCLUDES += -I$(MIPSUNWINDERLIB_DIR) +DEFINES += -DBACKTRACE_MIPSUNWINDER + +$(MIPSUNWINDERLIB): $(MIPSUNWINDERLIB_OBJ) + $(SILENT)$(shell rm -f $@) + $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null -- cgit v1.2.3