cntb = f.read( GetSizeOfTCnt() )
cnt = TypeCounter.from_buffer_copy( cntb ).value
with open(fname,"rb+") as f:
+ #import KernelServices ; KernelServices.EntryForDebuggerBreakPoint()
f.write( bytes( TypeCounter(cnt+1) ) )
def DecrRefInFile(fname):
cntb = f.read( GetSizeOfTCnt() )
cnt = TypeCounter.from_buffer_copy( cntb ).value
#
+ #import KernelServices ; KernelServices.EntryForDebuggerBreakPoint()
if cnt == 1:
- pass
- #print("Remove {}".format(fname))
- #print("Remove {}".format(str(GetObjectFromFile(fname)[0])))
- #os.unlink( fname )
+ os.unlink( fname )
else:
with open(fname,"rb+") as f:
f.write( bytes( TypeCounter(cnt-1) ) )
if self._destroy:
DecrRefInFile( self._filename )
- def delDebug(self):
- import os
- if self._destroy:
- if os.path.exists( self._filename ):
- DecrRefInFile( self._filename )
- else:
- import KernelServices
- KernelServices.GenerateViolentMemoryFaultForTestPurpose()
-
def getFileName(self):
return self._filename
del ret3
import gc
gc.collect(0)
- #self.assertTrue( not os.path.exists( fn ) ) # at destruction of ret3 the corresponding pckl file must be destructed
+ self.assertTrue( not os.path.exists( fn ) ) # at destruction of ret3 the corresponding pckl file must be destructed
cont.Shutdown()
if __name__ == '__main__':
#include "SALOME_KernelServices.hxx"
+#include <iostream>
+
void RegisterCompoInternal(const std::string& compoName, const std::string& compoIOR)
{
CORBA::ORB_ptr orb = KERNEL::getORB();
double *a = nullptr;
*a = 0;
}
+
+/*!
+ * This method wrapped into Python is useful to have a break point in C++ when complex python script is invoked in the stack
+ */
+void EntryForDebuggerBreakPoint()
+{
+ std::cout << "b KernelServices.cxx:53" << std::endl;
+}
//
#ifndef __KERNELSERVICES_HXX__
#define __KERNELSERVICES_HXX__
+
#include <string>
void RegisterCompoInternal(const std::string& compoName, const std::string& compoIOR);
std::string RetrieveCompoInternal(const std::string& compoName);
void GenerateViolentMemoryFaultForTestPurpose();
+void EntryForDebuggerBreakPoint();
+
#endif
void RegisterCompoInternal(const std::string& compoName, const std::string& compoIOR);
std::string RetrieveCompoInternal(const std::string& compoName);
void GenerateViolentMemoryFaultForTestPurpose();
+ void EntryForDebuggerBreakPoint();
}
%pythoncode %{