From 30837343b367c3549e565d900ed9881220b9212d Mon Sep 17 00:00:00 2001 From: "SND\\EreTIk_cp" Date: Thu, 10 Jan 2013 12:11:47 +0000 Subject: [PATCH] [0.2.x] ~ TypeBuilder::createUnion - alignment is not necessary git-svn-id: https://pykd.svn.codeplex.com/svn@82227 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd/customtypes.cpp | 4 ++-- pykd/customtypes.h | 2 +- pykd/python/pymod.cpp | 14 +++----------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/pykd/customtypes.cpp b/pykd/customtypes.cpp index 28afe27..a98eb10 100644 --- a/pykd/customtypes.cpp +++ b/pykd/customtypes.cpp @@ -17,9 +17,9 @@ TypeInfoPtr TypeBuilder::createStruct( const std::string &name, ULONG align ) //////////////////////////////////////////////////////////////////////////////// -TypeInfoPtr TypeBuilder::createUnion( const std::string &name, ULONG align ) +TypeInfoPtr TypeBuilder::createUnion( const std::string &name ) { - return TypeInfoPtr( new CustomUnion( name, m_ptrSize, align ? align : m_ptrSize ) ); + return TypeInfoPtr( new CustomUnion( name, m_ptrSize, m_ptrSize ) ); } //////////////////////////////////////////////////////////////////////////////// diff --git a/pykd/customtypes.h b/pykd/customtypes.h index 5a84c48..ab3efe8 100644 --- a/pykd/customtypes.h +++ b/pykd/customtypes.h @@ -41,7 +41,7 @@ public: TypeInfoPtr createStruct( const std::string &name, ULONG align = 0 ); - TypeInfoPtr createUnion( const std::string &name, ULONG align = 0); + TypeInfoPtr createUnion( const std::string &name); private: diff --git a/pykd/python/pymod.cpp b/pykd/python/pymod.cpp index 8a09a96..02c2bea 100644 --- a/pykd/python/pymod.cpp +++ b/pykd/python/pymod.cpp @@ -64,7 +64,6 @@ BOOST_PYTHON_FUNCTION_OVERLOADS( setHardwareBp_, setHardwareBp, 3, 4 ); BOOST_PYTHON_FUNCTION_OVERLOADS( findSymbol_, TypeInfo::findSymbol, 1, 2 ); BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS( TypeBuilder_createStruct, TypeBuilder::createStruct, 1, 2 ); -BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS( TypeBuilder_createUnion, TypeBuilder::createUnion, 1, 2 ); BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS( Module_enumSymbols, Module::enumSymbols, 0, 1 ); BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS( Module_enumTypes, Module::enumTypes, 0, 1 ); @@ -292,13 +291,6 @@ BOOST_PYTHON_MODULE( pykd ) python::def( "setSymbolPath", &setSymbolPath, "Set current symbol path"); python::def( "appendSymbolPath", &appendSymbolPath, "Append current symbol path"); - //// custom types - //python::def( "createStruct", &CustomStruct::create, CustomStruct_create( python::args( "name", "align", "ptrSize" ), - // "Create empty structure. Use append() method for building" ) ); - //python::def( "createUnion", &CustomUnion::create, CustomUnion_create( python::args( "name", "ptrSize" ), - // "Create empty union. Use append() method for building" ) ); - //python::def( "pVoid", &PtrToVoid, "Create \"Void*\" type" ); - python::class_( "intBase", "intBase", python::no_init ) .def( python::init() ) .def( "__eq__", &intBase::eq ) @@ -476,9 +468,9 @@ BOOST_PYTHON_MODULE( pykd ) .add_property( "WChar", &TypeBuilder::getWChar ) .add_property( "VoidPtr", &TypeBuilder::getVoidPtr ) .def( "createStruct", &TypeBuilder::createStruct, TypeBuilder_createStruct( python::args( "name", "align" ), - "create custom struct" ) ) - .def( "createUnion", &TypeBuilder::createUnion, TypeBuilder_createUnion( python::args( "name", "align" ), - "create custom union" ) ); + "Create custom struct" ) ) + .def( "createUnion", &TypeBuilder::createUnion, + "Create custom union" ); python::class_ >( "cpuReg", "CPU regsiter class", boost::python::no_init )