From d1d6d3a6436ed5269e56ce09d69dafbec58d232e Mon Sep 17 00:00:00 2001 From: "SND\\kernelnet_cp" <SND\kernelnet_cp@9b283d60-5439-405e-af05-b73fd8c4d996> Date: Fri, 9 Dec 2011 14:55:58 +0000 Subject: [PATCH] [0.1.x] added : stackFrame class ( instead of dbgStackFrameClass ) git-svn-id: https://pykd.svn.codeplex.com/svn@72144 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd/dbgext.cpp | 13 +++++++++++++ test/scripts/basetest.py | 5 +++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pykd/dbgext.cpp b/pykd/dbgext.cpp index e857e01..4923dee 100644 --- a/pykd/dbgext.cpp +++ b/pykd/dbgext.cpp @@ -477,6 +477,19 @@ BOOST_PYTHON_MODULE( pykd ) .def( "instruction", &Disasm::instruction, "Returm current disassembled instruction" ) .def( "ea", &Disasm::ea, "Return effective address for last disassembled instruction or 0" ) .def( "reset", &Disasm::reset, "Reset current offset to begin" ); + + python::class_<DEBUG_STACK_FRAME>( "stackFrame", + "Class representing a frame of the call satck", python::no_init ) + .def_readonly( "instructionOffset", &DEBUG_STACK_FRAME::InstructionOffset, + "Return a frame's instruction offset" ) + .def_readonly( "returnOffset", &DEBUG_STACK_FRAME::ReturnOffset, + "Return a frame's return offset" ) + .def_readonly( "frameOffset", &DEBUG_STACK_FRAME::FrameOffset, + "Return a frame's offset" ) + .def_readonly( "stackOffset", &DEBUG_STACK_FRAME::StackOffset, + "Return a frame's stack offset" ) + .def_readonly( "frameNumber", &DEBUG_STACK_FRAME::FrameNumber, + "Return a frame's number" ); python::def( "diaLoadPdb", &pyDia::GlobalScope::loadPdb, "Open pdb file for quering debug symbols. Return DiaSymbol of global scope"); diff --git a/test/scripts/basetest.py b/test/scripts/basetest.py index 5d5a234..61139ed 100644 --- a/test/scripts/basetest.py +++ b/test/scripts/basetest.py @@ -94,7 +94,6 @@ class BaseTest( unittest.TestCase ): self.assertTrue( hasattr(pykd, 'TypeException') ) self.assertTrue( hasattr(pykd, 'WaitEventException') ) self.assertTrue( hasattr(pykd, 'bp') ) - self.assertTrue( hasattr(pykd, 'dbgStackFrameClass') ) self.assertTrue( hasattr(pykd, 'disasm') ) self.assertTrue( hasattr(pykd, 'ext') ) self.assertTrue( hasattr(pykd, 'intBase') ) @@ -106,6 +105,7 @@ class BaseTest( unittest.TestCase ): self.assertFalse( hasattr(pykd, 'containingRecord') ) self.assertFalse( hasattr(pykd, 'cpuReg') ) self.assertFalse( hasattr(pykd, 'dbgModuleClass') ) + self.assertFalse( hasattr(pykd, 'dbgStackFrameClass') ) self.assertFalse( hasattr(pykd, 'debugEvent') ) self.assertFalse( hasattr(pykd, 'findModule') ) self.assertFalse( hasattr(pykd, 'windbgIn') ) @@ -127,5 +127,6 @@ class BaseTest( unittest.TestCase ): self.assertTrue( hasattr(pykd, 'dbgClient') ) self.assertTrue( hasattr(pykd, 'din') ) self.assertTrue( hasattr(pykd, 'dout') ) - self.assertTrue( hasattr(pykd, 'module') ) self.assertTrue( hasattr(pykd, 'eventHandler' ) ) + self.assertTrue( hasattr(pykd, 'module') ) + self.assertTrue( hasattr(pykd, 'stackFrame') )