mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-19 02:53:22 +08:00
[pykd_bootstrapper] added : resource info
git-svn-id: https://pykd.svn.codeplex.com/svn@90384 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
0aa0c0522b
commit
fa7ea2de18
@ -169,8 +169,10 @@
|
||||
<Text Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
<ClInclude Include="version.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="dllmain.cpp">
|
||||
@ -204,6 +206,9 @@
|
||||
<Project>{3e9c538f-f060-4e86-ab7d-d44439615b63}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="version.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
|
@ -24,6 +24,12 @@
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="version.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
@ -126,4 +132,9 @@
|
||||
</None>
|
||||
<None Include="packages.pykd_bootstrapper_vc120.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="version.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
14
pykd_bootstrapper/resource.h
Normal file
14
pykd_bootstrapper/resource.h
Normal file
@ -0,0 +1,14 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by version.rc
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
15
pykd_bootstrapper/version.h
Normal file
15
pykd_bootstrapper/version.h
Normal file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#define PYKDEXT_VERSION_MAJOR 1
|
||||
#define PYKDEXT_VERSION_MINOR 0
|
||||
#define PYKDEXT_VERSION_SUBVERSION 1
|
||||
#define PYKDEXT_VERSION_BUILDNO 2
|
||||
|
||||
#define __VER_STR2__(x) #x
|
||||
#define __VER_STR1__(x) __VER_STR2__(x)
|
||||
|
||||
#define PYKDEXT_VERSION_BUILD_COMMA PYKDEXT_VERSION_MAJOR, PYKDEXT_VERSION_MINOR, PYKDEXT_VERSION_SUBVERSION, PYKDEXT_VERSION_BUILDNO
|
||||
#define PYKDEXT_VERSION_BUILD PYKDEXT_VERSION_MAJOR.PYKDEXT_VERSION_MINOR.PYKDEXT_VERSION_SUBVERSION.PYKDEXT_VERSION_BUILDNO
|
||||
|
||||
#define PYKDEXT_VERSION_BUILD_STR_COMMA __VER_STR1__(PYKDEXT_VERSION_BUILD_COMMA)
|
||||
#define PYKDEXT_VERSION_BUILD_STR __VER_STR1__(PYKDEXT_VERSION_BUILD)
|
BIN
pykd_bootstrapper/version.rc
Normal file
BIN
pykd_bootstrapper/version.rc
Normal file
Binary file not shown.
@ -172,6 +172,14 @@ KDLIB_EXT_COMMAND_METHOD_IMPL(PykdBootsTrapper, py)
|
||||
|
||||
PyEval_RestoreThread(m_pyState);
|
||||
|
||||
python::handle<> pykdHandle(python::allow_null(PyImport_ImportModule("pykd")));
|
||||
if (!pykdHandle)
|
||||
{
|
||||
m_pyState = PyEval_SaveThread();
|
||||
kdlib::eprintln(L"Pykd package is not installed. You can install it by command \"!pykd.install\"");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string scriptFileName;
|
||||
if (args.size() > 0)
|
||||
{
|
||||
@ -179,6 +187,7 @@ KDLIB_EXT_COMMAND_METHOD_IMPL(PykdBootsTrapper, py)
|
||||
|
||||
if (scriptFileName.empty())
|
||||
{
|
||||
m_pyState = PyEval_SaveThread();
|
||||
kdlib::eprintln(L"script file not found");
|
||||
return;
|
||||
}
|
||||
@ -351,12 +360,6 @@ void PykdBootsTrapper::setUp()
|
||||
.def("readline", &::DbgIn::readline)
|
||||
.add_property("encoding", &::DbgIn::encoding);
|
||||
|
||||
python::object sys = python::import("sys");
|
||||
|
||||
sys.attr("stdout") = python::object(::DbgOut());
|
||||
sys.attr("stderr") = python::object(::DbgOut());
|
||||
sys.attr("stdin") = python::object(::DbgIn());
|
||||
|
||||
m_pyState = PyEval_SaveThread();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user