The min debug level has to be high (10000) and not zero.

* Bug: In Hurricane the ::tstream class must be initialized with a
    minLevel of 10000 instead of zero, as the minLevel go *towards*
    zero as the debug slice [min:max[ is expanded by DebugSession.
      This default value must be repeated in the CRL::System CTOR
    and in the coriolis2/etc/commons/misc.conf.
* Bug: In Hurricane::IntrusiveSet, uses "tsetw(n)" dedicated cdebug
    stream manipulator instead of the STL one.
This commit is contained in:
Jean-Paul Chaput 2017-12-21 17:29:29 +01:00
parent a75c77626c
commit 24d5e9f172
5 changed files with 25 additions and 19 deletions

View File

@ -330,16 +330,16 @@ namespace CRL {
// Triggers Configuration singleton creation.
Cfg::Configuration::get ();
Cfg::getParamBool ("misc.catchCore" ,false)->registerCb ( this, catchCoreChanged );
Cfg::getParamBool ("misc.verboseLevel1" ,true )->registerCb ( this, verboseLevel1Changed );
Cfg::getParamBool ("misc.verboseLevel2" ,true )->registerCb ( this, verboseLevel2Changed );
Cfg::getParamBool ("misc.info" ,false)->registerCb ( this, infoChanged );
Cfg::getParamBool ("misc.paranoid" ,false)->registerCb ( this, paranoidChanged );
Cfg::getParamBool ("misc.bug" ,false)->registerCb ( this, bugChanged );
Cfg::getParamBool ("misc.logMode" ,false)->registerCb ( this, logModeChanged );
Cfg::getParamInt ("misc.minTraceLevel" ,0 )->registerCb ( this, minTraceLevelChanged );
Cfg::getParamInt ("misc.maxTraceLevel" ,0 )->registerCb ( this, maxTraceLevelChanged );
Cfg::getParamString("stratus1.mappingName","" )->registerCb ( this, stratus1MappingNameChanged );
Cfg::getParamBool ("misc.catchCore" ,false )->registerCb ( this, catchCoreChanged );
Cfg::getParamBool ("misc.verboseLevel1" ,true )->registerCb ( this, verboseLevel1Changed );
Cfg::getParamBool ("misc.verboseLevel2" ,true )->registerCb ( this, verboseLevel2Changed );
Cfg::getParamBool ("misc.info" ,false )->registerCb ( this, infoChanged );
Cfg::getParamBool ("misc.paranoid" ,false )->registerCb ( this, paranoidChanged );
Cfg::getParamBool ("misc.bug" ,false )->registerCb ( this, bugChanged );
Cfg::getParamBool ("misc.logMode" ,false )->registerCb ( this, logModeChanged );
Cfg::getParamInt ("misc.minTraceLevel" ,100000)->registerCb ( this, minTraceLevelChanged );
Cfg::getParamInt ("misc.maxTraceLevel" ,0 )->registerCb ( this, maxTraceLevelChanged );
Cfg::getParamString("stratus1.mappingName","" )->registerCb ( this, stratus1MappingNameChanged );
// Immediate update from the configuration.
//catchCoreChanged ( Cfg::getParamBool("misc.catchCore" ) );

View File

@ -147,7 +147,7 @@ void UpdateSession::onNotOwned()
void Go::invalidate(bool propagateFlag)
// ************************************
{
cdebug_log(18,1) << "Go::invalidate(" << this << ")" << endl;
cdebug_log(18,1) << "Go::invalidate(" << this << ") " << endl;
if (not UPDATOR_STACK or UPDATOR_STACK->empty())
throw Error( "Can't invalidate go: empty update session stack" );

View File

@ -947,9 +947,9 @@ class tstream : public std::ostream {
inline tstream::tstream ( std::ostream& s )
: std::ostream(s.rdbuf())
, _minLevel(0)
, _maxLevel(0)
, _level(0)
, _minLevel (100000)
, _maxLevel (0)
, _level (0)
, _tabulation(" ")
{ }

View File

@ -101,6 +101,8 @@ namespace Hurricane {
_singleton->_levels.push( make_pair( cdebug.setMinLevel(minLevel)
, cdebug.setMaxLevel(maxLevel) ) );
//std::cerr << "DebugSession::open() " << minLevel << ":" << maxLevel << std::endl;
}
@ -112,10 +114,13 @@ namespace Hurricane {
if ( _singleton->_isTraced(symbol) ) {
_singleton->_levels.push( make_pair( cdebug.setMinLevel(minLevel)
, cdebug.setMaxLevel(maxLevel) ) );
//cerr << "DebugSession::open() " << symbol << "min:" << minLevel << " max:" << maxLevel << endl;
//std::cerr << "DebugSession::open() " << symbol << " " << minLevel << ":" << maxLevel << std::endl;
} else {
_singleton->_levels.push ( make_pair( cdebug.getMinLevel()
, cdebug.getMaxLevel() ) );
//std::cerr << "DebugSession::open() Same level " << minLevel << ":" << maxLevel << std::endl;
}
}
@ -126,6 +131,8 @@ namespace Hurricane {
cdebug.setMinLevel( _singleton->_levels.top().first );
cdebug.setMaxLevel( _singleton->_levels.top().second );
_singleton->_levels.pop ();
//std::cerr << "DebugSession::close() " << cdebug.getMinLevel() << ":" << cdebug.getMaxLevel() << std::endl;
}
}

View File

@ -427,7 +427,6 @@ template<class Element> class IntrusiveSet {
newLength = min(_size / 5, (unsigned)512);
if (newLength != _length) {
// cerr << "Resizing: " << this << " " << _length << " " << newLength << endl;
unsigned oldLength = _length;
Element** oldArray = _array;
_length = newLength;
@ -438,7 +437,7 @@ template<class Element> class IntrusiveSet {
for (unsigned index = 0; index < oldLength; index++) {
Element* element = oldArray[index];
if (not element)
cdebug_log(0,0) << "| bucket:" << setw(4) << index << " empty" << endl;
cdebug_log(0,0) << "| bucket:" << tsetw(4) << index << " empty" << endl;
while (element) {
Element* nextElement = _getNextElement(element);
@ -447,8 +446,8 @@ template<class Element> class IntrusiveSet {
_array[newIndex] = element;
element = nextElement;
cdebug_log(0,0) << "| bucket:" << setw(4) << index
<< " -> " << setw(4) << newIndex
cdebug_log(0,0) << "| bucket:" << tsetw(4) << index
<< " -> " << tsetw(4) << newIndex
<< " + " << element << endl;
}
}