[0.3.x] added : PyTool project for tests

git-svn-id: https://pykd.svn.codeplex.com/svn@87875 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2014-04-11 09:55:38 +00:00 committed by Mikhail I. Izmestev
parent b878b501c4
commit d90c4a2776
9 changed files with 241 additions and 58 deletions

View File

@ -3,35 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012 # Visual Studio 2012
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{5A3C2DA6-AE91-4025-AC03-A58BD03CEBCD}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{5A3C2DA6-AE91-4025-AC03-A58BD03CEBCD}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{FE246107-1CB8-404F-97BD-E901E4B5E972}"
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\ehexcepttest.py = test\scripts\ehexcepttest.py
test\scripts\ehloadtest.py = test\scripts\ehloadtest.py
test\scripts\ehstatustest.py = test\scripts\ehstatustest.py
test\scripts\ehsymbolstest.py = test\scripts\ehsymbolstest.py
test\scripts\eventtest.py = test\scripts\eventtest.py
test\scripts\intbase.py = test\scripts\intbase.py
test\scripts\localstest.py = test\scripts\localstest.py
test\scripts\memtest.py = test\scripts\memtest.py
test\scripts\moduletest.py = test\scripts\moduletest.py
test\scripts\mspdbtest.py = test\scripts\mspdbtest.py
test\scripts\pykdtest.py = test\scripts\pykdtest.py
test\scripts\regtest.py = test\scripts\regtest.py
test\scripts\stacktest.py = test\scripts\stacktest.py
test\scripts\synsymtest.py = test\scripts\synsymtest.py
test\scripts\target.py = test\scripts\target.py
test\scripts\testutils.py = test\scripts\testutils.py
test\scripts\thrdctxtest.py = test\scripts\thrdctxtest.py
test\scripts\typedvar.py = test\scripts\typedvar.py
test\scripts\typeinfo.py = test\scripts\typeinfo.py
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{A7AF87D2-983B-4B3A-823F-5A2C6989672E}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{A7AF87D2-983B-4B3A-823F-5A2C6989672E}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
samples\samples.py = samples\samples.py samples\samples.py = samples\samples.py
@ -72,57 +43,103 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kdlib", "kdlibcpp\source\kd
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pykd", "pykd\pykd_vc110.vcxproj", "{C4C45791-0201-4406-BC5C-A384B01E3BF5}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pykd", "pykd\pykd_vc110.vcxproj", "{C4C45791-0201-4406-BC5C-A384B01E3BF5}"
EndProject EndProject
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "pykdtest", "test\scripts\pykdtest.pyproj", "{3F0BE77E-19B0-4192-B432-44A25805BCB8}"
ProjectSection(ProjectDependencies) = postProject
{C4C45791-0201-4406-BC5C-A384B01E3BF5} = {C4C45791-0201-4406-BC5C-A384B01E3BF5}
EndProjectSection
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_2.7|Any CPU = Debug_2.7|Any CPU
Debug_2.7|Mixed Platforms = Debug_2.7|Mixed Platforms
Debug_2.7|Win32 = Debug_2.7|Win32 Debug_2.7|Win32 = Debug_2.7|Win32
Debug_2.7|x64 = Debug_2.7|x64 Debug_2.7|x64 = Debug_2.7|x64
Release_2.7|Any CPU = Release_2.7|Any CPU
Release_2.7|Mixed Platforms = Release_2.7|Mixed Platforms
Release_2.7|Win32 = Release_2.7|Win32 Release_2.7|Win32 = Release_2.7|Win32
Release_2.7|x64 = Release_2.7|x64 Release_2.7|x64 = Release_2.7|x64
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug_2.7|Any CPU.ActiveCfg = Debug|Win32
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug_2.7|Mixed Platforms.ActiveCfg = Debug|Win32
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug_2.7|Mixed Platforms.Build.0 = Debug|Win32
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug_2.7|Mixed Platforms.Deploy.0 = Debug|Win32
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug_2.7|Win32.ActiveCfg = Debug|Win32 {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|Win32.Build.0 = Debug|Win32
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug_2.7|Win32.Deploy.0 = Debug|Win32 {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug_2.7|Win32.Deploy.0 = Debug|Win32
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug_2.7|x64.ActiveCfg = Debug|x64 {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_2.7|x64.Build.0 = Debug|x64
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug_2.7|x64.Deploy.0 = Debug|x64 {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Debug_2.7|x64.Deploy.0 = Debug|x64
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release_2.7|Any CPU.ActiveCfg = Release|Win32
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release_2.7|Mixed Platforms.ActiveCfg = Release|Win32
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release_2.7|Mixed Platforms.Build.0 = Release|Win32
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release_2.7|Mixed Platforms.Deploy.0 = Release|Win32
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release_2.7|Win32.ActiveCfg = Release|Win32 {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release_2.7|Win32.ActiveCfg = Release|Win32
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release_2.7|Win32.Build.0 = Release|Win32 {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release_2.7|Win32.Build.0 = Release|Win32
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release_2.7|Win32.Deploy.0 = Release|Win32 {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release_2.7|Win32.Deploy.0 = Release|Win32
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release_2.7|x64.ActiveCfg = Release|x64 {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release_2.7|x64.ActiveCfg = Release|x64
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release_2.7|x64.Build.0 = Release|x64 {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release_2.7|x64.Build.0 = Release|x64
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release_2.7|x64.Deploy.0 = Release|x64 {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF}.Release_2.7|x64.Deploy.0 = Release|x64
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug_2.7|Any CPU.ActiveCfg = Debug|Win32
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug_2.7|Mixed Platforms.ActiveCfg = Debug|Win32
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug_2.7|Mixed Platforms.Build.0 = Debug|Win32
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug_2.7|Mixed Platforms.Deploy.0 = Debug|Win32
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug_2.7|Win32.ActiveCfg = Debug|Win32 {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|Win32.Build.0 = Debug|Win32
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug_2.7|Win32.Deploy.0 = Debug|Win32 {3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug_2.7|Win32.Deploy.0 = Debug|Win32
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug_2.7|x64.ActiveCfg = Debug|x64 {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_2.7|x64.Build.0 = Debug|x64
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug_2.7|x64.Deploy.0 = Debug|x64 {3E9C538F-F060-4E86-AB7D-D44439615B63}.Debug_2.7|x64.Deploy.0 = Debug|x64
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Release_2.7|Any CPU.ActiveCfg = Release|Win32
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Release_2.7|Mixed Platforms.ActiveCfg = Release|Win32
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Release_2.7|Mixed Platforms.Build.0 = Release|Win32
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Release_2.7|Mixed Platforms.Deploy.0 = Release|Win32
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Release_2.7|Win32.ActiveCfg = Release|Win32 {3E9C538F-F060-4E86-AB7D-D44439615B63}.Release_2.7|Win32.ActiveCfg = Release|Win32
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Release_2.7|Win32.Build.0 = Release|Win32 {3E9C538F-F060-4E86-AB7D-D44439615B63}.Release_2.7|Win32.Build.0 = Release|Win32
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Release_2.7|Win32.Deploy.0 = Release|Win32 {3E9C538F-F060-4E86-AB7D-D44439615B63}.Release_2.7|Win32.Deploy.0 = Release|Win32
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Release_2.7|x64.ActiveCfg = Release|x64 {3E9C538F-F060-4E86-AB7D-D44439615B63}.Release_2.7|x64.ActiveCfg = Release|x64
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Release_2.7|x64.Build.0 = Release|x64 {3E9C538F-F060-4E86-AB7D-D44439615B63}.Release_2.7|x64.Build.0 = Release|x64
{3E9C538F-F060-4E86-AB7D-D44439615B63}.Release_2.7|x64.Deploy.0 = Release|x64 {3E9C538F-F060-4E86-AB7D-D44439615B63}.Release_2.7|x64.Deploy.0 = Release|x64
{C4C45791-0201-4406-BC5C-A384B01E3BF5}.Debug_2.7|Any CPU.ActiveCfg = Debug_2.7|Win32
{C4C45791-0201-4406-BC5C-A384B01E3BF5}.Debug_2.7|Mixed Platforms.ActiveCfg = Debug_2.7|Win32
{C4C45791-0201-4406-BC5C-A384B01E3BF5}.Debug_2.7|Mixed Platforms.Build.0 = Debug_2.7|Win32
{C4C45791-0201-4406-BC5C-A384B01E3BF5}.Debug_2.7|Mixed Platforms.Deploy.0 = Debug_2.7|Win32
{C4C45791-0201-4406-BC5C-A384B01E3BF5}.Debug_2.7|Win32.ActiveCfg = Debug_2.7|Win32 {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|Win32.Build.0 = Debug_2.7|Win32
{C4C45791-0201-4406-BC5C-A384B01E3BF5}.Debug_2.7|Win32.Deploy.0 = Debug_2.7|Win32 {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Debug_2.7|Win32.Deploy.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.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_2.7|x64.Build.0 = Debug_2.7|x64
{C4C45791-0201-4406-BC5C-A384B01E3BF5}.Debug_2.7|x64.Deploy.0 = Debug_2.7|x64 {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Debug_2.7|x64.Deploy.0 = Debug_2.7|x64
{C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release_2.7|Any CPU.ActiveCfg = Release_2.7|Win32
{C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release_2.7|Mixed Platforms.ActiveCfg = Release_2.7|Win32
{C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release_2.7|Mixed Platforms.Build.0 = Release_2.7|Win32
{C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release_2.7|Mixed Platforms.Deploy.0 = Release_2.7|Win32
{C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release_2.7|Win32.ActiveCfg = Release_2.7|Win32 {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release_2.7|Win32.ActiveCfg = Release_2.7|Win32
{C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release_2.7|Win32.Build.0 = Release_2.7|Win32 {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release_2.7|Win32.Build.0 = Release_2.7|Win32
{C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release_2.7|Win32.Deploy.0 = Release_2.7|Win32 {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release_2.7|Win32.Deploy.0 = Release_2.7|Win32
{C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release_2.7|x64.ActiveCfg = Release_2.7|x64 {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release_2.7|x64.ActiveCfg = Release_2.7|x64
{C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release_2.7|x64.Build.0 = Release_2.7|x64 {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release_2.7|x64.Build.0 = Release_2.7|x64
{C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release_2.7|x64.Deploy.0 = Release_2.7|x64 {C4C45791-0201-4406-BC5C-A384B01E3BF5}.Release_2.7|x64.Deploy.0 = Release_2.7|x64
{3F0BE77E-19B0-4192-B432-44A25805BCB8}.Debug_2.7|Any CPU.ActiveCfg = Debug|Any CPU
{3F0BE77E-19B0-4192-B432-44A25805BCB8}.Debug_2.7|Any CPU.Build.0 = Debug|Any CPU
{3F0BE77E-19B0-4192-B432-44A25805BCB8}.Debug_2.7|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3F0BE77E-19B0-4192-B432-44A25805BCB8}.Debug_2.7|Mixed Platforms.Build.0 = Debug|Any CPU
{3F0BE77E-19B0-4192-B432-44A25805BCB8}.Debug_2.7|Win32.ActiveCfg = Debug|Any CPU
{3F0BE77E-19B0-4192-B432-44A25805BCB8}.Debug_2.7|Win32.Build.0 = Debug|Any CPU
{3F0BE77E-19B0-4192-B432-44A25805BCB8}.Debug_2.7|x64.ActiveCfg = Debug|Any CPU
{3F0BE77E-19B0-4192-B432-44A25805BCB8}.Release_2.7|Any CPU.ActiveCfg = Release|Any CPU
{3F0BE77E-19B0-4192-B432-44A25805BCB8}.Release_2.7|Any CPU.Build.0 = Release|Any CPU
{3F0BE77E-19B0-4192-B432-44A25805BCB8}.Release_2.7|Mixed Platforms.ActiveCfg = Release|Any CPU
{3F0BE77E-19B0-4192-B432-44A25805BCB8}.Release_2.7|Mixed Platforms.Build.0 = Release|Any CPU
{3F0BE77E-19B0-4192-B432-44A25805BCB8}.Release_2.7|Win32.ActiveCfg = Release|Any CPU
{3F0BE77E-19B0-4192-B432-44A25805BCB8}.Release_2.7|x64.ActiveCfg = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution GlobalSection(NestedProjects) = preSolution
{FE246107-1CB8-404F-97BD-E901E4B5E972} = {5A3C2DA6-AE91-4025-AC03-A58BD03CEBCD}
{0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF} = {5A3C2DA6-AE91-4025-AC03-A58BD03CEBCD} {0E4CC688-F2F5-499F-9C07-0F2CAEE0D3EF} = {5A3C2DA6-AE91-4025-AC03-A58BD03CEBCD}
{3F0BE77E-19B0-4192-B432-44A25805BCB8} = {5A3C2DA6-AE91-4025-AC03-A58BD03CEBCD}
{EEFC9510-DFA7-439E-801E-48FCE72766AD} = {A7AF87D2-983B-4B3A-823F-5A2C6989672E} {EEFC9510-DFA7-439E-801E-48FCE72766AD} = {A7AF87D2-983B-4B3A-823F-5A2C6989672E}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@ -384,5 +384,81 @@ void breakPointRemove( kdlib::BREAKPOINT_ID id )
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
kdlib::BreakpointPtr Breakpoint::setSoftwareBreakpoint( kdlib::MEMOFFSET_64 offset )
{
Breakpoint *bp = new Breakpoint();
AutoRestorePyState pystate(&bp->m_pystate);
bp->set(offset);
return kdlib::BreakpointPtr(bp);
}
///////////////////////////////////////////////////////////////////////////////
kdlib::BreakpointPtr Breakpoint::setHardwareBreakpoint( kdlib::MEMOFFSET_64 offset, size_t size, kdlib::ACCESS_TYPE accessType )
{
Breakpoint *bp = new Breakpoint();
AutoRestorePyState pystate(&bp->m_pystate);
bp->set(offset, size, accessType);
return kdlib::BreakpointPtr(bp);
}
///////////////////////////////////////////////////////////////////////////////
kdlib::DebugCallbackResult Breakpoint::onHit()
{
kdlib::DebugCallbackResult result = kdlib::DebugCallbackNoChange;
PyEval_RestoreThread( m_pystate );
try {
do {
python::override pythonHandler = get_override( "onHit" );
if ( !pythonHandler )
{
result = kdlib::BaseBreakpoint::onHit();
break;
}
python::object resObj = pythonHandler();
if ( resObj.is_none() )
{
result = kdlib::DebugCallbackNoChange;
break;
}
int retVal = python::extract<int>( resObj );
if ( retVal >= kdlib::DebugCallbackMax )
{
result = kdlib::DebugCallbackBreak;
break;
}
result = kdlib::DebugCallbackResult(retVal);
} while( FALSE );
}
catch (const python::error_already_set &)
{
printException();
result = kdlib::DebugCallbackBreak;
}
m_pystate = PyEval_SaveThread();
return result;
}
///////////////////////////////////////////////////////////////////////////////
} // end namespace pykd } // end namespace pykd

View File

@ -48,26 +48,20 @@ kdlib::BREAKPOINT_ID setHardwareBreakpoint( kdlib::MEMOFFSET_64 offset, size_t s
void breakPointRemove( kdlib::BREAKPOINT_ID id ); void breakPointRemove( kdlib::BREAKPOINT_ID id );
//class Breakpoint : public kdlib::BaseBreakpoint { class Breakpoint : public python::wrapper<kdlib::Breakpoint>, public kdlib::BaseBreakpoint {
//
//public: public:
//
// static kdlib::BreakpointPtr setSoftwareBreakpoint( kdlib::MEMOFFSET_64 offset ) static kdlib::BreakpointPtr setSoftwareBreakpoint( kdlib::MEMOFFSET_64 offset );
// static kdlib::BreakpointPtr setHardwareBreakpoint( kdlib::MEMOFFSET_64 offset, size_t size, kdlib::ACCESS_TYPE accessType ); static kdlib::BreakpointPtr setHardwareBreakpoint( kdlib::MEMOFFSET_64 offset, size_t size, kdlib::ACCESS_TYPE accessType );
// static void breakPointRemove( kdlib::BREAKPOINT_ID id );
// private:
// ~Breakpoint();
// kdlib::DebugCallbackResult onHit();
//protected:
// PyThreadState* m_pystate;
// static BreakpointMap m_breakpointMap;
// static boost::recursive_mutex m_breakpointLock; };
//
// kdlib::BREAKPOINT_ID m_id;
//
// PyThreadState* m_pystate;
//
//};
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -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 3 #define PYKD_VERSION_BUILDNO 4
#define __VER_STR2__(x) #x #define __VER_STR2__(x) #x
#define __VER_STR1__(x) __VER_STR2__(x) #define __VER_STR1__(x) __VER_STR2__(x)

View File

@ -634,11 +634,6 @@ BOOST_PYTHON_MODULE( pykd )
.add_static_property( "VoidPtr", &BaseTypesEnum::getVoidPtr ) .add_static_property( "VoidPtr", &BaseTypesEnum::getVoidPtr )
; ;
//python::class_<kdlib::Breakpoint, kdlib::BreakpointPtr, boost::noncopyable>( "breakpoint",
// "class for breakpoint representation", python::no_init )
// .def("__init__", python::make_constructor(pykd::Breakpoint::setSoftwareBreakpoint) )
// .def("__init__", python::make_constructor(pykd::Breakpoint::setHardwareBreakpoint) )
// ;
python::class_<kdlib::StackFrame, kdlib::StackFramePtr, boost::noncopyable>( "stackFrame", python::class_<kdlib::StackFrame, kdlib::StackFramePtr, boost::noncopyable>( "stackFrame",
"class for stack's frame representation", python::no_init ) "class for stack's frame representation", python::no_init )
@ -882,6 +877,14 @@ BOOST_PYTHON_MODULE( pykd )
// "There is no return value"); // "There is no return value");
; ;
python::class_<kdlib::Breakpoint, kdlib::BreakpointPtr, boost::noncopyable>( "breakpoint",
"class for breakpoint representation", python::no_init )
.def("__init__", python::make_constructor(pykd::Breakpoint::setSoftwareBreakpoint) )
.def("__init__", python::make_constructor(pykd::Breakpoint::setHardwareBreakpoint) )
.def("onHit", &kdlib::Breakpoint::onHit,
"Breakpoint hit callback")
;
// C++ exception translation to python // C++ exception translation to python
pykd::registerExceptions(); pykd::registerExceptions();
} }

View File

@ -14,6 +14,12 @@ public:
m_state = PyEval_SaveThread(); m_state = PyEval_SaveThread();
} }
explicit AutoRestorePyState(PyThreadState **state)
{
*state = PyEval_SaveThread();
m_state = *state;
}
~AutoRestorePyState() ~AutoRestorePyState()
{ {
PyEval_RestoreThread( m_state ); PyEval_RestoreThread( m_state );

View File

@ -24,7 +24,7 @@ SetCompressor LZMA
!define PRODUCT_SHORT_NAME "pykd" !define PRODUCT_SHORT_NAME "pykd"
!define PRODUCT_FULL_NAME "Python extension for WinDbg" !define PRODUCT_FULL_NAME "Python extension for WinDbg"
!define PRODUCT_VERSION "0.3.0.1" !define PRODUCT_VERSION "0.3.0.4"
!define PRODUCT_URL "http://pykd.codeplex.com/" !define PRODUCT_URL "http://pykd.codeplex.com/"
!define PRODUCT_NAME_AND_VERSION "${PRODUCT_FULL_NAME} ${PRODUCT_ARCH} ${PRODUCT_VERSION}" !define PRODUCT_NAME_AND_VERSION "${PRODUCT_FULL_NAME} ${PRODUCT_ARCH} ${PRODUCT_VERSION}"
!define PRODUCT_MANUFACTURER "PyKd Team" !define PRODUCT_MANUFACTURER "PyKd Team"

View File

@ -103,7 +103,32 @@ class BreakpointTest( unittest.TestCase ):
self.assertEqual( pykd.Break, pykd.go() ) self.assertEqual( pykd.Break, pykd.go() )
self.assertEqual( 1, handler.count ) self.assertEqual( 1, handler.count )
def testBreakpointClass(self):
class MyBreakpoint(pykd.breakpoint):
def __init__(self,offset):
super(MyBreakpoint, self).__init__(offset)
self.count = 0
def onHit(self):
self.count = self.count + 1
processId = pykd.startProcess( target.appPath + " breakhandlertest" )
targetModule = pykd.module( target.moduleName )
targetModule.reload()
with testutils.ContextCallIt( testutils.KillProcess(processId) ) as killStartedProcess :
pykd.go()
bp = MyBreakpoint( targetModule.CdeclFunc )
pykd.setBp( targetModule.CdeclFunc )
self.assertEqual( pykd.Break, pykd.go() )
self.assertEqual( 1, bp.count )

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>3f0be77e-19b0-4192-b432-44a25805bcb8</ProjectGuid>
<ProjectHome>.</ProjectHome>
<StartupFile>pykdtest.py</StartupFile>
<SearchPath>
</SearchPath>
<WorkingDirectory>..\..\Debug_2.7</WorkingDirectory>
<OutputPath>.</OutputPath>
<Name>pykdtest</Name>
<RootNamespace>pykdtest</RootNamespace>
<LaunchProvider>Standard Python launcher</LaunchProvider>
<CommandLineArguments>targetapp.exe</CommandLineArguments>
<InterpreterPath />
<InterpreterArguments>
</InterpreterArguments>
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
<IsWindowsApplication>False</IsWindowsApplication>
<InterpreterId>
</InterpreterId>
<InterpreterVersion>
</InterpreterVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<ItemGroup>
<Compile Include="basetest.py" />
<Compile Include="breakpoint.py" />
<Compile Include="clienttest.py" />
<Compile Include="customtypestest.py" />
<Compile Include="dbgcmd.py" />
<Compile Include="ehexcepttest.py" />
<Compile Include="ehloadtest.py" />
<Compile Include="ehstatustest.py" />
<Compile Include="ehsymbolstest.py" />
<Compile Include="eventtest.py" />
<Compile Include="intbase.py" />
<Compile Include="localstest.py" />
<Compile Include="memtest.py" />
<Compile Include="moduletest.py" />
<Compile Include="mspdbtest.py" />
<Compile Include="pykdtest.py" />
<Compile Include="regtest.py" />
<Compile Include="stacktest.py" />
<Compile Include="synsymtest.py" />
<Compile Include="target.py" />
<Compile Include="testutils.py" />
<Compile Include="thrdctxtest.py" />
<Compile Include="typedvar.py" />
<Compile Include="typeinfo.py" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
</Project>