#define MAX_TRACE_LEN 100
-FILE *model_out;
-int fd_user_out; /**< @brief File descriptor from which to read user program output */
+/** @brief Model-checker output stream; default to stdout until redirected */
+FILE *model_out = stdout;
#define CONFIG_STACKTRACE
/** Print a backtrace of the current program state. */
void print_trace(void)
{
#ifdef CONFIG_STACKTRACE
- print_stacktrace(stdout);
+ print_stacktrace(model_out);
#else
void *array[MAX_TRACE_LEN];
char **strings;
void assert_hook(void)
{
- model_print("Add breakpoint to line %u in file %s.\n",__LINE__,__FILE__);
+ model_print("Add breakpoint to line %u in file %s.\n", __LINE__, __FILE__);
}
void model_assert(bool expr, const char *file, int line)
}
}
+#ifndef CONFIG_DEBUG
+
+static int fd_user_out; /**< @brief File descriptor from which to read user program output */
+
/**
* @brief Setup output redirecting
*
* output much data, we will need to buffer it in user-space during execution.
* This also means that if ModelChecker decides not to print an execution, it
* should promptly clear the pipe.
+ *
+ * This function should only be called once.
*/
void redirect_output()
{
}
}
}
+#endif /* ! CONFIG_DEBUG */