[0.2.x] fixed: typeBuilder returns wrong basic types

git-svn-id: https://pykd.svn.codeplex.com/svn@82204 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2013-01-09 13:14:44 +00:00 committed by Mikhail I. Izmestev
parent 22496fba41
commit f2daca89fc
5 changed files with 29 additions and 9 deletions

View File

@ -30,7 +30,7 @@ public:
TypeInfoPtr getInt4B() { return TypeInfo::getBaseTypeInfo( "Int4B" ); } TypeInfoPtr getInt4B() { return TypeInfo::getBaseTypeInfo( "Int4B" ); }
TypeInfoPtr getInt8B() { return TypeInfo::getBaseTypeInfo( "Int8B" ); } TypeInfoPtr getInt8B() { return TypeInfo::getBaseTypeInfo( "Int8B" ); }
TypeInfoPtr getLong() { return TypeInfo::getBaseTypeInfo( "Long" ); } TypeInfoPtr getLong() { return TypeInfo::getBaseTypeInfo( "Long" ); }
TypeInfoPtr getULong() { return TypeInfo::getBaseTypeInfo( "Ulong" ); } TypeInfoPtr getULong() { return TypeInfo::getBaseTypeInfo( "ULong" ); }
TypeInfoPtr getBool() { return TypeInfo::getBaseTypeInfo( "Bool" ); } TypeInfoPtr getBool() { return TypeInfo::getBaseTypeInfo( "Bool" ); }
TypeInfoPtr getChar() { return TypeInfo::getBaseTypeInfo( "Char" ); } TypeInfoPtr getChar() { return TypeInfo::getBaseTypeInfo( "Char" ); }
TypeInfoPtr getWChar() { return TypeInfo::getBaseTypeInfo( "WChar" ); } TypeInfoPtr getWChar() { return TypeInfo::getBaseTypeInfo( "WChar" ); }

View File

@ -2,7 +2,7 @@
#define PYKD_VERSION_MAJOR 0 #define PYKD_VERSION_MAJOR 0
#define PYKD_VERSION_MINOR 2 #define PYKD_VERSION_MINOR 2
#define PYKD_VERSION_SUBVERSION 0 #define PYKD_VERSION_SUBVERSION 0
#define PYKD_VERSION_BUILDNO 12 #define PYKD_VERSION_BUILDNO 13
#define __VER_STR2__(x) #x #define __VER_STR2__(x) #x

View File

@ -89,7 +89,7 @@ BOOST_PYTHON_MODULE( pykd )
// Manage debug target // Manage debug target
python::def( "startProcess", &startProcess, python::def( "startProcess", &startProcess,
"Start process for debugging"); "Start process for debugging" );
python::def( "attachProcess", &attachProcess, python::def( "attachProcess", &attachProcess,
"Attach debugger to a exsisting process" ); "Attach debugger to a exsisting process" );
python::def( "detachProcess", &detachProcess, detachProcess_( boost::python::args( "pid" ), python::def( "detachProcess", &detachProcess, detachProcess_( boost::python::args( "pid" ),
@ -470,10 +470,10 @@ BOOST_PYTHON_MODULE( pykd )
.add_property( "Int4B", &TypeBuilder::getInt4B ) .add_property( "Int4B", &TypeBuilder::getInt4B )
.add_property( "Int8B", &TypeBuilder::getInt8B ) .add_property( "Int8B", &TypeBuilder::getInt8B )
.add_property( "Long", &TypeBuilder::getLong ) .add_property( "Long", &TypeBuilder::getLong )
.add_property( "ULong", &TypeBuilder::getLong ) .add_property( "ULong", &TypeBuilder::getULong )
.add_property( "Bool", &TypeBuilder::getLong ) .add_property( "Bool", &TypeBuilder::getBool )
.add_property( "Char", &TypeBuilder::getLong ) .add_property( "Char", &TypeBuilder::getChar )
.add_property( "WChar", &TypeBuilder::getLong ) .add_property( "WChar", &TypeBuilder::getWChar )
.add_property( "VoidPtr", &TypeBuilder::getVoidPtr ) .add_property( "VoidPtr", &TypeBuilder::getVoidPtr )
.def( "createStruct", &TypeBuilder::createStruct, TypeBuilder_createStruct( python::args( "name", "align" ), .def( "createStruct", &TypeBuilder::createStruct, TypeBuilder_createStruct( python::args( "name", "align" ),
"create custom struct" ) ) "create custom struct" ) )

View File

@ -80,8 +80,7 @@ def buildDoc( ioStream, formatter, apiInfo ):
if cls.properties: if cls.properties:
ioStream.write( formatter.header4( "Properties:") ) ioStream.write( formatter.header4( "Properties:") )
for p in cls.properties: for p in cls.properties:
if p[1].__doc__ != None: ioStream.write( formatter.bulletItem( formatter.link( p[0], cls.__name__ + "." + p[0]) ) )
ioStream.write( formatter.bulletItem( formatter.link( p[0], cls.__name__ + "." + p[0]) ) )
if cls.methods: if cls.methods:
ioStream.write( formatter.header4( "Methods:") ) ioStream.write( formatter.header4( "Methods:") )

View File

@ -79,3 +79,24 @@ class CustomTypesTest(unittest.TestCase):
except pykd.TypeException: except pykd.TypeException:
exceptionRised = True exceptionRised = True
self.assertTrue(exceptionRised) self.assertTrue(exceptionRised)
def testBasicType(self):
tb = pykd.typeBuilder()
self.assertEqual( 1, tb.UInt1B.size() )
self.assertEqual( 2, tb.UInt2B.size() )
self.assertEqual( 4, tb.UInt4B.size() )
self.assertEqual( 8, tb.UInt8B.size() )
self.assertEqual( 1, tb.Int1B.size() )
self.assertEqual( 2, tb.Int2B.size() )
self.assertEqual( 4, tb.Int4B.size() )
self.assertEqual( 8, tb.Int8B.size() )
self.assertEqual( 1, tb.Bool.size() )
self.assertEqual( 1, tb.Char.size() )
self.assertEqual( 2, tb.WChar.size() )
self.assertEqual( 4, tb.Long.size() )
self.assertEqual( 4, tb.ULong.size() )
def testVoidPtr(self):
self.assertEqual( 4, pykd.typeBuilder(4).VoidPtr.size() )
self.assertEqual( 8, pykd.typeBuilder(8).VoidPtr.size() )
self.assertEqual( pykd.ptrSize(), pykd.typeBuilder().VoidPtr.size() )