diff --git a/bin/deepstate/reducer.py b/bin/deepstate/reducer.py index 403e39e..334ef80 100644 --- a/bin/deepstate/reducer.py +++ b/bin/deepstate/reducer.py @@ -32,6 +32,8 @@ def main(): print "is provided, defaults to last test defined." sys.exit(0) + parser = argparse.ArgumentParser(description="Intelligently reduce test case") + args = sys.argv try: diff --git a/src/include/deepstate/DeepState.hpp b/src/include/deepstate/DeepState.hpp index 6380d30..460155b 100644 --- a/src/include/deepstate/DeepState.hpp +++ b/src/include/deepstate/DeepState.hpp @@ -328,14 +328,14 @@ inline static void ForAll(Closure func) { template inline static void OneOf(FuncTys&&... funcs) { if (FLAGS_verbose_reads) { - printf("DeepState: STARTING OneOf CALL\n"); + printf("STARTING OneOf CALL\n"); } std::function func_arr[sizeof...(FuncTys)] = {funcs...}; unsigned index = DeepState_UIntInRange( 0U, static_cast(sizeof...(funcs))-1); func_arr[Pump(index, sizeof...(funcs))](); if (FLAGS_verbose_reads) { - printf("DeepState: FINISHED OneOf CALL\n"); + printf("FINISHED OneOf CALL\n"); } } diff --git a/src/lib/DeepState.c b/src/lib/DeepState.c index 7797616..f9ce633 100644 --- a/src/lib/DeepState.c +++ b/src/lib/DeepState.c @@ -142,7 +142,7 @@ void DeepState_SymbolizeData(void *begin, void *end) { DeepState_Abandon("Read too many symbols"); } if (FLAGS_verbose_reads) { - printf ("Reading byte at %u\n", DeepState_InputIndex); + printf("Reading byte at %u\n", DeepState_InputIndex); } bytes[i] = DeepState_Input[DeepState_InputIndex++]; } @@ -221,7 +221,7 @@ int DeepState_Bool(void) { DeepState_Abandon("Read too many symbols"); } if (FLAGS_verbose_reads) { - printf ("Reading byte as boolean at %u\n", DeepState_InputIndex); + printf("Reading byte as boolean at %u\n", DeepState_InputIndex); } return DeepState_Input[DeepState_InputIndex++] & 1; } @@ -232,13 +232,19 @@ int DeepState_Bool(void) { DeepState_Abandon("Read too many symbols"); \ } \ type val = 0; \ + if (FLAGS_verbose_reads) { \ + printf("STARTING MULTI-BYTE READ\n"); \ + } \ _Pragma("unroll") \ for (size_t i = 0; i < sizeof(type); ++i) { \ - if (FLAGS_verbose_reads) { \ - printf ("Reading byte at %u\n", DeepState_InputIndex); \ - } \ + if (FLAGS_verbose_reads) { \ + printf("Reading byte at %u\n", DeepState_InputIndex); \ + } \ val = (val << 8) | ((type) DeepState_Input[DeepState_InputIndex++]); \ } \ + if (FLAGS_verbose_reads) { \ + printf("FINISHED MULTI-BYTE READ\n"); \ + } \ return val; \ }