[0.3.x] fixed : some test failure

git-svn-id: https://pykd.svn.codeplex.com/svn@90469 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\ussrhero_cp 2015-04-23 22:24:54 +00:00 committed by Mikhail I. Izmestev
parent 60d3b958b8
commit b8828155e0
6 changed files with 14 additions and 18 deletions

View File

@ -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 5 #define PYKDEXT_VERSION_BUILDNO 6
#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

@ -132,7 +132,7 @@ class BreakpointTest( unittest.TestCase ):
pykd.go() pykd.go()
bp = MyBreakpoint( targetModule.CdeclFunc ) bp = MyBreakpoint( targetModule.typedVar("CdeclFunc").getDebugStart() )
self.assertEqual( pykd.executionStatus.Break, pykd.go() ) self.assertEqual( pykd.executionStatus.Break, pykd.go() )
@ -154,7 +154,7 @@ class BreakpointTest( unittest.TestCase ):
targetModule.reload() targetModule.reload()
with testutils.ContextCallIt( testutils.KillProcess(processId) ) as killStartedProcess : with testutils.ContextCallIt( testutils.KillProcess(processId) ) as killStartedProcess :
pykd.go() pykd.go()
bp = pykd.setBp( targetModule.CdeclFunc, makebpcallback(1) ) bp = pykd.setBp( targetModule.typedVar("CdeclFunc").getDebugStart(), makebpcallback(1) )
self.assertEqual( pykd.executionStatus.Break, pykd.go() ) self.assertEqual( pykd.executionStatus.Break, pykd.go() )
@ -163,7 +163,7 @@ class BreakpointTest( unittest.TestCase ):
targetModule.reload() targetModule.reload()
with testutils.ContextCallIt( testutils.KillProcess(processId) ) as killStartedProcess : with testutils.ContextCallIt( testutils.KillProcess(processId) ) as killStartedProcess :
pykd.go() pykd.go()
bp = pykd.setBp( targetModule.CdeclFunc, makebpcallback(100) ) bp = pykd.setBp(targetModule.typedVar("CdeclFunc").getDebugStart(), makebpcallback(100) )
self.assertEqual( pykd.executionStatus.NoDebuggee, pykd.go() ) self.assertEqual( pykd.executionStatus.NoDebuggee, pykd.go() )
def testBreakpointEnum(self): def testBreakpointEnum(self):

View File

@ -104,7 +104,7 @@ class ModuleTest( unittest.TestCase ):
# targetapp!ulongConst = 0x5555 # targetapp!ulongConst = 0x5555
# targetapp!classChild::m_staticConst = <no type information> # targetapp!classChild::m_staticConst = <no type information>
lst = target.module.enumSymbols( "*Const") lst = target.module.enumSymbols( "*Const")
self.assertEqual( 4, len(lst) ) self.assertEqual( 3, len(lst) )
lst = target.module.enumSymbols( "*cal?Func") lst = target.module.enumSymbols( "*cal?Func")
self.assertEqual( 4, len(lst) ) self.assertEqual( 4, len(lst) )

View File

@ -8,18 +8,18 @@
<StartupFile>pykdtest.py</StartupFile> <StartupFile>pykdtest.py</StartupFile>
<SearchPath> <SearchPath>
</SearchPath> </SearchPath>
<WorkingDirectory>..\..\out\Win32\Debug_2.7</WorkingDirectory> <WorkingDirectory>..\..\out\x64\Debug_2.7</WorkingDirectory>
<OutputPath>.</OutputPath> <OutputPath>.</OutputPath>
<Name>pykdtest</Name> <Name>pykdtest</Name>
<RootNamespace>pykdtest</RootNamespace> <RootNamespace>pykdtest</RootNamespace>
<LaunchProvider>Standard Python launcher</LaunchProvider> <LaunchProvider>Standard Python launcher</LaunchProvider>
<CommandLineArguments>C:\proj\pykd-rel\out\Win32\Debug\targetapp.exe</CommandLineArguments> <CommandLineArguments>C:\proj\pykd_dev\out\x64\Debug\targetapp.exe</CommandLineArguments>
<InterpreterPath /> <InterpreterPath />
<InterpreterArguments> <InterpreterArguments>
</InterpreterArguments> </InterpreterArguments>
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging> <EnableNativeCodeDebugging>True</EnableNativeCodeDebugging>
<IsWindowsApplication>False</IsWindowsApplication> <IsWindowsApplication>False</IsWindowsApplication>
<InterpreterId>{2af0f10d-7135-4994-9156-5d01c9c11b7e}</InterpreterId> <InterpreterId>{9a7a9026-48c1-4688-9d5d-e5699d47d074}</InterpreterId>
<InterpreterVersion>2.7</InterpreterVersion> <InterpreterVersion>2.7</InterpreterVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
@ -59,6 +59,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<InterpreterReference Include="{2af0f10d-7135-4994-9156-5d01c9c11b7e}\2.7" /> <InterpreterReference Include="{2af0f10d-7135-4994-9156-5d01c9c11b7e}\2.7" />
<InterpreterReference Include="{9a7a9026-48c1-4688-9d5d-e5699d47d074}\2.7" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
</Project> </Project>

View File

@ -15,19 +15,14 @@ class StackTest(unittest.TestCase):
expectedStack = [ 'targetapp!stackTestRun2', expectedStack = [ 'targetapp!stackTestRun2',
'targetapp!stackTestRun1', 'targetapp!stackTestRun1',
'targetapp!stackTestRun', 'targetapp!stackTestRun']
'targetapp!wmain',
'targetapp!__tmainCRTStartup',
'targetapp!wmainCRTStartup',
'kernel32!BaseThreadInitThunk',
'ntdll!RtlUserThreadStart' ]
realStack = [] realStack = []
for frame in pykd.getStack(): for frame in pykd.getStack():
moduleName, symbolName, disp = pykd.findSymbolAndDisp( frame.ip ) moduleName, symbolName, disp = pykd.findSymbolAndDisp( frame.ip )
realStack.append( "%s!%s" % ( moduleName, symbolName ) ) realStack.append( "%s!%s" % ( moduleName, symbolName ) )
self.assertEqual( expectedStack, realStack ) self.assertEqual( expectedStack, realStack[0:3])
def testGetParams(self): def testGetParams(self):
expectedParams = ["a", "b", "c"] expectedParams = ["a", "b", "c"]

View File

@ -23,7 +23,7 @@ class ProcessTest(unittest.TestCase):
threadNumber = proc.getNumberThreads() threadNumber = proc.getNumberThreads()
self.assertLess(0, threadNumber) self.assertLess(0, threadNumber)
for i in xrange(threadNumber): for i in xrange(threadNumber):
thread = proc.thread(i) thread = proc.getThread(i)
self.assertNotEqual(0, thread.systemID ) self.assertNotEqual(0, thread.systemID )
self.assertNotEqual(0, thread.teb ) self.assertNotEqual(0, thread.teb )
@ -39,7 +39,7 @@ class ProcessTest(unittest.TestCase):
threadNumber = proc.getNumberThreads() threadNumber = proc.getNumberThreads()
self.assertLess(0, threadNumber) self.assertLess(0, threadNumber)
for i in xrange(threadNumber): for i in xrange(threadNumber):
thread = proc.thread(i) thread = proc.getThread(i)
thread.setCurrent() thread.setCurrent()
def testGetBreakpoint(self): def testGetBreakpoint(self):