From cb1df7cd3b7bf80ea7b69dbf24509a8fb1f99e25 Mon Sep 17 00:00:00 2001 From: "SND\\kernelnet_cp" Date: Wed, 31 Jul 2013 07:30:32 +0000 Subject: [PATCH] [0.3.x] fixed : x64 build git-svn-id: https://pykd.svn.codeplex.com/svn@84515 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd-0.3-2010.sln | 26 ++++++++-- pykd/cpucontext.cpp | 6 +-- pykd/cpucontext.h | 6 +-- pykd/pykd.vcxproj | 122 ++++++++++++++++++++++++++++++++++++++++++++ pykd/pymod.cpp | 5 ++ 5 files changed, 155 insertions(+), 10 deletions(-) diff --git a/pykd-0.3-2010.sln b/pykd-0.3-2010.sln index cbe723c..8fb6c8d 100644 --- a/pykd-0.3-2010.sln +++ b/pykd-0.3-2010.sln @@ -14,10 +14,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{FE24 ProjectSection(SolutionItems) = preProject test\scripts\_run_pykdtest.cmd = test\scripts\_run_pykdtest.cmd test\scripts\basetest.py = test\scripts\basetest.py + test\scripts\breakpoint.py = test\scripts\breakpoint.py test\scripts\clienttest.py = test\scripts\clienttest.py test\scripts\customtypestest.py = test\scripts\customtypestest.py test\scripts\dbgcmd.py = test\scripts\dbgcmd.py - test\scripts\diatest.py = test\scripts\diatest.py test\scripts\ehexcepttest.py = test\scripts\ehexcepttest.py test\scripts\ehloadtest.py = test\scripts\ehloadtest.py test\scripts\ehstatustest.py = test\scripts\ehstatustest.py @@ -39,35 +39,53 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{FE24 EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "targetapp", "kdlibcpp\tests\targetapp\targetapp.vcxproj", "{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}" - ProjectSection(ProjectDependencies) = postProject - {3E9C538F-F060-4E86-AB7D-D44439615B63} = {3E9C538F-F060-4E86-AB7D-D44439615B63} - EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug_2.7|Win32 = Debug_2.7|Win32 + Debug_2.7|x64 = Debug_2.7|x64 Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Debug_2.7|Win32.ActiveCfg = Debug_2.7|Win32 {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Debug_2.7|Win32.Build.0 = Debug_2.7|Win32 + {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Debug_2.7|x64.ActiveCfg = Debug_2.7|x64 + {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Debug_2.7|x64.Build.0 = Debug_2.7|x64 {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Debug|Win32.ActiveCfg = Debug|Win32 {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Debug|Win32.Build.0 = Debug|Win32 + {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Debug|x64.ActiveCfg = Debug|x64 + {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Debug|x64.Build.0 = Debug|x64 {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release|Win32.ActiveCfg = Release|Win32 {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release|Win32.Build.0 = Release|Win32 + {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release|x64.ActiveCfg = Release|x64 + {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release|x64.Build.0 = Release|x64 {3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug_2.7|Win32.ActiveCfg = Debug|Win32 {3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug_2.7|Win32.Build.0 = Debug|Win32 + {3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug_2.7|x64.ActiveCfg = Debug|x64 + {3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug_2.7|x64.Build.0 = Debug|x64 {3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug|Win32.ActiveCfg = Debug|Win32 {3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug|Win32.Build.0 = Debug|Win32 + {3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug|x64.ActiveCfg = Debug|x64 + {3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug|x64.Build.0 = Debug|x64 {3E9C538F-F060-4E86-AB7D-D44439615B63}.Release|Win32.ActiveCfg = Release|Win32 {3E9C538F-F060-4E86-AB7D-D44439615B63}.Release|Win32.Build.0 = Release|Win32 + {3E9C538F-F060-4E86-AB7D-D44439615B63}.Release|x64.ActiveCfg = Release|x64 + {3E9C538F-F060-4E86-AB7D-D44439615B63}.Release|x64.Build.0 = Release|x64 {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug_2.7|Win32.ActiveCfg = Debug|Win32 {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug_2.7|Win32.Build.0 = Debug|Win32 + {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug_2.7|x64.ActiveCfg = Debug|x64 + {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug_2.7|x64.Build.0 = Debug|x64 {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug|Win32.ActiveCfg = Debug|Win32 {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug|Win32.Build.0 = Debug|Win32 + {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug|x64.ActiveCfg = Debug|x64 + {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug|x64.Build.0 = Debug|x64 {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release|Win32.ActiveCfg = Release|Win32 {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release|Win32.Build.0 = Release|Win32 + {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release|x64.ActiveCfg = Release|x64 + {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/pykd/cpucontext.cpp b/pykd/cpucontext.cpp index 7a2f358..b1f80a8 100644 --- a/pykd/cpucontext.cpp +++ b/pykd/cpucontext.cpp @@ -16,7 +16,7 @@ python::object CPUContextAdaptor::getRegisterByName( kdlib::CPUContext& cpu, con /////////////////////////////////////////////////////////////////////////////// -python::object CPUContextAdaptor::getRegisterByIndex( kdlib::CPUContext& cpu, size_t index ) +python::object CPUContextAdaptor::getRegisterByIndex( kdlib::CPUContext& cpu, unsigned long index ) { kdlib::NumVariant var = cpu.getRegisterByIndex(index); std::wstring name = cpu.getRegisterName(index); @@ -28,13 +28,13 @@ python::object CPUContextAdaptor::getRegisterByIndex( kdlib::CPUContext& cpu, si python::list CPUContextAdaptor::getStack( kdlib::CPUContext& cpu ) { - size_t numberFrames = cpu.getStackLength(); + unsigned long numberFrames = cpu.getStackLength(); python::list lst; python::object typeObj = python::object( python::handle<>(&PyType_Type) ); python::object frameType = typeObj("frameType", python::tuple(), python::dict() ); - for ( size_t i = 0; i < numberFrames; ++i ) + for ( unsigned long i = 0; i < numberFrames; ++i ) { StackFrame frame; cpu.getStackFrame( i, frame.ip, frame.ret, frame.fp, frame.sp ); diff --git a/pykd/cpucontext.h b/pykd/cpucontext.h index cc9db5e..c74ea78 100644 --- a/pykd/cpucontext.h +++ b/pykd/cpucontext.h @@ -14,7 +14,7 @@ class CPUContextAdaptor { public: static python::object getRegisterByName( kdlib::CPUContext& cpu, const std::wstring &name ); - static python::object getRegisterByIndex( kdlib::CPUContext& cpu, size_t index ); + static python::object getRegisterByIndex( kdlib::CPUContext& cpu, unsigned long index ); static python::list getStack( kdlib::CPUContext& cpu ); }; @@ -29,12 +29,12 @@ inline python::object getRegisterByName( const std::wstring &name ) return CPUContextAdaptor::getRegisterByName( *kdlib::loadCPUCurrentContext().get(), name ); } -inline unsigned long long loadMSR( size_t msrIndex ) +inline unsigned long long loadMSR( unsigned long msrIndex ) { return kdlib::loadCPUCurrentContext()->loadMSR( msrIndex ); } -inline void setMSR( size_t msrIndex, unsigned long long value ) +inline void setMSR( unsigned long msrIndex, unsigned long long value ) { return kdlib::loadCPUCurrentContext()->setMSR( msrIndex, value ); } diff --git a/pykd/pykd.vcxproj b/pykd/pykd.vcxproj index 4eca006..0486815 100644 --- a/pykd/pykd.vcxproj +++ b/pykd/pykd.vcxproj @@ -5,14 +5,26 @@ Debug_2.7 Win32 + + Debug_2.7 + x64 + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {C4C45791-0201-4406-BC5C-A384B01E3BF5} @@ -25,41 +37,77 @@ true Unicode + + DynamicLibrary + true + Unicode + DynamicLibrary true Unicode + + DynamicLibrary + true + Unicode + DynamicLibrary false true Unicode + + DynamicLibrary + false + true + Unicode + + + + + + + + + + true + + true + true .pyd true + + true + .pyd + true + false + + false + Use @@ -82,6 +130,28 @@ + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;PYKD_EXPORTS;%(PreprocessorDefinitions) + $(ProjectDir)..\kdlibcpp\include;$(BOOST_ROOT); + + + Windows + true + pykd.def + + + + + + + + + + Use @@ -104,6 +174,28 @@ + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;PYKD_EXPORTS;%(PreprocessorDefinitions) + $(ProjectDir)..\kdlibcpp\include;$(BOOST_ROOT);$(PYTHON_27_X86_ROOT)\include; + + + Windows + true + pykd.def + $(PYTHON_27_X64_ROOT)\libs;$(BOOST_ROOT)\stage64_2.7\lib;%(AdditionalLibraryDirectories) + + + copy $(ProjectDir)..\Debug\targetapp.exe $(OutDir)targetapp.exe + + + + + + Level3 @@ -122,6 +214,24 @@ pykd.def + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;PYKD_EXPORTS;%(PreprocessorDefinitions) + $(ProjectDir)..\kdlibcpp\include + + + Windows + true + true + true + pykd.def + + @@ -143,21 +253,33 @@ false + false false + false + + + + false + false + + Create + Create Create + Create Create + Create diff --git a/pykd/pymod.cpp b/pykd/pymod.cpp index 510dacc..39b21bf 100644 --- a/pykd/pymod.cpp +++ b/pykd/pymod.cpp @@ -714,6 +714,11 @@ BOOST_PYTHON_MODULE( pykd ) .value("Inline", kdlib::CallConv_Inline ) .export_values(); + python::enum_("CPUType", "type of CPU") + .value("I386", kdlib::CPU_I386 ) + .value("AMD64", kdlib::CPU_AMD64 ) + .export_values(); + python::class_( "eventHandler", "Base class for overriding and handling debug notifications" ) .def( "onBreakpoint", &EventHandler::onBreakpoint,