diff options
author | Steven Knight <knight@baldmt.com> | 2002-04-05 02:24:25 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-04-05 02:24:25 (GMT) |
commit | 3df4ee57235d30950d07b0b498387d5e16e67e6d (patch) | |
tree | 212356351fbd2110ed5edc9051458da60a9a4fbd | |
parent | 4057904f13d9657023ccddb2f4b79b2f45a41a83 (diff) | |
download | SCons-3df4ee57235d30950d07b0b498387d5e16e67e6d.zip SCons-3df4ee57235d30950d07b0b498387d5e16e67e6d.tar.gz SCons-3df4ee57235d30950d07b0b498387d5e16e67e6d.tar.bz2 |
Add --debug=dtree option (Anthony Roach)
-rw-r--r-- | doc/man/scons.1 | 9 | ||||
-rw-r--r-- | src/engine/SCons/Script/__init__.py | 15 | ||||
-rw-r--r-- | test/option--debug.py | 10 |
3 files changed, 31 insertions, 3 deletions
diff --git a/doc/man/scons.1 b/doc/man/scons.1 index 77dedc5..3ce7f45 100644 --- a/doc/man/scons.1 +++ b/doc/man/scons.1 @@ -320,7 +320,14 @@ to the SCons invocation run by the debugger. .TP .RI --debug=tree Print the dependency tree -after each top-level target is built. +after each top-level target is built. This prints out the complete +dependency tree including implicit dependencies and ignored +dependencies. + +.TP +.RI --debug=dtree +Print the dependency tree +after each top-level target is built. This prints out only derived files. .TP -e, --environment-overrides diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index bd4f2ae..143fa19 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -88,7 +88,10 @@ class BuildTask(SCons.Taskmaster.Task): # this method is serialized, but execute isn't: if print_tree and self.top: print - print SCons.Util.render_tree(self.targets[0], get_children) + print SCons.Util.render_tree(self.targets[0], get_all_children) + if print_dtree and self.top: + print + print SCons.Util.render_tree(self.targets[0], get_derived_children) def failed(self): global exit_status @@ -149,13 +152,18 @@ ignore_errors = 0 keep_going_on_error = 0 help_option = None print_tree = 0 +print_dtree = 0 climb_up = 0 target_top = None exit_status = 0 # exit status, assume success by default # utility functions -def get_children(node): return node.all_children(None) +def get_all_children(node): return node.all_children(None) + +def get_derived_children(node): + children = node.all_children(None) + return filter(lambda x: x.builder, children) def _scons_syntax_error(e): """Handle syntax errors. Print out a message and show where the error @@ -391,6 +399,7 @@ def options_init(): def opt_debug(opt, arg): global print_tree + global print_dtree if arg == "pdb": args = [ sys.executable, "pdb.py" ] + \ filter(lambda x: x != "--debug=pdb", sys.argv) @@ -405,6 +414,8 @@ def options_init(): os.execvpe(args[0], args, os.environ) elif arg == "tree": print_tree = 1 + elif arg == "dtree": + print_dtree = 1 else: sys.stderr.write("Warning: %s is not a valid debug type\n" % arg) diff --git a/test/option--debug.py b/test/option--debug.py index 42274c4..ff791f0 100644 --- a/test/option--debug.py +++ b/test/option--debug.py @@ -90,6 +90,16 @@ test.fail_test(string.find(test.stdout(), tree) == -1) test.run(arguments = "--debug=tree " + foo) test.fail_test(string.find(test.stdout(), tree) == -1) + +tree = """ ++-%s + +-foo%s + +-bar%s +""" % (foo, obj,obj) + +test.run(arguments = "--debug=dtree " + foo) +test.fail_test(string.find(test.stdout(), tree) == -1) + tree = """scons: \".\" is up to date. +-. |