From: Brian Norris Date: Sat, 6 Oct 2012 02:34:01 +0000 (-0700) Subject: common: improve backtrace function X-Git-Tag: pldi2013~97^2~2 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker.git;a=commitdiff_plain;h=a1e702259b91aaa78fd6d60bb9c54cbfc47af279 common: improve backtrace function Utilize freely-available backtrace function that helps make output more readable. Previous implementation is kept for now, as it is simpler and more well-tested. --- diff --git a/common.cc b/common.cc index e05e094..b274989 100644 --- a/common.cc +++ b/common.cc @@ -4,12 +4,17 @@ #include "common.h" #include "model.h" +#include "stacktrace.h" #define MAX_TRACE_LEN 100 +#define CONFIG_STACKTRACE /** Print a backtrace of the current program state. */ void print_trace(void) { +#ifdef CONFIG_STACKTRACE + print_stacktrace(stdout); +#else void *array[MAX_TRACE_LEN]; char **strings; int size, i; @@ -23,6 +28,7 @@ void print_trace(void) printf("\t%s\n", strings[i]); free(strings); +#endif /* CONFIG_STACKTRACE */ } void model_print_summary(void)