From 6f5e234d3f2862efea49475caf5fc6b296390f69 Mon Sep 17 00:00:00 2001 From: Hamed Gorjiara Date: Mon, 1 Jul 2019 12:35:11 -0700 Subject: [PATCH] Adding stack trace procedure --- src/common.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/common.cc b/src/common.cc index f54756b..b66fc44 100644 --- a/src/common.cc +++ b/src/common.cc @@ -1,6 +1,18 @@ #include "common.h" +#include +#include +#include +#include +#include void assert_hook(void) { model_print("Add breakpoint to line %u in file %s.\n", __LINE__, __FILE__); } + +void print_trace(void){ + void *array[10]; + size_t size; + size = backtrace(array, 10); + backtrace_symbols_fd(array, size, STDERR_FILENO); +} -- 2.34.1