Make it easier to debug reference counts in LTL nodes.

* src/ltlast/automatop.cc, src/ltlast/automatop.hh,
src/ltlast/binop.cc, src/ltlast/binop.hh, src/ltlast/multop.cc,
src/ltlast/multop.hh, src/ltlast/unop.cc, src/ltlast/unop.hh:
Add a dump_instance() static method to all class.
* src/ltltest/readltl.cc: Add option -r to dump all instances
with their reference count, after parsing and after deletion.
This commit is contained in:
Alexandre Duret-Lutz 2009-11-07 02:41:32 +01:00
parent 3488bf45e0
commit 631f4b5bea
10 changed files with 133 additions and 19 deletions

View file

@ -117,5 +117,19 @@ namespace spot
{
return instances.size();
}
std::ostream&
automatop::dump_instances(std::ostream& os)
{
for (map::iterator i = instances.begin(); i != instances.end(); ++i)
{
os << i->second << " = "
<< i->second->ref_count_() << " * "
<< i->second->dump()
<< std::endl;
}
return os;
}
}
}