summaryrefslogtreecommitdiffstats
path: root/src/graph.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/graph.cc')
-rw-r--r--src/graph.cc29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/graph.cc b/src/graph.cc
index 5418ecf..56584e3 100644
--- a/src/graph.cc
+++ b/src/graph.cc
@@ -320,18 +320,37 @@ bool Edge::LoadDepFile(State* state, DiskInterface* disk_interface,
return true;
}
-void Edge::Dump() {
- printf("[ ");
- for (vector<Node*>::iterator i = inputs_.begin(); i != inputs_.end(); ++i) {
+void Edge::Dump(const char* prefix) const {
+ printf("%s[ ", prefix);
+ for (vector<Node*>::const_iterator i = inputs_.begin();
+ i != inputs_.end() && *i != NULL; ++i) {
printf("%s ", (*i)->path().c_str());
}
printf("--%s-> ", rule_->name().c_str());
- for (vector<Node*>::iterator i = outputs_.begin(); i != outputs_.end(); ++i) {
+ for (vector<Node*>::const_iterator i = outputs_.begin();
+ i != outputs_.end() && *i != NULL; ++i) {
printf("%s ", (*i)->path().c_str());
}
- printf("]\n");
+ printf("] 0x%p\n", this);
}
bool Edge::is_phony() const {
return rule_ == &State::kPhonyRule;
}
+
+void Node::Dump(const char* prefix) const {
+ printf("%s <%s 0x%p> mtime: %d%s, (:%s), ",
+ prefix, path().c_str(), this,
+ mtime(), mtime()?"":" (:missing)",
+ dirty()?" dirty":" clean");
+ if (in_edge()) {
+ in_edge()->Dump("in-edge: ");
+ }else{
+ printf("no in-edge\n");
+ }
+ printf(" out edges:\n");
+ for (vector<Edge*>::const_iterator e = out_edges().begin();
+ e != out_edges().end() && *e != NULL; ++e) {
+ (*e)->Dump(" +- ");
+ }
+}