mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 03:23:23 +08:00

+ get local variables dict {name: typedVar, ....} ~ DiaSymbol::findEx add default params ~ re-query pdb-file name for module + dataKind for typedVar git-svn-id: https://pykd.svn.codeplex.com/svn@73103 9b283d60-5439-405e-af05-b73fd8c4d996
33 lines
1.2 KiB
Python
33 lines
1.2 KiB
Python
"""Local variables tests"""
|
|
|
|
import unittest
|
|
import target
|
|
import pykd
|
|
|
|
class LocalVarsTest(unittest.TestCase):
|
|
def testLocalVariable(self):
|
|
"""Start new process and break in targetapp!EnumWindowsProc"""
|
|
|
|
testClient = pykd.createDbgClient()
|
|
testClient.startProcess( target.appPath + " -testEnumWindows" )
|
|
|
|
testClient.go() # initial breakpoint -> wmain
|
|
testClient.go() # wmain -> targetapp!EnumWindowsProc
|
|
# pykd.dprint( "\n" + testClient.dbgCommand("u") )
|
|
|
|
locals = testClient.getLocals()
|
|
|
|
self.assertNotEqual( 0, locals["hWindow"] )
|
|
self.assertEqual( pykd.DataIsParam, locals["hWindow"].dataKind() )
|
|
|
|
self.assertEqual( 6, locals["lParam"] )
|
|
self.assertEqual( pykd.DataIsParam, locals["lParam"].dataKind() )
|
|
|
|
self.assertNotEqual( 0, locals["dwProccessId"] )
|
|
self.assertEqual( pykd.DataIsLocal, locals["dwProccessId"].dataKind() )
|
|
|
|
self.assertNotEqual( 0, locals["staticVar"] )
|
|
self.assertEqual( pykd.DataIsStaticLocal, locals["staticVar"].dataKind() )
|
|
|
|
self.assertEqual( locals["dwProccessId"], locals["staticVar"] )
|