mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 12:53:23 +08:00
[0.3.x] fixed : some bug of pykd.dll
git-svn-id: https://pykd.svn.codeplex.com/svn@90071 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
bd39e5d050
commit
59f90a5d5a
@ -36,6 +36,8 @@ private:
|
|||||||
|
|
||||||
PyThreadState *m_pyState;
|
PyThreadState *m_pyState;
|
||||||
|
|
||||||
|
bool m_pykdInitialized;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -231,9 +233,11 @@ KDLIB_EXT_COMMAND_METHOD_IMPL(PykdBootsTrapper, py)
|
|||||||
try {
|
try {
|
||||||
InterruptWatch interruptWatch;
|
InterruptWatch interruptWatch;
|
||||||
|
|
||||||
python::exec("import pykd", global);
|
if (!m_pykdInitialized)
|
||||||
|
{
|
||||||
python::exec("from pykd import *", global);
|
python::exec("__import__('pykd').initialize()", global);
|
||||||
|
m_pykdInitialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
python::exec_file(scriptFileName.c_str(), global);
|
python::exec_file(scriptFileName.c_str(), global);
|
||||||
}
|
}
|
||||||
@ -379,6 +383,13 @@ void PykdBootsTrapper::startConsole()
|
|||||||
try {
|
try {
|
||||||
InterruptWatch interruptWatch;
|
InterruptWatch interruptWatch;
|
||||||
|
|
||||||
|
python::exec("import pykd", global);
|
||||||
|
python::exec("from pykd import *", global);
|
||||||
|
if (!m_pykdInitialized)
|
||||||
|
{
|
||||||
|
python::exec("pykd.initialize()", global);
|
||||||
|
m_pykdInitialized = true;
|
||||||
|
}
|
||||||
python::exec("__import__('code').InteractiveConsole(__import__('__main__').__dict__).interact()\n", global);
|
python::exec("__import__('code').InteractiveConsole(__import__('__main__').__dict__).interact()\n", global);
|
||||||
}
|
}
|
||||||
catch (python::error_already_set const &)
|
catch (python::error_already_set const &)
|
||||||
|
Loading…
Reference in New Issue
Block a user