32#ifndef HURRICANE_DEBUG_SESSION_H
33#define HURRICANE_DEBUG_SESSION_H
37#include "hurricane/Commons.h"
59 static DebugSession* create ();
60 static inline DebugSession* get ();
61 static inline bool isTraced (
const void* symbol );
62 static inline void isTracedNet (
const Net* );
63 static inline void addToTrace (
const void* symbol );
66 static inline void open (
int minLevel,
int maxLevel );
67 static inline void open (
const void* symbol,
int minLevel,
int maxLevel );
68 static inline void close ();
70 inline bool _isTraced (
const void* symbol )
const;
71 inline void _addToTrace (
const void* symbol );
72 void _addToTrace (
const Cell*,
const Name& );
73 inline void _addToTrace (
const Net* net );
75 Record* _getRecord ()
const;
76 string _getString ()
const;
77 string _getTypeName ()
const;
81 static DebugSession* _singleton;
82 set<const void*> _symbols;
83 stack< pair<int,int> > _levels;
90 DebugSession (
const DebugSession& );
91 DebugSession& operator= (
const DebugSession& );
99 if (cdebug.getMinLevel() < minLevel) minLevel = cdebug.getMinLevel();
100 if (cdebug.getMaxLevel() > maxLevel) maxLevel = cdebug.getMaxLevel();
102 _singleton->_levels.push( make_pair( cdebug.setMinLevel(minLevel)
103 , cdebug.setMaxLevel(maxLevel) ) );
111 if (cdebug.getMinLevel() < minLevel) minLevel = cdebug.getMinLevel();
112 if (cdebug.getMaxLevel() > maxLevel) maxLevel = cdebug.getMaxLevel();
114 if ( _singleton->_isTraced(symbol) ) {
115 _singleton->_levels.push( make_pair( cdebug.setMinLevel(minLevel)
116 , cdebug.setMaxLevel(maxLevel) ) );
120 _singleton->_levels.push ( make_pair( cdebug.getMinLevel()
121 , cdebug.getMaxLevel() ) );
130 if ( not _singleton->_levels.empty() ) {
131 cdebug.setMinLevel( _singleton->_levels.top().first );
132 cdebug.setMaxLevel( _singleton->_levels.top().second );
133 _singleton->_levels.pop ();
140 DebugSession* DebugSession::get () {
return _singleton; }
145 ,
const Name& name ) { _singleton->_addToTrace( cell, name ); }
146 bool DebugSession::_isTraced (
const void* symbol )
const {
return _symbols.find(symbol) != _symbols.end(); }
147 void DebugSession::_addToTrace (
const void* symbol ) { _symbols.insert( symbol ); }
148 void DebugSession::_addToTrace (
const Net* net ) { _addToTrace(
static_cast<const void*
>(net) ); }
The model (API).
Definition Cell.h:64
Enable/Disable trace information (API).
Definition DebugSession.h:55
static bool isTraced(const void *symbol)
Definition DebugSession.h:141
static void addToTrace(const void *symbol)
Definition DebugSession.h:142
static void open(int minLevel, int maxLevel)
Definition DebugSession.h:97
static void close()
Definition DebugSession.h:128
Name description (API).
Definition Name.h:35
Net description (API).
Definition Net.h:46
Contains Almost Everything.
Definition BasicLayer.h:39