From fa7ea2de18eada0a9a3fbecc7a6a6dba9a239eda Mon Sep 17 00:00:00 2001 From: "SND\\kernelnet_cp" Date: Wed, 15 Apr 2015 07:23:48 +0000 Subject: [PATCH] [pykd_bootstrapper] added : resource info git-svn-id: https://pykd.svn.codeplex.com/svn@90384 9b283d60-5439-405e-af05-b73fd8c4d996 --- .../pykd_bootstrapper_vc120.vcxproj | 5 +++++ .../pykd_bootstrapper_vc120.vcxproj.filters | 11 +++++++++++ pykd_bootstrapper/resource.h | 14 ++++++++++++++ pykd_bootstrapper/version.h | 15 +++++++++++++++ pykd_bootstrapper/version.rc | Bin 0 -> 5292 bytes pykd_bootstrapper/windbgext.cpp | 15 +++++++++------ 6 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 pykd_bootstrapper/resource.h create mode 100644 pykd_bootstrapper/version.h create mode 100644 pykd_bootstrapper/version.rc diff --git a/pykd_bootstrapper/pykd_bootstrapper_vc120.vcxproj b/pykd_bootstrapper/pykd_bootstrapper_vc120.vcxproj index 8cdac4b..7a67a73 100644 --- a/pykd_bootstrapper/pykd_bootstrapper_vc120.vcxproj +++ b/pykd_bootstrapper/pykd_bootstrapper_vc120.vcxproj @@ -169,8 +169,10 @@ + + @@ -204,6 +206,9 @@ {3e9c538f-f060-4e86-ab7d-d44439615b63} + + + diff --git a/pykd_bootstrapper/pykd_bootstrapper_vc120.vcxproj.filters b/pykd_bootstrapper/pykd_bootstrapper_vc120.vcxproj.filters index 85fe9fa..d7e05bd 100644 --- a/pykd_bootstrapper/pykd_bootstrapper_vc120.vcxproj.filters +++ b/pykd_bootstrapper/pykd_bootstrapper_vc120.vcxproj.filters @@ -24,6 +24,12 @@ Header Files + + Header Files + + + Header Files + @@ -126,4 +132,9 @@ + + + Resource Files + + \ No newline at end of file diff --git a/pykd_bootstrapper/resource.h b/pykd_bootstrapper/resource.h new file mode 100644 index 0000000..c3bc570 --- /dev/null +++ b/pykd_bootstrapper/resource.h @@ -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 diff --git a/pykd_bootstrapper/version.h b/pykd_bootstrapper/version.h new file mode 100644 index 0000000..20cf500 --- /dev/null +++ b/pykd_bootstrapper/version.h @@ -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) diff --git a/pykd_bootstrapper/version.rc b/pykd_bootstrapper/version.rc new file mode 100644 index 0000000000000000000000000000000000000000..d21dc690c2bc4651b7e98d0f484eb7040fd6ac91 GIT binary patch literal 5292 zcmd6rSx-|z6vxlAiQnN`UL-1;zW4~VRAQloE|G+!0Sed%t?A;D_}SIpf2PA-dap}G zax5uR0wr-If*uXAqY$KacuWZU#m$8Y>?96WX+O=nt$gb_uhSV|R zQ`$abV_NN-(Yv4@@g-^l`^cI#du)$5W!<$aj1HN-VRhfFtt{+cv-ehUtF?2*t-Esj zM0?wgtYvNMSk?BeX+1l(8lzSEht{wYMq2zH*bXBN`r&+GC|?QaLK|5fxnyO0g_K5i z3;$E3BRRC;`W?UfaJ>tkl1Gj4EoxRHzt_QMCttrWmVchMK5_aO4G+LGM7v2{l~1|> zk-teZ5bM@mA*1E)QP5JLTdp>si?E3qI+B*o;5o9Vsgc#3J2FXF+`vibNy_s2(Ac&; z?wq%{7S`2)>Mpmg$K7jCME4sdD%{zI#xXZsG&+u=07M`zc-wasV)dyovgw#7xUwq-Y6czDb1s@qX6T_({4y@s~P`op|h)lH;T z)01MhX`LG%^POTI@wwT-z~t|2)uG3}DSS>}v9-%_zfKUA?({LLx1*vEtzWf7v6 zOCtK)b5@+6?qg%}C%#B)dA?=wwn=uy6qdE$uJ&RInc!Uy==^VXn!iJ?EHa0)w(*KavwkXCfA>)SM;FjbEqJjq`b=0 z59mUx3^tjmgmJa1UAXG;TO$%Fx+r_>IbXO(U%QhtvR{pBXGCuw3Dz=eA~Mqx;)&vs zGP6bMJIGQytIX{}?SQg9r+Ea9CNmvo+V@I1pxxtS#n+ZQwFS}$pZ>*O;=dXWg?w@x zGks(g=6Z(jn3AWkdAI)(im_hoBBWb(p zBKPr~7M8Kow0_%A)7xo+ZWZT~RwS?Ktyu4oO>$s)DDS~M-WYA%(|mEpcR%??dE#*v ziMUTzA8UT~9$(Cvvoy=|EzX1{wEy}qj@~fYj57T%PLO4JWROK7gvIxL=;F 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(); }