// *****************************************************************
// set signals
// *****************************************************************
-#if defined(__INTEL_COMPILER) || defined(__clang__)
- // FPE signals are disabled for Intel compiler (see #24589) and CLang (see #23802)
OSD::SetSignal(Standard_False);
-#else
- OSD::SetSignal();
-#endif
#ifdef _WIN32
// in interactive mode, force Windows to report dll loading problems interactively
#include <Message_Messenger.hxx>
#include <OSD.hxx>
#include <OSD_Chronometer.hxx>
+#include <OSD_Environment.hxx>
#include <OSD_Exception_CTRL_BREAK.hxx>
#include <OSD_MAllocHook.hxx>
#include <OSD_MemInfo.hxx>
return 0;
}
+//==============================================================================
+//function : dsetsignal
+//purpose :
+//==============================================================================
+
+static int dsetsignal (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
+{
+ // arm FPE handler if argument is provided and its first symbol is not '0'
+ // or if environment variable CSF_FPE is set and its first symbol is not '0'
+ bool setFPE = false;
+ if (theArgNb > 1 && theArgVec[1][0] != '0' && theArgVec[1][0] != '\0')
+ {
+ setFPE = true;
+ }
+ else
+ {
+ OSD_Environment aEnv ("CSF_FPE");
+ TCollection_AsciiString aEnvStr = aEnv.Value();
+ setFPE = (! aEnvStr.IsEmpty() && aEnvStr.Value(1) != '0');
+ }
+ OSD::SetSignal (setFPE);
+ theDI << "Signal handlers are set, with FPE " << (setFPE ? "armed" : "disarmed");
+ return 0;
+}
+
//==============================================================================
//function : dtracelevel
//purpose :
__FILE__, dmeminfo, g);
theCommands.Add("dperf","dperf [reset] -- show performance counters, reset if argument is provided",
__FILE__,dperf,g);
+ theCommands.Add("dsetsignal","dsetsignal [fpe=0] -- set OSD signal handler, with FPE option if argument is given",
+ __FILE__,dsetsignal,g);
// Logging commands; note that their names are hard-coded in the code
// of Draw_Interpretor, thus should not be changed without update of that code!
#endif //#ifdef _TK
// set signal handler in the new thread
-#if defined(__INTEL_COMPILER) || defined(__clang__)
- // FPE signals are disabled for Intel compiler (see #24589) and CLang (see #23802)
OSD::SetSignal(Standard_False);
-#else
- OSD::SetSignal();
-#endif
// inform the others that we have started
isTkLoopStarted = true;
set BugNumber OCC6143
-set OK_string "TestExcept: Successfull completion\n"
+dsetsignal 1
set IsDone [catch {set aResult [OCC6143]} result]
+dsetsignal
if { ${IsDone} != 0 } {
puts "result = ${result}"
puts "Faulty ${BugNumber}"
} else {
- if { [string first ${OK_string} ${aResult} ] != -1 } {
+ if { [string first "TestExcept: Successfull completion" ${aResult} ] != -1 } {
puts "OK ${BugNumber}"
} else {
puts "Faulty ${BugNumber}"