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

@ -1,6 +1,6 @@
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
// Copyright (C) 2003, 2004, 2009 Laboratoire d'Informatique de Paris
// 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// Université Pierre et Marie Curie.
//
// This file is part of Spot, a model checking library.
//
@ -25,6 +25,7 @@
# define SPOT_LTLAST_UNOP_HH
#include <map>
#include <iosfwd>
#include "refformula.hh"
namespace spot
@ -59,6 +60,9 @@ namespace spot
/// Number of instantiated unary operators. For debugging.
static unsigned instance_count();
/// Dump all instances. For debugging.
static std::ostream& dump_instances(std::ostream& os);
protected:
typedef std::pair<type, formula*> pair;
typedef std::map<pair, unop*> map;