From cedfa69e6afe381a074d22bdf1e6f2d9e6731038 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 14 Jul 2021 16:36:44 -0400 Subject: test: Add a basic traceback printer Some tests have some complex flows, and it's useful to be able to see the call path when there's a failure. This patch adds a very simple traceback printer, along with changing the test build arguments to include more debug information. The result you get from this traceback printer just gives you a function name and the index into its .txt content, so to use it for more than "which function calls which", you'll need to use eu-addr2line with the output. Signed-off-by: Peter Jones --- include/test.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/test.h') diff --git a/include/test.h b/include/test.h index 49a27a94..fedeb782 100644 --- a/include/test.h +++ b/include/test.h @@ -69,6 +69,8 @@ extern int debug; #define dprint(fmt, ...) {( if (debug) printf("%s:%d:" fmt, __func__, __LINE__, ##__VA_ARGS__); }) #endif +void print_traceback(int skip); + #define eassert(cond, fmt, ...) \ ({ \ if (!(cond)) { \ -- cgit v1.2.3