X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=common.cc;h=b274989f48bc4d885f6976b596139b1e5bde42ed;hp=ac5cb59601ba7a6025ac1d8d5f24f62fef0666b7;hb=4546308ab989c074f83d8607e16f13ffbcff494a;hpb=3262ae1f816dea735cab52d6940523f52ca80fe1 diff --git a/common.cc b/common.cc index ac5cb596..b274989f 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,9 +28,15 @@ void print_trace(void) printf("\t%s\n", strings[i]); free(strings); +#endif /* CONFIG_STACKTRACE */ } void model_print_summary(void) { model->print_summary(); } + +void assert_hook(void) +{ + printf("Add breakpoint to line %u in file %s.\n",__LINE__,__FILE__); +}