projects
/
model-checker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5f861eb
)
output: don't redirect any output for DEBUG builds
author
Brian Norris
<banorris@uci.edu>
Tue, 20 Nov 2012 00:37:26 +0000
(16:37 -0800)
committer
Brian Norris
<banorris@uci.edu>
Tue, 20 Nov 2012 00:38:28 +0000
(16:38 -0800)
common.cc
patch
|
blob
|
history
output.h
patch
|
blob
|
history
diff --git
a/common.cc
b/common.cc
index f8df1335b00cbe57001d4efacea2191134a4653c..c190ed37487e44ff37d9145017dad1bd654085d0 100644
(file)
--- a/
common.cc
+++ b/
common.cc
@@
-14,8
+14,8
@@
#define MAX_TRACE_LEN 100
#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. */
#define CONFIG_STACKTRACE
/** Print a backtrace of the current program state. */
@@
-60,6
+60,10
@@
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
*
/**
* @brief Setup output redirecting
*
@@
-161,3
+165,4
@@
void print_program_output()
}
}
}
}
}
}
+#endif /* ! CONFIG_DEBUG */
diff --git
a/output.h
b/output.h
index ca55b7a682352c9c67ad0d523a0f416d17991761..e390bb613510539958a1507eb2aaaddebd374ae3 100644
(file)
--- a/
output.h
+++ b/
output.h
@@
-5,8
+5,16
@@
#ifndef __OUTPUT_H__
#define __OUTPUT_H__
#ifndef __OUTPUT_H__
#define __OUTPUT_H__
+#include "config.h"
+
+#ifdef CONFIG_DEBUG
+static inline void redirect_output() { }
+static inline void clear_program_output() { }
+static inline void print_program_output() { }
+#else
void redirect_output();
void clear_program_output();
void print_program_output();
void redirect_output();
void clear_program_output();
void print_program_output();
+#endif /* ! CONFIG_DEBUG */
#endif /* __OUTPUT_H__ */
#endif /* __OUTPUT_H__ */