From b71fa164192f1af8b702e1578cf202b510a9b281 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 27 Nov 2018 14:20:10 +0200 Subject: Add --dump option, omit state dumping from verbosity level 6 --- build2/b.cxx | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'build2/b.cxx') diff --git a/build2/b.cxx b/build2/b.cxx index 5415472..74dc7a2 100644 --- a/build2/b.cxx +++ b/build2/b.cxx @@ -23,19 +23,20 @@ #include #include +#include +#include +#include #include -#include #include -#include -#include -#include -#include #include +#include +#include +#include #include +#include #include #include -#include -#include +#include #include @@ -537,6 +538,14 @@ main (int argc, char* argv[]) return path (); }; + bool dump_load (false); + bool dump_match (false); + if (ops.dump_specified ()) + { + dump_load = ops.dump ().find ("load") != ops.dump ().end (); + dump_match = ops.dump ().find ("match") != ops.dump ().end (); + } + // If not NULL, then lifted points to the operation that has been "lifted" // to the meta-operaion (see the logic below for details). Skip is the // position of the next operation. @@ -1381,6 +1390,9 @@ main (int argc, char* argv[]) } } // target + if (dump_load) + dump (); + // Finally, match the rules and perform the operation. // if (pre_oid != 0) @@ -1402,6 +1414,9 @@ main (int argc, char* argv[]) if (mif->match != nullptr) mif->match (mparams, a, tgs, diag, true /* progress */); + if (dump_match) + dump (a); + if (mif->execute != nullptr && !ops.match_only ()) mif->execute (mparams, a, tgs, diag, true /* progress */); } @@ -1426,6 +1441,9 @@ main (int argc, char* argv[]) if (mif->match != nullptr) mif->match (mparams, a, tgs, diag, true /* progress */); + if (dump_match) + dump (a); + if (mif->execute != nullptr && !ops.match_only ()) mif->execute (mparams, a, tgs, diag, true /* progress */); } @@ -1451,6 +1469,9 @@ main (int argc, char* argv[]) if (mif->match != nullptr) mif->match (mparams, a, tgs, diag, true /* progress */); + if (dump_match) + dump (a); + if (mif->execute != nullptr && !ops.match_only ()) mif->execute (mparams, a, tgs, diag, true /* progress */); } -- cgit v1.1