From 260f9f868584d76e92d25a0a6801dc75e51de102 Mon Sep 17 00:00:00 2001 From: "SND\\EreTIk_cp" Date: Thu, 14 Nov 2013 10:23:52 +0000 Subject: [PATCH] [0.3.x] add: typeInfo.getClassParent, name of class methods git-svn-id: https://pykd.svn.codeplex.com/svn@86408 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd/pymod.cpp | 2 ++ test/scripts/typeinfo.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/pykd/pymod.cpp b/pykd/pymod.cpp index 3821f72..ed3e03c 100644 --- a/pykd/pymod.cpp +++ b/pykd/pymod.cpp @@ -516,6 +516,8 @@ BOOST_PYTHON_MODULE( pykd ) "Return flag: type is constant" ) .def( "getCallingConvention", &kdlib::TypeInfo::getCallingConvention, "Returns an indicator of a methods calling convention: callingConvention" ) + .def( "getClassParent", &kdlib::TypeInfo::getClassParent, + "Return class parent" ) .def( "__str__", &kdlib::TypeInfo::str, "Return type as a printable string" ) .def( "__getattr__", TypeInfoAdapter::getElementByName ) diff --git a/test/scripts/typeinfo.py b/test/scripts/typeinfo.py index 1994d61..d9be331 100644 --- a/test/scripts/typeinfo.py +++ b/test/scripts/typeinfo.py @@ -263,6 +263,12 @@ class TypeInfoTest( unittest.TestCase ): functype = target.module.typedVar( "CdeclFuncPtr" ).type().deref() self.assertEqual(functype.name(), "Void(__cdecl)(Int4B, Float)") + functype = target.module.typedVar( "MethodPtr" ).type().deref() + self.assertEqual(functype.name(), "Void(__thiscall FuncTestClass::)()") + def testFunctionPtrName(self): funcptrtype = target.module.typedVar( "CdeclFuncPtr" ).type() self.assertEqual(funcptrtype.name(), "Void(__cdecl*)(Int4B, Float)") + + functype = target.module.typedVar( "MethodPtr" ).type().deref() + self.assertEqual(functype.name(), "Void(__thiscall FuncTestClass::*)()")