mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 04:13:22 +08:00
[0.3.x] fixed : cannot find symbols with msdia120.dll
git-svn-id: https://pykd.svn.codeplex.com/svn@90398 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
1724a42cdb
commit
bc38bf259e
@ -91,7 +91,7 @@
|
|||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
<TargetExt>.pyd</TargetExt>
|
<TargetExt>.pyd</TargetExt>
|
||||||
<TargetName>$(ProjectName)</TargetName>
|
<TargetName>$(ProjectName)</TargetName>
|
||||||
<IntDir>$(SolutionDir)out\$(Platform)\$(Configuration)\</IntDir>
|
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||||
<OutDir>$(SolutionDir)out\$(Platform)\$(Configuration)\</OutDir>
|
<OutDir>$(SolutionDir)out\$(Platform)\$(Configuration)\</OutDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_2.7|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_2.7|x64'">
|
||||||
@ -99,7 +99,7 @@
|
|||||||
<TargetExt>.pyd</TargetExt>
|
<TargetExt>.pyd</TargetExt>
|
||||||
<TargetName>$(ProjectName)</TargetName>
|
<TargetName>$(ProjectName)</TargetName>
|
||||||
<OutDir>$(SolutionDir)out\$(Platform)\$(Configuration)\</OutDir>
|
<OutDir>$(SolutionDir)out\$(Platform)\$(Configuration)\</OutDir>
|
||||||
<IntDir>$(SolutionDir)out\$(Platform)\$(Configuration)\</IntDir>
|
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_2.7|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_2.7|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define PYKD_VERSION_MAJOR 0
|
#define PYKD_VERSION_MAJOR 0
|
||||||
#define PYKD_VERSION_MINOR 3
|
#define PYKD_VERSION_MINOR 3
|
||||||
#define PYKD_VERSION_SUBVERSION 0
|
#define PYKD_VERSION_SUBVERSION 0
|
||||||
#define PYKD_VERSION_BUILDNO 22
|
#define PYKD_VERSION_BUILDNO 23
|
||||||
|
|
||||||
#define __VER_STR2__(x) #x
|
#define __VER_STR2__(x) #x
|
||||||
#define __VER_STR1__(x) __VER_STR2__(x)
|
#define __VER_STR1__(x) __VER_STR2__(x)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#define PYKDEXT_VERSION_MAJOR 1
|
#define PYKDEXT_VERSION_MAJOR 1
|
||||||
#define PYKDEXT_VERSION_MINOR 0
|
#define PYKDEXT_VERSION_MINOR 0
|
||||||
#define PYKDEXT_VERSION_SUBVERSION 1
|
#define PYKDEXT_VERSION_SUBVERSION 1
|
||||||
#define PYKDEXT_VERSION_BUILDNO 3
|
#define PYKDEXT_VERSION_BUILDNO 5
|
||||||
|
|
||||||
#define __VER_STR2__(x) #x
|
#define __VER_STR2__(x) #x
|
||||||
#define __VER_STR1__(x) __VER_STR2__(x)
|
#define __VER_STR1__(x) __VER_STR2__(x)
|
||||||
|
@ -24,8 +24,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void startConsole();
|
|
||||||
|
|
||||||
void printUsage();
|
void printUsage();
|
||||||
|
|
||||||
void printException();
|
void printException();
|
||||||
@ -172,13 +170,10 @@ KDLIB_EXT_COMMAND_METHOD_IMPL(PykdBootsTrapper, py)
|
|||||||
|
|
||||||
PyEval_RestoreThread(m_pyState);
|
PyEval_RestoreThread(m_pyState);
|
||||||
|
|
||||||
python::handle<> pykdHandle(python::allow_null(PyImport_ImportModule("pykd")));
|
try {
|
||||||
if (!pykdHandle)
|
|
||||||
{
|
InterruptWatch interruptWatch;
|
||||||
m_pyState = PyEval_SaveThread();
|
|
||||||
kdlib::eprintln(L"Pykd package is not installed. You can install it by command \"!pykd.install\"");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string scriptFileName;
|
std::string scriptFileName;
|
||||||
if (args.size() > 0)
|
if (args.size() > 0)
|
||||||
@ -188,7 +183,9 @@ KDLIB_EXT_COMMAND_METHOD_IMPL(PykdBootsTrapper, py)
|
|||||||
if (scriptFileName.empty())
|
if (scriptFileName.empty())
|
||||||
{
|
{
|
||||||
m_pyState = PyEval_SaveThread();
|
m_pyState = PyEval_SaveThread();
|
||||||
|
|
||||||
kdlib::eprintln(L"script file not found");
|
kdlib::eprintln(L"script file not found");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,9 +211,29 @@ KDLIB_EXT_COMMAND_METHOD_IMPL(PykdBootsTrapper, py)
|
|||||||
sys.attr("stdin") = python::object(::DbgIn());
|
sys.attr("stdin") = python::object(::DbgIn());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ïîëó÷àåì äîñòóï ê ãëîáàëüíîìó ìàïó ( íóæåí äëÿ âûçîâà exec_file )
|
||||||
|
python::object main = python::import("__main__");
|
||||||
|
python::object globalScope(main.attr("__dict__"));
|
||||||
|
|
||||||
|
|
||||||
|
if (!m_pykdInitialized)
|
||||||
|
{
|
||||||
|
python::handle<> pykdHandle(python::allow_null(PyImport_ImportModule("pykd")));
|
||||||
|
if (!pykdHandle)
|
||||||
|
{
|
||||||
|
PyErr_SetString(PyExc_Exception, "Pykd package is not installed. You can install it by command \"!pykd.install\"");
|
||||||
|
python::throw_error_already_set();
|
||||||
|
}
|
||||||
|
|
||||||
|
python::exec("__import__('pykd').initialize()", globalScope);
|
||||||
|
m_pykdInitialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (args.size() == 0)
|
if (args.size() == 0)
|
||||||
{
|
{
|
||||||
startConsole();
|
python::exec("import pykd", globalScope);
|
||||||
|
python::exec("from pykd import *", globalScope);
|
||||||
|
python::exec("__import__('code').InteractiveConsole(__import__('__main__').__dict__).interact()", globalScope);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -232,27 +249,13 @@ KDLIB_EXT_COMMAND_METHOD_IMPL(PykdBootsTrapper, py)
|
|||||||
|
|
||||||
delete[] pythonArgs;
|
delete[] pythonArgs;
|
||||||
|
|
||||||
// ïîëó÷àåì äîñòïó ê ãëîáàëüíîìó ìàïó ( íóæåí äëÿ âûçîâà exec_file )
|
python::exec_file(scriptFileName.c_str(), globalScope);
|
||||||
python::object main = python::import("__main__");
|
|
||||||
|
|
||||||
python::object global(main.attr("__dict__"));
|
|
||||||
|
|
||||||
try {
|
|
||||||
InterruptWatch interruptWatch;
|
|
||||||
|
|
||||||
if (!m_pykdInitialized)
|
|
||||||
{
|
|
||||||
python::exec("__import__('pykd').initialize()", global);
|
|
||||||
m_pykdInitialized = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
python::exec_file(scriptFileName.c_str(), global);
|
|
||||||
}
|
}
|
||||||
catch (python::error_already_set const &)
|
catch (python::error_already_set const &)
|
||||||
{
|
{
|
||||||
printException();
|
printException();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!global)
|
if (!global)
|
||||||
{
|
{
|
||||||
@ -277,6 +280,7 @@ KDLIB_EXT_COMMAND_METHOD_IMPL(PykdBootsTrapper, py)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_pyState = PyEval_SaveThread();
|
m_pyState = PyEval_SaveThread();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -285,12 +289,13 @@ KDLIB_EXT_COMMAND_METHOD_IMPL(PykdBootsTrapper, install)
|
|||||||
{
|
{
|
||||||
PyEval_RestoreThread(m_pyState);
|
PyEval_RestoreThread(m_pyState);
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
// ïîëó÷àåì äîñòóï ê ãëîáàëüíîìó ìàïó ( íóæåí äëÿ âûçîâà exec_file )
|
// ïîëó÷àåì äîñòóï ê ãëîáàëüíîìó ìàïó ( íóæåí äëÿ âûçîâà exec_file )
|
||||||
python::object main = python::import("__main__");
|
python::object main = python::import("__main__");
|
||||||
|
|
||||||
python::object global(main.attr("__dict__"));
|
python::object global(main.attr("__dict__"));
|
||||||
|
|
||||||
try {
|
|
||||||
InterruptWatch interruptWatch;
|
InterruptWatch interruptWatch;
|
||||||
|
|
||||||
python::exec("import pip\n", global);
|
python::exec("import pip\n", global);
|
||||||
@ -312,14 +317,15 @@ KDLIB_EXT_COMMAND_METHOD_IMPL(PykdBootsTrapper, upgrade)
|
|||||||
{
|
{
|
||||||
PyEval_RestoreThread(m_pyState);
|
PyEval_RestoreThread(m_pyState);
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
InterruptWatch interruptWatch;
|
||||||
|
|
||||||
// ïîëó÷àåì äîñòóï ê ãëîáàëüíîìó ìàïó ( íóæåí äëÿ âûçîâà exec_file )
|
// ïîëó÷àåì äîñòóï ê ãëîáàëüíîìó ìàïó ( íóæåí äëÿ âûçîâà exec_file )
|
||||||
python::object main = python::import("__main__");
|
python::object main = python::import("__main__");
|
||||||
|
|
||||||
python::object global(main.attr("__dict__"));
|
python::object global(main.attr("__dict__"));
|
||||||
|
|
||||||
try {
|
|
||||||
InterruptWatch interruptWatch;
|
|
||||||
|
|
||||||
python::exec("import pip\n", global);
|
python::exec("import pip\n", global);
|
||||||
python::exec("pip.logger.consumers = []\n", global);
|
python::exec("pip.logger.consumers = []\n", global);
|
||||||
python::exec("pip.main(['install', '--upgrade', 'pykd'])\n", global);
|
python::exec("pip.main(['install', '--upgrade', 'pykd'])\n", global);
|
||||||
@ -372,41 +378,21 @@ void PykdBootsTrapper::tearDown()
|
|||||||
{
|
{
|
||||||
PyEval_RestoreThread(m_pyState);
|
PyEval_RestoreThread(m_pyState);
|
||||||
|
|
||||||
Py_Finalize();
|
if (m_pykdInitialized)
|
||||||
|
{
|
||||||
|
python::object main = python::import("__main__");
|
||||||
|
python::object globalScope(main.attr("__dict__"));
|
||||||
|
python::exec("__import__('pykd').deinitialize()", globalScope);
|
||||||
|
m_pykdInitialized = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Py_Finalize();
|
||||||
|
|
||||||
WindbgExtension::tearDown();
|
WindbgExtension::tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void PykdBootsTrapper::startConsole()
|
|
||||||
{
|
|
||||||
|
|
||||||
// ïîëó÷àåì äîñòóï ê ãëîáàëüíîìó ìàïó ( íóæåí äëÿ âûçîâà exec_file )
|
|
||||||
python::object main = python::import("__main__");
|
|
||||||
|
|
||||||
python::object global(main.attr("__dict__"));
|
|
||||||
|
|
||||||
try {
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
catch (python::error_already_set const &)
|
|
||||||
{
|
|
||||||
printException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void PykdBootsTrapper::printUsage()
|
void PykdBootsTrapper::printUsage()
|
||||||
{
|
{
|
||||||
kdlib::dprintln(L"usage:");
|
kdlib::dprintln(L"usage:");
|
||||||
|
Loading…
Reference in New Issue
Block a user