[0.2.x] added : symengine.h

git-svn-id: https://pykd.svn.codeplex.com/svn@78453 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2012-08-02 10:07:01 +00:00 committed by Mikhail I. Izmestev
parent 1931d9be5f
commit 011f1b4ad5

147
pykd/symengine.h Normal file
View File

@ -0,0 +1,147 @@
#pragma once
namespace pykd {
////////////////////////////////////////////////////////////////////////////////
class Symbol;
typedef boost::shared_ptr< Symbol > SymbolPtr;
typedef std::list< SymbolPtr > SymbolPtrList;
////////////////////////////////////////////////////////////////////////////////
enum SymTagEnum
{
SymTagNull,
SymTagExe,
SymTagCompiland,
SymTagCompilandDetails,
SymTagCompilandEnv,
SymTagFunction,
SymTagBlock,
SymTagData,
SymTagAnnotation,
SymTagLabel,
SymTagPublicSymbol,
SymTagUDT,
SymTagEnum,
SymTagFunctionType,
SymTagPointerType,
SymTagArrayType,
SymTagBaseType,
SymTagTypedef,
SymTagBaseClass,
SymTagFriend,
SymTagFunctionArgType,
SymTagFuncDebugStart,
SymTagFuncDebugEnd,
SymTagUsingNamespace,
SymTagVTableShape,
SymTagVTable,
SymTagCustom,
SymTagThunk,
SymTagCustomType,
SymTagManagedType,
SymTagDimension,
SymTagMax
};
////////////////////////////////////////////////////////////////////////////////
enum LocationType
{
LocIsNull,
LocIsStatic,
LocIsTLS,
LocIsRegRel,
LocIsThisRel,
LocIsEnregistered,
LocIsBitField,
LocIsSlot,
LocIsIlRel,
LocInMetaData,
LocIsConstant,
LocTypeMax
};
////////////////////////////////////////////////////////////////////////////////
enum DataKind
{
DataIsUnknown,
DataIsLocal,
DataIsStaticLocal,
DataIsParam,
DataIsObjectPtr,
DataIsFileStatic,
DataIsGlobal,
DataIsMember,
DataIsStaticMember,
DataIsConstant
};
////////////////////////////////////////////////////////////////////////////////
enum BasicType
{
btNoType = 0,
btVoid = 1,
btChar = 2,
btWChar = 3,
btInt = 6,
btUInt = 7,
btFloat = 8,
btBCD = 9,
btBool = 10,
btLong = 13,
btULong = 14,
btCurrency = 25,
btDate = 26,
btVariant = 27,
btComplex = 28,
btBit = 29,
btBSTR = 30,
btHresult = 31
};
////////////////////////////////////////////////////////////////////////////////
class Symbol {
public:
virtual SymbolPtrList findChildren( ULONG symTag, const std::string &name = "", bool caseSensitive = FALSE ) = 0;
virtual ULONG getBaseType() = 0;
virtual ULONG getBitPosition() = 0;
virtual SymbolPtr getChildByIndex(ULONG _index ) = 0;
virtual SymbolPtr getChildByName(const std::string &_name) = 0;
virtual ULONG getChildCount() = 0;
virtual ULONG getChildCount(ULONG symTag ) = 0;
virtual ULONG getCount() = 0;
virtual ULONG getDataKind() = 0;
virtual ULONG getLocType() = 0;
virtual ULONG getMachineType() = 0;
virtual std::string getName() = 0;
virtual LONG getOffset() = 0;
virtual ULONG getRva() = 0;
virtual ULONGLONG getSize() = 0;
virtual ULONG getSymTag() = 0;
virtual SymbolPtr getType() = 0;
virtual ULONGLONG getVa() = 0;
virtual void getValue( VARIANT &vtValue) = 0;
virtual ULONG getVirtualBaseDispIndex() = 0;
virtual int getVirtualBasePointerOffset() = 0;
virtual bool isVirtualBaseClass() = 0;
virtual ULONG getVirtualBaseDispSize() = 0;
};
///////////////////////////////////////////////////////////////////////////////
std::string getBasicTypeName( ULONG basicType );
SymbolPtr loadSymbolFile(const std::string &filePath);
////////////////////////////////////////////////////////////////////////////////
}; // end pykd endpoint