1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0025266: Debug statements in the source are getting flushed on to the console

Output to cout activated previously in Debug mode by #ifdef DEB is suppressed by using macro <PACKAGE>_DEB instead of DEB
This commit is contained in:
dbv
2014-10-08 19:00:20 +04:00
committed by abv
parent 7aa1b65c2a
commit 63c629aa3a
370 changed files with 1634 additions and 1639 deletions

View File

@@ -1032,7 +1032,9 @@ void OSD_File :: Read (
) {
if ( OSD_File::KindOfFile ( ) == OSD_DIRECTORY ) {
#ifdef OSD_DEB
cout << " OSD_File::Read : it is a directory " << endl;
#endif
return ;
// Standard_ProgramError::Raise("OSD_File::Read : it is a directory");
}

View File

@@ -186,7 +186,7 @@ char full_name[255];
sprintf(full_name,"%s/%s",myPlace.ToCString(),
((struct dirent *)myEntry)->d_name); // LD debug
#ifdef DEBUG
#ifdef OSD_DEB
cout << "Place : " << myPlace << endl;
cout << "FName : " << full_name << endl;
#endif

View File

@@ -360,7 +360,7 @@ OSD_Path::OSD_Path(const TCollection_AsciiString& aDependentName,
MacExtract(aDependentName,myDisk,myTrek,myName,myExtension);
break;
default:
#ifdef DEB
#ifdef OSD_DEB
cout << " WARNING WARNING : OSD Path for an Unknown SYSTEM : " << (Standard_Integer)todo << endl;
#endif
break ;

View File

@@ -187,7 +187,9 @@ static void Handler (const int theSignal)
if (aCurInfoHandle) {
// cout << "OSD::Handler: calling previous signal handler with info " << aCurInfoHandle << endl ;
(*aCurInfoHandle) (theSignal, aSigInfo, theContext);
#ifdef OSD_DEB
cerr << " previous signal handler return" << endl ;
#endif
return;
}
else {
@@ -200,7 +202,9 @@ static void Handler (const int theSignal)
if(aCurHandler) {
// cout << "OSD::Handler: calling previous signal handler" << endl ;
(*aCurHandler) (theSignal);
#ifdef OSD_DEB
cerr << " previous signal handler return" << endl ;
#endif
return;
}
}
@@ -314,7 +318,9 @@ static void Handler (const int theSignal)
Standard_DivideByZero::NewInstance("SIGTRAP IntegerDivideByZero")->Jump(); break;
#endif
default:
#ifdef OSD_DEB
cout << "Unexpected signal " << theSignal << endl ;
#endif
break;
}
}
@@ -353,9 +359,11 @@ static void SegvHandler(const int theSignal,
OSD_SIGSEGV::NewInstance(Msg)->Jump();
}
}
#ifdef OSD_DEB
else {
cout << "Wrong undefined address." << endl ;
}
#endif
exit(SIGSEGV);
}
@@ -382,9 +390,11 @@ static void SegvHandler(const int theSignal,
// scp->sc_pcoq_tail = scp->sc_pcoq_tail + 0x4 ; l'intruction suivant le segv.
}
}
#ifdef OSD_DEB
else {
cout << "Wrong undefined address." << endl ;
}
#endif
exit(SIGSEGV);
}
@@ -413,7 +423,9 @@ void OSD::SetSignal(const Standard_Boolean aFloatingSignal)
//stat = ieee_handler("set", "inexact", PHandler) || stat;
if (stat) {
#ifdef OSD_DEB
cerr << "ieee_handler does not work !!! KO " << endl;
#endif
}
#elif defined (linux)
feenableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
@@ -430,9 +442,11 @@ void OSD::SetSignal(const Standard_Boolean aFloatingSignal)
if ( first_time & 2 ) {
char *TRAP_FPE = getenv("TRAP_FPE") ;
if ( TRAP_FPE == NULL ) {
#ifdef OSD_DEB
cout << "On SGI you must set TRAP_FPE environment variable : " << endl ;
cout << "set env(TRAP_FPE) \"UNDERFL=FLUSH_ZERO;OVERFL=DEFAULT;DIVZERO=DEFAULT;INT_OVERFL=DEFAULT\" or" << endl ;
cout << "setenv TRAP_FPE \"UNDERFL=FLUSH_ZERO;OVERFL=DEFAULT;DIVZERO=DEFAULT;INT_OVERFL=DEFAULT\"" << endl ;
#endif
// exit(1) ;
first_time = first_time & (~ 2) ;
}
@@ -458,7 +472,9 @@ void OSD::SetSignal(const Standard_Boolean aFloatingSignal)
//==== Always detected the signal "SIGFPE" =================================
stat = sigaction(SIGFPE,&act,&oact); // ...... floating point exception
if (stat) {
#ifdef OSD_DEB
cerr << "sigaction does not work !!! KO " << endl;
#endif
perror("sigaction ");
}