From 12693cae96e653725594e2eecbe52aedd0d4a932 Mon Sep 17 00:00:00 2001 From: "SND\\kernelnet_cp" Date: Wed, 17 Feb 2016 07:10:09 +0000 Subject: [PATCH] [bootstrapper] fixed : issue #3839 ( windbg is crashed after system reboot ) git-svn-id: https://pykd.svn.codeplex.com/svn@90920 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd_bootstrapper/windbgext.cpp | 34 +++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/pykd_bootstrapper/windbgext.cpp b/pykd_bootstrapper/windbgext.cpp index 1efa90f..7c3b44e 100644 --- a/pykd_bootstrapper/windbgext.cpp +++ b/pykd_bootstrapper/windbgext.cpp @@ -199,25 +199,13 @@ public: m_globalInterpreter = new PythonInterpreter(); - m_globalInterpreter->acivate(); + //m_globalInterpreter->acivate(); - python::object main = boost::python::import("__main__"); + //python::object main = boost::python::import("__main__"); - python::object main_namespace = main.attr("__dict__"); + //python::object main_namespace = main.attr("__dict__"); - // Python debug output console helper classes - python::class_("dout", "dout", python::no_init) - .def("write", &DbgOut::write) - .def("writedml", &DbgOut::writedml) - .def("flush", &DbgOut::flush) - .add_property("encoding", &DbgOut::encoding) - .add_property("closed", &DbgOut::closed); - - python::class_("din", "din", python::no_init) - .def("readline", &DbgIn::readline) - .add_property("closed", &DbgIn::closed); - - m_globalInterpreter->deactivate(); + //m_globalInterpreter->deactivate(); } void acivateGlobal() { @@ -266,6 +254,20 @@ private: { Py_Initialize(); PyEval_InitThreads(); + + // Python debug output console helper classes + python::class_("dout", "dout", python::no_init) + .def("write", &DbgOut::write) + .def("writedml", &DbgOut::writedml) + .def("flush", &DbgOut::flush) + .add_property("encoding", &DbgOut::encoding) + .add_property("closed", &DbgOut::closed); + + python::class_("din", "din", python::no_init) + .def("readline", &DbgIn::readline) + .add_property("closed", &DbgIn::closed); + + m_globalState = PyEval_SaveThread(); }