diff --git a/pykd/dbgexcept.cpp b/pykd/dbgexcept.cpp new file mode 100644 index 0000000..e14b4c7 --- /dev/null +++ b/pykd/dbgexcept.cpp @@ -0,0 +1,41 @@ +#include "stdafx.h" +#include "dbgexcept.h" + +///////////////////////////////////////////////////////////////////////////////// + +// типы исключений + +PyObject *baseExceptionType = NULL; +PyObject *typeExceptionType = NULL; +PyObject *memoryExceptionType = NULL; + + + +///////////////////////////////////////////////////////////////////////////////// + +void DbgException::exceptionTranslate( const DbgException &e ) +{ + boost::python::object pyExcept(e); + + PyErr_SetObject( baseExceptionType, pyExcept.ptr()); +} + +///////////////////////////////////////////////////////////////////////////////// + +void TypeException::exceptionTranslate( const TypeException &e ) +{ + boost::python::object pyExcept(e); + + PyErr_SetObject( typeExceptionType, pyExcept.ptr()); +} + +///////////////////////////////////////////////////////////////////////////////// + +void MemoryException::translate( const MemoryException &e ) +{ + boost::python::object pyExcept(e); + + PyErr_SetObject( memoryExceptionType, pyExcept.ptr()); +} + +///////////////////////////////////////////////////////////////////////////////// \ No newline at end of file