mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0025418: Debug output to be limited to OCC development environment
Macros ending on "DEB" are replaced by OCCT_DEBUG across OCCT code; new macros described in documentation. Macros starting with DEB are changed to start with "OCCT_DEBUG_". Some code cleaned.
This commit is contained in:
@@ -128,7 +128,7 @@ Standard_Boolean OSD::IsDivisible(const Standard_Real theDividend,const Standard
|
||||
// you may divide by infinity
|
||||
//
|
||||
if (! finite(theDivisor)) return Standard_True;
|
||||
#ifdef DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
// Standard_Integer aExp1, aExp2;
|
||||
// Standard_Real aMant1 = frexp(theDividend, &aExp1);
|
||||
// Standard_Real aMant2 = frexp(theDivisor, &aExp2);
|
||||
|
@@ -1032,7 +1032,7 @@ void OSD_File :: Read (
|
||||
) {
|
||||
|
||||
if ( OSD_File::KindOfFile ( ) == OSD_DIRECTORY ) {
|
||||
#ifdef OSD_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << " OSD_File::Read : it is a directory " << endl;
|
||||
#endif
|
||||
return ;
|
||||
|
@@ -186,7 +186,7 @@ char full_name[255];
|
||||
|
||||
sprintf(full_name,"%s/%s",myPlace.ToCString(),
|
||||
((struct dirent *)myEntry)->d_name); // LD debug
|
||||
#ifdef OSD_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Place : " << myPlace << endl;
|
||||
cout << "FName : " << full_name << endl;
|
||||
#endif
|
||||
|
@@ -215,7 +215,7 @@ TCollection_AsciiString second_name;
|
||||
myPath.SystemName ( aBuffer );
|
||||
status = copy_file(aBuffer.ToCString(), second_name.ToCString());
|
||||
if (status != 0) myError.SetValue (-1, Iam, "Copy failed") ;// (LD)
|
||||
#ifdef DEBUG
|
||||
#ifdef OCCT_DEBUG
|
||||
printf("Status %d : errno # %d\n",status,errno);
|
||||
#endif
|
||||
}
|
||||
|
@@ -360,7 +360,7 @@ OSD_Path::OSD_Path(const TCollection_AsciiString& aDependentName,
|
||||
MacExtract(aDependentName,myDisk,myTrek,myName,myExtension);
|
||||
break;
|
||||
default:
|
||||
#ifdef OSD_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << " WARNING WARNING : OSD Path for an Unknown SYSTEM : " << (Standard_Integer)todo << endl;
|
||||
#endif
|
||||
break ;
|
||||
|
@@ -187,7 +187,7 @@ 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
|
||||
#ifdef OCCT_DEBUG
|
||||
cerr << " previous signal handler return" << endl ;
|
||||
#endif
|
||||
return;
|
||||
@@ -202,7 +202,7 @@ static void Handler (const int theSignal)
|
||||
if(aCurHandler) {
|
||||
// cout << "OSD::Handler: calling previous signal handler" << endl ;
|
||||
(*aCurHandler) (theSignal);
|
||||
#ifdef OSD_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cerr << " previous signal handler return" << endl ;
|
||||
#endif
|
||||
return;
|
||||
@@ -268,10 +268,7 @@ static void Handler (const int theSignal)
|
||||
sigprocmask(SIG_UNBLOCK, &set, NULL) ;
|
||||
#ifdef DECOSF1
|
||||
// Pour DEC/OSF1 SIGFPE = Division par zero.
|
||||
// should be clarified why in debug mode only?
|
||||
#ifdef DEBUG
|
||||
Standard_DivideByZero::NewInstance('')->Jump;
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
#if (!defined (__sun)) && (!defined(SOLARIS))
|
||||
@@ -318,7 +315,7 @@ static void Handler (const int theSignal)
|
||||
Standard_DivideByZero::NewInstance("SIGTRAP IntegerDivideByZero")->Jump(); break;
|
||||
#endif
|
||||
default:
|
||||
#ifdef OSD_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Unexpected signal " << theSignal << endl ;
|
||||
#endif
|
||||
break;
|
||||
@@ -359,7 +356,7 @@ static void SegvHandler(const int theSignal,
|
||||
OSD_SIGSEGV::NewInstance(Msg)->Jump();
|
||||
}
|
||||
}
|
||||
#ifdef OSD_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
else {
|
||||
cout << "Wrong undefined address." << endl ;
|
||||
}
|
||||
@@ -390,7 +387,7 @@ static void SegvHandler(const int theSignal,
|
||||
// scp->sc_pcoq_tail = scp->sc_pcoq_tail + 0x4 ; l'intruction suivant le segv.
|
||||
}
|
||||
}
|
||||
#ifdef OSD_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
else {
|
||||
cout << "Wrong undefined address." << endl ;
|
||||
}
|
||||
@@ -423,7 +420,7 @@ void OSD::SetSignal(const Standard_Boolean aFloatingSignal)
|
||||
//stat = ieee_handler("set", "inexact", PHandler) || stat;
|
||||
|
||||
if (stat) {
|
||||
#ifdef OSD_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cerr << "ieee_handler does not work !!! KO " << endl;
|
||||
#endif
|
||||
}
|
||||
@@ -442,7 +439,7 @@ void OSD::SetSignal(const Standard_Boolean aFloatingSignal)
|
||||
if ( first_time & 2 ) {
|
||||
char *TRAP_FPE = getenv("TRAP_FPE") ;
|
||||
if ( TRAP_FPE == NULL ) {
|
||||
#ifdef OSD_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
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 ;
|
||||
@@ -472,7 +469,7 @@ 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
|
||||
#ifdef OCCT_DEBUG
|
||||
cerr << "sigaction does not work !!! KO " << endl;
|
||||
#endif
|
||||
perror("sigaction ");
|
||||
|
Reference in New Issue
Block a user