From c90d280a9432712a2862299e2846b04c5da97fcd Mon Sep 17 00:00:00 2001 From: "SND\\kernelnet_cp" Date: Mon, 23 May 2011 09:36:01 +0000 Subject: [PATCH] [pykd] added : lost dbgexcept.cpp file git-svn-id: https://pykd.svn.codeplex.com/svn@65724 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd/dbgexcept.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 pykd/dbgexcept.cpp 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