mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 04:13:22 +08:00
[0.2.x] added : typeInfo class
git-svn-id: https://pykd.svn.codeplex.com/svn@78452 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
733ee783ca
commit
1931d9be5f
@ -15,6 +15,7 @@ ULONG ptrSize();
|
|||||||
//manage debug module
|
//manage debug module
|
||||||
ULONG64 findModuleBase( const std::string &moduleName );
|
ULONG64 findModuleBase( const std::string &moduleName );
|
||||||
ULONG64 findModuleBase( ULONG64 offset );
|
ULONG64 findModuleBase( ULONG64 offset );
|
||||||
|
ULONG64 findModuleBySymbol( const std::string &symbolName );
|
||||||
std::string getModuleName( ULONG64 baseOffset );
|
std::string getModuleName( ULONG64 baseOffset );
|
||||||
std::string getModuleImageName( ULONG64 baseOffset );
|
std::string getModuleImageName( ULONG64 baseOffset );
|
||||||
std::string getModuleSymbolFileName( ULONG64 baseOffset );
|
std::string getModuleSymbolFileName( ULONG64 baseOffset );
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
|
||||||
|
#include <dbgeng.h>
|
||||||
|
|
||||||
//#include <boost/tokenizer.hpp>
|
//#include <boost/tokenizer.hpp>
|
||||||
//
|
//
|
||||||
//#include "windbg.h"
|
//#include "windbg.h"
|
||||||
|
563
pykd/dia/diadata.cpp
Normal file
563
pykd/dia/diadata.cpp
Normal file
@ -0,0 +1,563 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
#include "diawrapper.h"
|
||||||
|
|
||||||
|
namespace pykd {
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#define _DEF_BASIC_TYPE(x) DiaSymbol::ValueNameEntry(bt##x, #x)
|
||||||
|
const DiaSymbol::ValueNameEntry DiaSymbol::basicTypeName[] = {
|
||||||
|
_DEF_BASIC_TYPE(NoType),
|
||||||
|
_DEF_BASIC_TYPE(Void),
|
||||||
|
_DEF_BASIC_TYPE(Char),
|
||||||
|
_DEF_BASIC_TYPE(WChar),
|
||||||
|
_DEF_BASIC_TYPE(Int),
|
||||||
|
_DEF_BASIC_TYPE(UInt),
|
||||||
|
_DEF_BASIC_TYPE(Float),
|
||||||
|
_DEF_BASIC_TYPE(BCD),
|
||||||
|
_DEF_BASIC_TYPE(Bool),
|
||||||
|
_DEF_BASIC_TYPE(Long),
|
||||||
|
_DEF_BASIC_TYPE(ULong),
|
||||||
|
_DEF_BASIC_TYPE(Currency),
|
||||||
|
_DEF_BASIC_TYPE(Date),
|
||||||
|
_DEF_BASIC_TYPE(Variant),
|
||||||
|
_DEF_BASIC_TYPE(Complex),
|
||||||
|
_DEF_BASIC_TYPE(Bit),
|
||||||
|
_DEF_BASIC_TYPE(BSTR),
|
||||||
|
_DEF_BASIC_TYPE(Hresult)
|
||||||
|
};
|
||||||
|
#undef _DEF_BASIC_TYPE
|
||||||
|
|
||||||
|
const size_t DiaSymbol::cntBasicTypeName = _countof(DiaSymbol::basicTypeName);
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
} //pykd namespace end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
//#include "diawrapper.h"
|
||||||
|
//#include "utils.h"
|
||||||
|
//
|
||||||
|
//namespace pyDia {
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
//#define _DEF_SYM_TAG_VAL(x) Symbol::ValueNameEntry(SymTag##x, #x)
|
||||||
|
//const Symbol::ValueNameEntry Symbol::symTagName[SymTagMax] = {
|
||||||
|
// _DEF_SYM_TAG_VAL(Null),
|
||||||
|
// _DEF_SYM_TAG_VAL(Exe),
|
||||||
|
// _DEF_SYM_TAG_VAL(Compiland),
|
||||||
|
// _DEF_SYM_TAG_VAL(CompilandDetails),
|
||||||
|
// _DEF_SYM_TAG_VAL(CompilandEnv),
|
||||||
|
// _DEF_SYM_TAG_VAL(Function),
|
||||||
|
// _DEF_SYM_TAG_VAL(Block),
|
||||||
|
// _DEF_SYM_TAG_VAL(Data),
|
||||||
|
// _DEF_SYM_TAG_VAL(Annotation),
|
||||||
|
// _DEF_SYM_TAG_VAL(Label),
|
||||||
|
// _DEF_SYM_TAG_VAL(PublicSymbol),
|
||||||
|
// _DEF_SYM_TAG_VAL(UDT),
|
||||||
|
// _DEF_SYM_TAG_VAL(Enum),
|
||||||
|
// _DEF_SYM_TAG_VAL(FunctionType),
|
||||||
|
// _DEF_SYM_TAG_VAL(PointerType),
|
||||||
|
// _DEF_SYM_TAG_VAL(ArrayType),
|
||||||
|
// _DEF_SYM_TAG_VAL(BaseType),
|
||||||
|
// _DEF_SYM_TAG_VAL(Typedef),
|
||||||
|
// _DEF_SYM_TAG_VAL(BaseClass),
|
||||||
|
// _DEF_SYM_TAG_VAL(Friend),
|
||||||
|
// _DEF_SYM_TAG_VAL(FunctionArgType),
|
||||||
|
// _DEF_SYM_TAG_VAL(FuncDebugStart),
|
||||||
|
// _DEF_SYM_TAG_VAL(FuncDebugEnd),
|
||||||
|
// _DEF_SYM_TAG_VAL(UsingNamespace),
|
||||||
|
// _DEF_SYM_TAG_VAL(VTableShape),
|
||||||
|
// _DEF_SYM_TAG_VAL(VTable),
|
||||||
|
// _DEF_SYM_TAG_VAL(Custom),
|
||||||
|
// _DEF_SYM_TAG_VAL(Thunk),
|
||||||
|
// _DEF_SYM_TAG_VAL(CustomType),
|
||||||
|
// _DEF_SYM_TAG_VAL(ManagedType),
|
||||||
|
// _DEF_SYM_TAG_VAL(Dimension)
|
||||||
|
//};
|
||||||
|
//#undef _DEF_SYM_TAG_VAL
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
//#define _DEF_DATA_KIND_VAL(x) Symbol::ValueNameEntry(DataIs##x, #x)
|
||||||
|
//const Symbol::ValueNameEntry Symbol::dataKindName[DataIsConstant + 1] = {
|
||||||
|
// _DEF_DATA_KIND_VAL(Unknown),
|
||||||
|
// _DEF_DATA_KIND_VAL(Local),
|
||||||
|
// _DEF_DATA_KIND_VAL(StaticLocal),
|
||||||
|
// _DEF_DATA_KIND_VAL(Param),
|
||||||
|
// _DEF_DATA_KIND_VAL(ObjectPtr),
|
||||||
|
// _DEF_DATA_KIND_VAL(FileStatic),
|
||||||
|
// _DEF_DATA_KIND_VAL(Global),
|
||||||
|
// _DEF_DATA_KIND_VAL(Member),
|
||||||
|
// _DEF_DATA_KIND_VAL(StaticMember),
|
||||||
|
// _DEF_DATA_KIND_VAL(Constant)
|
||||||
|
//};
|
||||||
|
//#undef _DEF_DATA_KIND_VAL
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
//#define _DEF_LOC_TYPE(x) Symbol::ValueNameEntry(LocIs##x, #x)
|
||||||
|
//const Symbol::ValueNameEntry Symbol::locTypeName[LocTypeMax] = {
|
||||||
|
// _DEF_LOC_TYPE(Null),
|
||||||
|
// _DEF_LOC_TYPE(Static),
|
||||||
|
// _DEF_LOC_TYPE(TLS),
|
||||||
|
// _DEF_LOC_TYPE(RegRel),
|
||||||
|
// _DEF_LOC_TYPE(ThisRel),
|
||||||
|
// _DEF_LOC_TYPE(Enregistered),
|
||||||
|
// _DEF_LOC_TYPE(BitField),
|
||||||
|
// _DEF_LOC_TYPE(Slot),
|
||||||
|
// _DEF_LOC_TYPE(IlRel),
|
||||||
|
// Symbol::ValueNameEntry(LocInMetaData, "InMetaData"),
|
||||||
|
// _DEF_LOC_TYPE(Constant)
|
||||||
|
//};
|
||||||
|
//#undef _DEF_LOC_TYPE
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
//#define _DEF_BASIC_TYPE(x) Symbol::ValueNameEntry(bt##x, #x)
|
||||||
|
//const Symbol::ValueNameEntry Symbol::basicTypeName[] = {
|
||||||
|
// _DEF_BASIC_TYPE(NoType),
|
||||||
|
// _DEF_BASIC_TYPE(Void),
|
||||||
|
// _DEF_BASIC_TYPE(Char),
|
||||||
|
// _DEF_BASIC_TYPE(WChar),
|
||||||
|
// _DEF_BASIC_TYPE(Int),
|
||||||
|
// _DEF_BASIC_TYPE(UInt),
|
||||||
|
// _DEF_BASIC_TYPE(Float),
|
||||||
|
// _DEF_BASIC_TYPE(BCD),
|
||||||
|
// _DEF_BASIC_TYPE(Bool),
|
||||||
|
// _DEF_BASIC_TYPE(Long),
|
||||||
|
// _DEF_BASIC_TYPE(ULong),
|
||||||
|
// _DEF_BASIC_TYPE(Currency),
|
||||||
|
// _DEF_BASIC_TYPE(Date),
|
||||||
|
// _DEF_BASIC_TYPE(Variant),
|
||||||
|
// _DEF_BASIC_TYPE(Complex),
|
||||||
|
// _DEF_BASIC_TYPE(Bit),
|
||||||
|
// _DEF_BASIC_TYPE(BSTR),
|
||||||
|
// _DEF_BASIC_TYPE(Hresult)
|
||||||
|
//};
|
||||||
|
//#undef _DEF_BASIC_TYPE
|
||||||
|
//
|
||||||
|
//const size_t Symbol::cntBasicTypeName = _countof(Symbol::basicTypeName);
|
||||||
|
//
|
||||||
|
//std::string Symbol::getBasicTypeName( ULONG basicType )
|
||||||
|
//{
|
||||||
|
// for ( size_t i = 0; i < Symbol::cntBasicTypeName; ++i )
|
||||||
|
// {
|
||||||
|
// if ( basicType == Symbol::basicTypeName[i].first )
|
||||||
|
// return std::string( Symbol::basicTypeName[i].second );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// std::stringstream sstr;
|
||||||
|
//
|
||||||
|
// sstr << "faild to find basic type with index %d" << basicType;
|
||||||
|
//
|
||||||
|
// throw Exception( sstr.str() );
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
//#define _DEF_UDT_KIND(x) Symbol::ValueNameEntry(Udt##x, #x)
|
||||||
|
//const Symbol::ValueNameEntry Symbol::udtKindName[] = {
|
||||||
|
// _DEF_UDT_KIND(Struct),
|
||||||
|
// _DEF_UDT_KIND(Class),
|
||||||
|
// _DEF_UDT_KIND(Union)
|
||||||
|
//};
|
||||||
|
//#undef _DEF_UDT_KIND
|
||||||
|
//
|
||||||
|
//const size_t Symbol::cntUdtKindName = _countof(udtKindName);
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
//#define _DEF_I386_REG(x) Symbol::ValueNameEntry(CV_REG_##x, #x)
|
||||||
|
//const Symbol::ValueNameEntry Symbol::i386RegName[] = {
|
||||||
|
// _DEF_I386_REG(AL),
|
||||||
|
// _DEF_I386_REG(CL),
|
||||||
|
// _DEF_I386_REG(DL),
|
||||||
|
// _DEF_I386_REG(BL),
|
||||||
|
// _DEF_I386_REG(AH),
|
||||||
|
// _DEF_I386_REG(CH),
|
||||||
|
// _DEF_I386_REG(DH),
|
||||||
|
// _DEF_I386_REG(BH),
|
||||||
|
// _DEF_I386_REG(AX),
|
||||||
|
// _DEF_I386_REG(CX),
|
||||||
|
// _DEF_I386_REG(DX),
|
||||||
|
// _DEF_I386_REG(BX),
|
||||||
|
// _DEF_I386_REG(SP),
|
||||||
|
// _DEF_I386_REG(BP),
|
||||||
|
// _DEF_I386_REG(SI),
|
||||||
|
// _DEF_I386_REG(DI),
|
||||||
|
// _DEF_I386_REG(EAX),
|
||||||
|
// _DEF_I386_REG(ECX),
|
||||||
|
// _DEF_I386_REG(EDX),
|
||||||
|
// _DEF_I386_REG(EBX),
|
||||||
|
// _DEF_I386_REG(ESP),
|
||||||
|
// _DEF_I386_REG(EBP),
|
||||||
|
// _DEF_I386_REG(ESI),
|
||||||
|
// _DEF_I386_REG(EDI),
|
||||||
|
// _DEF_I386_REG(ES),
|
||||||
|
// _DEF_I386_REG(CS),
|
||||||
|
// _DEF_I386_REG(SS),
|
||||||
|
// _DEF_I386_REG(DS),
|
||||||
|
// _DEF_I386_REG(FS),
|
||||||
|
// _DEF_I386_REG(GS),
|
||||||
|
// _DEF_I386_REG(IP),
|
||||||
|
// _DEF_I386_REG(FLAGS ),
|
||||||
|
// _DEF_I386_REG(EIP),
|
||||||
|
// _DEF_I386_REG(EFLAGS),
|
||||||
|
// _DEF_I386_REG(TEMP),
|
||||||
|
// _DEF_I386_REG(TEMPH),
|
||||||
|
// _DEF_I386_REG(QUOTE),
|
||||||
|
// _DEF_I386_REG(PCDR3),
|
||||||
|
// _DEF_I386_REG(PCDR4),
|
||||||
|
// _DEF_I386_REG(PCDR5),
|
||||||
|
// _DEF_I386_REG(PCDR6),
|
||||||
|
// _DEF_I386_REG(PCDR7),
|
||||||
|
// _DEF_I386_REG(CR0),
|
||||||
|
// _DEF_I386_REG(CR1),
|
||||||
|
// _DEF_I386_REG(CR2),
|
||||||
|
// _DEF_I386_REG(CR3),
|
||||||
|
// _DEF_I386_REG(CR4),
|
||||||
|
// _DEF_I386_REG(DR0),
|
||||||
|
// _DEF_I386_REG(DR1),
|
||||||
|
// _DEF_I386_REG(DR2),
|
||||||
|
// _DEF_I386_REG(DR3),
|
||||||
|
// _DEF_I386_REG(DR4),
|
||||||
|
// _DEF_I386_REG(DR5),
|
||||||
|
// _DEF_I386_REG(DR6),
|
||||||
|
// _DEF_I386_REG(DR7),
|
||||||
|
// _DEF_I386_REG(GDTR),
|
||||||
|
// _DEF_I386_REG(GDTL),
|
||||||
|
// _DEF_I386_REG(IDTR),
|
||||||
|
// _DEF_I386_REG(IDTL),
|
||||||
|
// _DEF_I386_REG(LDTR),
|
||||||
|
// _DEF_I386_REG(TR)
|
||||||
|
//};
|
||||||
|
//#undef _DEF_I386_REG
|
||||||
|
//
|
||||||
|
//const size_t Symbol::cntI386RegName = _countof(i386RegName);
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
//#define _DEF_AMD64_REG(x) Symbol::ValueNameEntry(CV_AMD64_##x, #x)
|
||||||
|
//const Symbol::ValueNameEntry Symbol::amd64RegName[] = {
|
||||||
|
// _DEF_AMD64_REG(AL),
|
||||||
|
// _DEF_AMD64_REG(CL),
|
||||||
|
// _DEF_AMD64_REG(DL),
|
||||||
|
// _DEF_AMD64_REG(BL),
|
||||||
|
// _DEF_AMD64_REG(AH),
|
||||||
|
// _DEF_AMD64_REG(CH),
|
||||||
|
// _DEF_AMD64_REG(DH),
|
||||||
|
// _DEF_AMD64_REG(BH),
|
||||||
|
// _DEF_AMD64_REG(AX),
|
||||||
|
// _DEF_AMD64_REG(CX),
|
||||||
|
// _DEF_AMD64_REG(DX),
|
||||||
|
// _DEF_AMD64_REG(BX),
|
||||||
|
// _DEF_AMD64_REG(SP),
|
||||||
|
// _DEF_AMD64_REG(BP),
|
||||||
|
// _DEF_AMD64_REG(SI),
|
||||||
|
// _DEF_AMD64_REG(DI),
|
||||||
|
// _DEF_AMD64_REG(EAX),
|
||||||
|
// _DEF_AMD64_REG(ECX),
|
||||||
|
// _DEF_AMD64_REG(EDX),
|
||||||
|
// _DEF_AMD64_REG(EBX),
|
||||||
|
// _DEF_AMD64_REG(ESP),
|
||||||
|
// _DEF_AMD64_REG(EBP),
|
||||||
|
// _DEF_AMD64_REG(ESI),
|
||||||
|
// _DEF_AMD64_REG(EDI),
|
||||||
|
// _DEF_AMD64_REG(ES),
|
||||||
|
// _DEF_AMD64_REG(CS),
|
||||||
|
// _DEF_AMD64_REG(SS),
|
||||||
|
// _DEF_AMD64_REG(DS),
|
||||||
|
// _DEF_AMD64_REG(FS),
|
||||||
|
// _DEF_AMD64_REG(GS),
|
||||||
|
// _DEF_AMD64_REG(FLAGS),
|
||||||
|
// _DEF_AMD64_REG(RIP),
|
||||||
|
// _DEF_AMD64_REG(EFLAGS),
|
||||||
|
// _DEF_AMD64_REG(CR0),
|
||||||
|
// _DEF_AMD64_REG(CR1),
|
||||||
|
// _DEF_AMD64_REG(CR2),
|
||||||
|
// _DEF_AMD64_REG(CR3),
|
||||||
|
// _DEF_AMD64_REG(CR4),
|
||||||
|
// _DEF_AMD64_REG(CR8),
|
||||||
|
// _DEF_AMD64_REG(DR0),
|
||||||
|
// _DEF_AMD64_REG(DR1),
|
||||||
|
// _DEF_AMD64_REG(DR2),
|
||||||
|
// _DEF_AMD64_REG(DR3),
|
||||||
|
// _DEF_AMD64_REG(DR4),
|
||||||
|
// _DEF_AMD64_REG(DR5),
|
||||||
|
// _DEF_AMD64_REG(DR6),
|
||||||
|
// _DEF_AMD64_REG(DR7),
|
||||||
|
// _DEF_AMD64_REG(DR8),
|
||||||
|
// _DEF_AMD64_REG(DR9),
|
||||||
|
// _DEF_AMD64_REG(DR10),
|
||||||
|
// _DEF_AMD64_REG(DR11),
|
||||||
|
// _DEF_AMD64_REG(DR12),
|
||||||
|
// _DEF_AMD64_REG(DR13),
|
||||||
|
// _DEF_AMD64_REG(DR14),
|
||||||
|
// _DEF_AMD64_REG(DR15),
|
||||||
|
// _DEF_AMD64_REG(GDTR),
|
||||||
|
// _DEF_AMD64_REG(GDTL),
|
||||||
|
// _DEF_AMD64_REG(IDTR),
|
||||||
|
// _DEF_AMD64_REG(IDTL),
|
||||||
|
// _DEF_AMD64_REG(LDTR),
|
||||||
|
// _DEF_AMD64_REG(TR),
|
||||||
|
// _DEF_AMD64_REG(ST0),
|
||||||
|
// _DEF_AMD64_REG(ST1),
|
||||||
|
// _DEF_AMD64_REG(ST2),
|
||||||
|
// _DEF_AMD64_REG(ST3),
|
||||||
|
// _DEF_AMD64_REG(ST4),
|
||||||
|
// _DEF_AMD64_REG(ST5),
|
||||||
|
// _DEF_AMD64_REG(ST6),
|
||||||
|
// _DEF_AMD64_REG(ST7),
|
||||||
|
// _DEF_AMD64_REG(CTRL),
|
||||||
|
// _DEF_AMD64_REG(STAT),
|
||||||
|
// _DEF_AMD64_REG(TAG),
|
||||||
|
// _DEF_AMD64_REG(FPIP),
|
||||||
|
// _DEF_AMD64_REG(FPCS),
|
||||||
|
// _DEF_AMD64_REG(FPDO),
|
||||||
|
// _DEF_AMD64_REG(FPDS),
|
||||||
|
// _DEF_AMD64_REG(ISEM),
|
||||||
|
// _DEF_AMD64_REG(FPEIP),
|
||||||
|
// _DEF_AMD64_REG(FPEDO),
|
||||||
|
// _DEF_AMD64_REG(MM0),
|
||||||
|
// _DEF_AMD64_REG(MM1),
|
||||||
|
// _DEF_AMD64_REG(MM2),
|
||||||
|
// _DEF_AMD64_REG(MM3),
|
||||||
|
// _DEF_AMD64_REG(MM4),
|
||||||
|
// _DEF_AMD64_REG(MM5),
|
||||||
|
// _DEF_AMD64_REG(MM6),
|
||||||
|
// _DEF_AMD64_REG(MM7),
|
||||||
|
// _DEF_AMD64_REG(XMM0),
|
||||||
|
// _DEF_AMD64_REG(XMM1),
|
||||||
|
// _DEF_AMD64_REG(XMM2),
|
||||||
|
// _DEF_AMD64_REG(XMM3),
|
||||||
|
// _DEF_AMD64_REG(XMM4),
|
||||||
|
// _DEF_AMD64_REG(XMM5),
|
||||||
|
// _DEF_AMD64_REG(XMM6),
|
||||||
|
// _DEF_AMD64_REG(XMM7),
|
||||||
|
// _DEF_AMD64_REG(XMM0_0),
|
||||||
|
// _DEF_AMD64_REG(XMM0_1),
|
||||||
|
// _DEF_AMD64_REG(XMM0_2),
|
||||||
|
// _DEF_AMD64_REG(XMM0_3),
|
||||||
|
// _DEF_AMD64_REG(XMM1_0),
|
||||||
|
// _DEF_AMD64_REG(XMM1_1),
|
||||||
|
// _DEF_AMD64_REG(XMM1_2),
|
||||||
|
// _DEF_AMD64_REG(XMM1_3),
|
||||||
|
// _DEF_AMD64_REG(XMM2_0),
|
||||||
|
// _DEF_AMD64_REG(XMM2_1),
|
||||||
|
// _DEF_AMD64_REG(XMM2_2),
|
||||||
|
// _DEF_AMD64_REG(XMM2_3),
|
||||||
|
// _DEF_AMD64_REG(XMM3_0),
|
||||||
|
// _DEF_AMD64_REG(XMM3_1),
|
||||||
|
// _DEF_AMD64_REG(XMM3_2),
|
||||||
|
// _DEF_AMD64_REG(XMM3_3),
|
||||||
|
// _DEF_AMD64_REG(XMM4_0),
|
||||||
|
// _DEF_AMD64_REG(XMM4_1),
|
||||||
|
// _DEF_AMD64_REG(XMM4_2),
|
||||||
|
// _DEF_AMD64_REG(XMM4_3),
|
||||||
|
// _DEF_AMD64_REG(XMM5_0),
|
||||||
|
// _DEF_AMD64_REG(XMM5_1),
|
||||||
|
// _DEF_AMD64_REG(XMM5_2),
|
||||||
|
// _DEF_AMD64_REG(XMM5_3),
|
||||||
|
// _DEF_AMD64_REG(XMM6_0),
|
||||||
|
// _DEF_AMD64_REG(XMM6_1),
|
||||||
|
// _DEF_AMD64_REG(XMM6_2),
|
||||||
|
// _DEF_AMD64_REG(XMM6_3),
|
||||||
|
// _DEF_AMD64_REG(XMM7_0),
|
||||||
|
// _DEF_AMD64_REG(XMM7_1),
|
||||||
|
// _DEF_AMD64_REG(XMM7_2),
|
||||||
|
// _DEF_AMD64_REG(XMM7_3),
|
||||||
|
// _DEF_AMD64_REG(XMM0L),
|
||||||
|
// _DEF_AMD64_REG(XMM1L),
|
||||||
|
// _DEF_AMD64_REG(XMM2L),
|
||||||
|
// _DEF_AMD64_REG(XMM3L),
|
||||||
|
// _DEF_AMD64_REG(XMM4L),
|
||||||
|
// _DEF_AMD64_REG(XMM5L),
|
||||||
|
// _DEF_AMD64_REG(XMM6L),
|
||||||
|
// _DEF_AMD64_REG(XMM7L),
|
||||||
|
// _DEF_AMD64_REG(XMM0H),
|
||||||
|
// _DEF_AMD64_REG(XMM1H),
|
||||||
|
// _DEF_AMD64_REG(XMM2H),
|
||||||
|
// _DEF_AMD64_REG(XMM3H),
|
||||||
|
// _DEF_AMD64_REG(XMM4H),
|
||||||
|
// _DEF_AMD64_REG(XMM5H),
|
||||||
|
// _DEF_AMD64_REG(XMM6H),
|
||||||
|
// _DEF_AMD64_REG(XMM7H),
|
||||||
|
// _DEF_AMD64_REG(MXCSR),
|
||||||
|
// _DEF_AMD64_REG(EMM0L),
|
||||||
|
// _DEF_AMD64_REG(EMM1L),
|
||||||
|
// _DEF_AMD64_REG(EMM2L),
|
||||||
|
// _DEF_AMD64_REG(EMM3L),
|
||||||
|
// _DEF_AMD64_REG(EMM4L),
|
||||||
|
// _DEF_AMD64_REG(EMM5L),
|
||||||
|
// _DEF_AMD64_REG(EMM6L),
|
||||||
|
// _DEF_AMD64_REG(EMM7L),
|
||||||
|
// _DEF_AMD64_REG(EMM0H),
|
||||||
|
// _DEF_AMD64_REG(EMM1H),
|
||||||
|
// _DEF_AMD64_REG(EMM2H),
|
||||||
|
// _DEF_AMD64_REG(EMM3H),
|
||||||
|
// _DEF_AMD64_REG(EMM4H),
|
||||||
|
// _DEF_AMD64_REG(EMM5H),
|
||||||
|
// _DEF_AMD64_REG(EMM6H),
|
||||||
|
// _DEF_AMD64_REG(EMM7H),
|
||||||
|
// _DEF_AMD64_REG(MM00),
|
||||||
|
// _DEF_AMD64_REG(MM01),
|
||||||
|
// _DEF_AMD64_REG(MM10),
|
||||||
|
// _DEF_AMD64_REG(MM11),
|
||||||
|
// _DEF_AMD64_REG(MM20),
|
||||||
|
// _DEF_AMD64_REG(MM21),
|
||||||
|
// _DEF_AMD64_REG(MM30),
|
||||||
|
// _DEF_AMD64_REG(MM31),
|
||||||
|
// _DEF_AMD64_REG(MM40),
|
||||||
|
// _DEF_AMD64_REG(MM41),
|
||||||
|
// _DEF_AMD64_REG(MM50),
|
||||||
|
// _DEF_AMD64_REG(MM51),
|
||||||
|
// _DEF_AMD64_REG(MM60),
|
||||||
|
// _DEF_AMD64_REG(MM61),
|
||||||
|
// _DEF_AMD64_REG(MM70),
|
||||||
|
// _DEF_AMD64_REG(MM71),
|
||||||
|
// _DEF_AMD64_REG(XMM8),
|
||||||
|
// _DEF_AMD64_REG(XMM9),
|
||||||
|
// _DEF_AMD64_REG(XMM10),
|
||||||
|
// _DEF_AMD64_REG(XMM11),
|
||||||
|
// _DEF_AMD64_REG(XMM12),
|
||||||
|
// _DEF_AMD64_REG(XMM13),
|
||||||
|
// _DEF_AMD64_REG(XMM14),
|
||||||
|
// _DEF_AMD64_REG(XMM15),
|
||||||
|
// _DEF_AMD64_REG(XMM8_0),
|
||||||
|
// _DEF_AMD64_REG(XMM8_1),
|
||||||
|
// _DEF_AMD64_REG(XMM8_2),
|
||||||
|
// _DEF_AMD64_REG(XMM8_3),
|
||||||
|
// _DEF_AMD64_REG(XMM9_0),
|
||||||
|
// _DEF_AMD64_REG(XMM9_1),
|
||||||
|
// _DEF_AMD64_REG(XMM9_2),
|
||||||
|
// _DEF_AMD64_REG(XMM9_3),
|
||||||
|
// _DEF_AMD64_REG(XMM10_0),
|
||||||
|
// _DEF_AMD64_REG(XMM10_1),
|
||||||
|
// _DEF_AMD64_REG(XMM10_2),
|
||||||
|
// _DEF_AMD64_REG(XMM10_3),
|
||||||
|
// _DEF_AMD64_REG(XMM11_0),
|
||||||
|
// _DEF_AMD64_REG(XMM11_1),
|
||||||
|
// _DEF_AMD64_REG(XMM11_2),
|
||||||
|
// _DEF_AMD64_REG(XMM11_3),
|
||||||
|
// _DEF_AMD64_REG(XMM12_0),
|
||||||
|
// _DEF_AMD64_REG(XMM12_1),
|
||||||
|
// _DEF_AMD64_REG(XMM12_2),
|
||||||
|
// _DEF_AMD64_REG(XMM12_3),
|
||||||
|
// _DEF_AMD64_REG(XMM13_0),
|
||||||
|
// _DEF_AMD64_REG(XMM13_1),
|
||||||
|
// _DEF_AMD64_REG(XMM13_2),
|
||||||
|
// _DEF_AMD64_REG(XMM13_3),
|
||||||
|
// _DEF_AMD64_REG(XMM14_0),
|
||||||
|
// _DEF_AMD64_REG(XMM14_1),
|
||||||
|
// _DEF_AMD64_REG(XMM14_2),
|
||||||
|
// _DEF_AMD64_REG(XMM14_3),
|
||||||
|
// _DEF_AMD64_REG(XMM15_0),
|
||||||
|
// _DEF_AMD64_REG(XMM15_1),
|
||||||
|
// _DEF_AMD64_REG(XMM15_2),
|
||||||
|
// _DEF_AMD64_REG(XMM15_3),
|
||||||
|
// _DEF_AMD64_REG(XMM8L),
|
||||||
|
// _DEF_AMD64_REG(XMM9L),
|
||||||
|
// _DEF_AMD64_REG(XMM10L),
|
||||||
|
// _DEF_AMD64_REG(XMM11L),
|
||||||
|
// _DEF_AMD64_REG(XMM12L),
|
||||||
|
// _DEF_AMD64_REG(XMM13L),
|
||||||
|
// _DEF_AMD64_REG(XMM14L),
|
||||||
|
// _DEF_AMD64_REG(XMM15L),
|
||||||
|
// _DEF_AMD64_REG(XMM8H),
|
||||||
|
// _DEF_AMD64_REG(XMM9H),
|
||||||
|
// _DEF_AMD64_REG(XMM10H),
|
||||||
|
// _DEF_AMD64_REG(XMM11H),
|
||||||
|
// _DEF_AMD64_REG(XMM12H),
|
||||||
|
// _DEF_AMD64_REG(XMM13H),
|
||||||
|
// _DEF_AMD64_REG(XMM14H),
|
||||||
|
// _DEF_AMD64_REG(XMM15H),
|
||||||
|
// _DEF_AMD64_REG(EMM8L),
|
||||||
|
// _DEF_AMD64_REG(EMM9L),
|
||||||
|
// _DEF_AMD64_REG(EMM10L),
|
||||||
|
// _DEF_AMD64_REG(EMM11L),
|
||||||
|
// _DEF_AMD64_REG(EMM12L),
|
||||||
|
// _DEF_AMD64_REG(EMM13L),
|
||||||
|
// _DEF_AMD64_REG(EMM14L),
|
||||||
|
// _DEF_AMD64_REG(EMM15L),
|
||||||
|
// _DEF_AMD64_REG(EMM8H),
|
||||||
|
// _DEF_AMD64_REG(EMM9H),
|
||||||
|
// _DEF_AMD64_REG(EMM10H),
|
||||||
|
// _DEF_AMD64_REG(EMM11H),
|
||||||
|
// _DEF_AMD64_REG(EMM12H),
|
||||||
|
// _DEF_AMD64_REG(EMM13H),
|
||||||
|
// _DEF_AMD64_REG(EMM14H),
|
||||||
|
// _DEF_AMD64_REG(EMM15H),
|
||||||
|
// _DEF_AMD64_REG(SIL),
|
||||||
|
// _DEF_AMD64_REG(DIL),
|
||||||
|
// _DEF_AMD64_REG(BPL),
|
||||||
|
// _DEF_AMD64_REG(SPL),
|
||||||
|
// _DEF_AMD64_REG(RAX),
|
||||||
|
// _DEF_AMD64_REG(RBX),
|
||||||
|
// _DEF_AMD64_REG(RCX),
|
||||||
|
// _DEF_AMD64_REG(RDX),
|
||||||
|
// _DEF_AMD64_REG(RSI),
|
||||||
|
// _DEF_AMD64_REG(RDI),
|
||||||
|
// _DEF_AMD64_REG(RBP),
|
||||||
|
// _DEF_AMD64_REG(RSP),
|
||||||
|
// _DEF_AMD64_REG(R8),
|
||||||
|
// _DEF_AMD64_REG(R9),
|
||||||
|
// _DEF_AMD64_REG(R10),
|
||||||
|
// _DEF_AMD64_REG(R11),
|
||||||
|
// _DEF_AMD64_REG(R12),
|
||||||
|
// _DEF_AMD64_REG(R13),
|
||||||
|
// _DEF_AMD64_REG(R14),
|
||||||
|
// _DEF_AMD64_REG(R15),
|
||||||
|
// _DEF_AMD64_REG(R8B),
|
||||||
|
// _DEF_AMD64_REG(R9B),
|
||||||
|
// _DEF_AMD64_REG(R10B),
|
||||||
|
// _DEF_AMD64_REG(R11B),
|
||||||
|
// _DEF_AMD64_REG(R12B),
|
||||||
|
// _DEF_AMD64_REG(R13B),
|
||||||
|
// _DEF_AMD64_REG(R14B),
|
||||||
|
// _DEF_AMD64_REG(R15B),
|
||||||
|
// _DEF_AMD64_REG(R8W),
|
||||||
|
// _DEF_AMD64_REG(R9W),
|
||||||
|
// _DEF_AMD64_REG(R10W),
|
||||||
|
// _DEF_AMD64_REG(R11W),
|
||||||
|
// _DEF_AMD64_REG(R12W),
|
||||||
|
// _DEF_AMD64_REG(R13W),
|
||||||
|
// _DEF_AMD64_REG(R14W),
|
||||||
|
// _DEF_AMD64_REG(R15W),
|
||||||
|
// _DEF_AMD64_REG(R8D),
|
||||||
|
// _DEF_AMD64_REG(R9D),
|
||||||
|
// _DEF_AMD64_REG(R10D),
|
||||||
|
// _DEF_AMD64_REG(R11D),
|
||||||
|
// _DEF_AMD64_REG(R12D),
|
||||||
|
// _DEF_AMD64_REG(R13D),
|
||||||
|
// _DEF_AMD64_REG(R14D),
|
||||||
|
// _DEF_AMD64_REG(R15D)
|
||||||
|
//};
|
||||||
|
//#undef _DEF_AMD64_REG
|
||||||
|
//
|
||||||
|
//const size_t Symbol::cntAmd64RegName= _countof(amd64RegName);
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
//}
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
namespace pykd {
|
namespace pykd {
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
const std::string DiaException::descPrefix("pyDia: ");
|
const std::string DiaException::descPrefix("pyDia: ");
|
||||||
|
|
||||||
@ -72,6 +72,23 @@ SymbolPtr loadSymbolFile(const std::string &filePath)
|
|||||||
return SymbolPtr( new DiaSymbol( _globalScope ) );
|
return SymbolPtr( new DiaSymbol( _globalScope ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
std::string getBasicTypeName( ULONG basicType )
|
||||||
|
{
|
||||||
|
for ( size_t i = 0; i < DiaSymbol::cntBasicTypeName; ++i )
|
||||||
|
{
|
||||||
|
if ( basicType == DiaSymbol::basicTypeName[i].first )
|
||||||
|
return std::string( DiaSymbol::basicTypeName[i].second );
|
||||||
|
}
|
||||||
|
|
||||||
|
std::stringstream sstr;
|
||||||
|
|
||||||
|
sstr << "faild to find basic type with index %d" << basicType;
|
||||||
|
|
||||||
|
throw DiaException( sstr.str() );
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
DiaSymbol::DiaSymbol(__inout DiaSymbolPtr &_symbol )
|
DiaSymbol::DiaSymbol(__inout DiaSymbolPtr &_symbol )
|
||||||
@ -80,6 +97,127 @@ DiaSymbol::DiaSymbol(__inout DiaSymbolPtr &_symbol )
|
|||||||
m_symbol->get_machineType(&m_machineType);
|
m_symbol->get_machineType(&m_machineType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
DiaSymbol::DiaSymbol( IDiaSymbol *_symbol )
|
||||||
|
{
|
||||||
|
m_symbol = _symbol;
|
||||||
|
m_symbol->get_machineType(&m_machineType);
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
SymbolPtrList DiaSymbol::findChildren(
|
||||||
|
ULONG symTag,
|
||||||
|
const std::string &name,
|
||||||
|
bool caseSensitive
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DiaEnumSymbolsPtr symbols;
|
||||||
|
HRESULT hres;
|
||||||
|
|
||||||
|
if ( name.empty() )
|
||||||
|
{
|
||||||
|
hres = m_symbol->findChildren(
|
||||||
|
static_cast<enum ::SymTagEnum>(symTag),
|
||||||
|
NULL,
|
||||||
|
caseSensitive ? nsCaseSensitive : nsCaseInsensitive,
|
||||||
|
&symbols);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hres = m_symbol->findChildren(
|
||||||
|
static_cast<enum ::SymTagEnum>(symTag),
|
||||||
|
toWStr(name),
|
||||||
|
caseSensitive ? nsCaseSensitive : nsCaseInsensitive,
|
||||||
|
&symbols);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (S_OK != hres)
|
||||||
|
throw DiaException("Call IDiaSymbol::findChildren", hres);
|
||||||
|
|
||||||
|
SymbolPtrList childList;
|
||||||
|
|
||||||
|
DiaSymbolPtr child;
|
||||||
|
ULONG celt;
|
||||||
|
while ( SUCCEEDED(symbols->Next(1, &child, &celt)) && (celt == 1) )
|
||||||
|
{
|
||||||
|
childList.push_back( SymbolPtr( new DiaSymbol(child) ) );
|
||||||
|
child = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return childList;
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ULONG DiaSymbol::getBaseType()
|
||||||
|
{
|
||||||
|
return callSymbol(get_baseType);
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ULONG DiaSymbol::getBitPosition()
|
||||||
|
{
|
||||||
|
return callSymbol(get_bitPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ULONG DiaSymbol::getChildCount(ULONG symTag)
|
||||||
|
{
|
||||||
|
DiaEnumSymbolsPtr symbols;
|
||||||
|
HRESULT hres =
|
||||||
|
m_symbol->findChildren(
|
||||||
|
static_cast<enum ::SymTagEnum>(symTag),
|
||||||
|
NULL,
|
||||||
|
nsCaseSensitive,
|
||||||
|
&symbols);
|
||||||
|
if (S_OK != hres)
|
||||||
|
throw DiaException("Call IDiaSymbol::findChildren", hres);
|
||||||
|
|
||||||
|
LONG count;
|
||||||
|
hres = symbols->get_Count(&count);
|
||||||
|
if (S_OK != hres)
|
||||||
|
throw DiaException("Call IDiaEnumSymbols::get_Count", hres);
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
SymbolPtr DiaSymbol::getChildByIndex(ULONG symTag, ULONG _index )
|
||||||
|
{
|
||||||
|
DiaEnumSymbolsPtr symbols;
|
||||||
|
HRESULT hres =
|
||||||
|
m_symbol->findChildren(
|
||||||
|
static_cast<enum ::SymTagEnum>(symTag),
|
||||||
|
NULL,
|
||||||
|
nsCaseSensitive,
|
||||||
|
&symbols);
|
||||||
|
if (S_OK != hres)
|
||||||
|
throw DiaException("Call IDiaSymbol::findChildren", hres);
|
||||||
|
|
||||||
|
LONG count;
|
||||||
|
hres = symbols->get_Count(&count);
|
||||||
|
if (S_OK != hres)
|
||||||
|
throw DiaException("Call IDiaEnumSymbols::get_Count", hres);
|
||||||
|
|
||||||
|
if (LONG(_index) >= count)
|
||||||
|
{
|
||||||
|
throw PyException( PyExc_IndexError, "Index out of range");
|
||||||
|
}
|
||||||
|
|
||||||
|
DiaSymbolPtr child;
|
||||||
|
hres = symbols->Item(_index, &child);
|
||||||
|
if (S_OK != hres)
|
||||||
|
throw DiaException("Call IDiaEnumSymbols::Item", hres);
|
||||||
|
|
||||||
|
return SymbolPtr( new DiaSymbol(child) );
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
SymbolPtr DiaSymbol::getChildByName(const std::string &_name)
|
SymbolPtr DiaSymbol::getChildByName(const std::string &_name)
|
||||||
@ -87,10 +225,11 @@ SymbolPtr DiaSymbol::getChildByName(const std::string &_name)
|
|||||||
DiaEnumSymbolsPtr symbols;
|
DiaEnumSymbolsPtr symbols;
|
||||||
HRESULT hres =
|
HRESULT hres =
|
||||||
m_symbol->findChildren(
|
m_symbol->findChildren(
|
||||||
SymTagNull,
|
::SymTagNull,
|
||||||
toWStr(_name),
|
toWStr(_name),
|
||||||
nsCaseSensitive,
|
nsCaseSensitive,
|
||||||
&symbols);
|
&symbols);
|
||||||
|
|
||||||
if (S_OK != hres)
|
if (S_OK != hres)
|
||||||
throw DiaException("Call IDiaSymbol::findChildren", hres);
|
throw DiaException("Call IDiaSymbol::findChildren", hres);
|
||||||
|
|
||||||
@ -113,6 +252,41 @@ SymbolPtr DiaSymbol::getChildByName(const std::string &_name)
|
|||||||
return SymbolPtr( new DiaSymbol(child) );
|
return SymbolPtr( new DiaSymbol(child) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ULONG DiaSymbol::getCount()
|
||||||
|
{
|
||||||
|
return callSymbol(get_count);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ULONG DiaSymbol::getDataKind()
|
||||||
|
{
|
||||||
|
return callSymbol(get_dataKind);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ULONG DiaSymbol::getLocType()
|
||||||
|
{
|
||||||
|
return callSymbol(get_locationType);
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
std::string DiaSymbol::getName()
|
||||||
|
{
|
||||||
|
autoBstr retValue( callSymbol(get_name) );
|
||||||
|
return retValue.asStr();
|
||||||
|
}
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LONG DiaSymbol::getOffset()
|
||||||
|
{
|
||||||
|
return callSymbol(get_offset);
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
ULONG DiaSymbol::getRva()
|
ULONG DiaSymbol::getRva()
|
||||||
@ -122,6 +296,80 @@ ULONG DiaSymbol::getRva()
|
|||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ULONGLONG DiaSymbol::getSize()
|
||||||
|
{
|
||||||
|
return callSymbol(get_length);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ULONG DiaSymbol::getSymTag()
|
||||||
|
{
|
||||||
|
return callSymbol(get_symTag);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
SymbolPtr DiaSymbol::getType()
|
||||||
|
{
|
||||||
|
return SymbolPtr( new DiaSymbol( callSymbol(get_type) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ULONGLONG DiaSymbol::getVa()
|
||||||
|
{
|
||||||
|
return callSymbol(get_virtualAddress);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void DiaSymbol::getValue( VARIANT &vtValue)
|
||||||
|
{
|
||||||
|
HRESULT hres = m_symbol->get_value(&vtValue);
|
||||||
|
if (S_OK != hres)
|
||||||
|
throw DiaException("Call IDiaSymbol::get_value", hres);
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int DiaSymbol::getVirtualBasePointerOffset()
|
||||||
|
{
|
||||||
|
return callSymbol(get_virtualBasePointerOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ULONG DiaSymbol::getVirtualBaseDispIndex()
|
||||||
|
{
|
||||||
|
return callSymbol(get_virtualBaseDispIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ULONG DiaSymbol::getVirtualBaseDispSize()
|
||||||
|
{
|
||||||
|
SymbolPtr baseTableType = SymbolPtr( new DiaSymbol( callSymbol(get_virtualBaseTableType) ) );
|
||||||
|
|
||||||
|
return (ULONG)baseTableType->getType()->getSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool DiaSymbol::isVirtualBaseClass()
|
||||||
|
{
|
||||||
|
return !!callSymbol(get_virtualBaseClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
//bool DiaSymbol::isIndirectVirtualBaseClass()
|
||||||
|
//{
|
||||||
|
// return !!callSymbol(get_indirectVirtualBaseClass);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
}; // pykd nemaspace end
|
}; // pykd nemaspace end
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
#include "symengine.h"
|
#include "symengine.h"
|
||||||
#include "dbgexcept.h"
|
#include "dbgexcept.h"
|
||||||
|
|
||||||
|
#include <dia2.h>
|
||||||
|
|
||||||
namespace pykd {
|
namespace pykd {
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
@ -46,21 +48,19 @@ private:
|
|||||||
class DiaSymbol : public Symbol {
|
class DiaSymbol : public Symbol {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DiaSymbol(__inout DiaSymbolPtr &_symbol );
|
DiaSymbol( DiaSymbolPtr &_symbol );
|
||||||
|
|
||||||
|
DiaSymbol( IDiaSymbol *_symbol );
|
||||||
|
|
||||||
SymbolPtr getChildByName(const std::string &_name);
|
SymbolPtr getChildByName(const std::string &_name);
|
||||||
|
|
||||||
ULONG getRva();
|
ULONG getRva();
|
||||||
|
|
||||||
|
SymbolPtrList findChildren(
|
||||||
|
ULONG symTag,
|
||||||
|
const std::string &name = "",
|
||||||
|
bool caseSensitive = FALSE
|
||||||
//SymbolPtrList findChildrenImpl(
|
);
|
||||||
// ULONG symTag,
|
|
||||||
// const std::string &name = "",
|
|
||||||
// DWORD nameCmpFlags = 0
|
|
||||||
//);
|
|
||||||
|
|
||||||
//python::list findChildrenEx(
|
//python::list findChildrenEx(
|
||||||
// ULONG symTag,
|
// ULONG symTag,
|
||||||
@ -78,67 +78,67 @@ public:
|
|||||||
// return toPyList( findChildrenImpl(SymTagNull, name, nsfCaseSensitive) );
|
// return toPyList( findChildrenImpl(SymTagNull, name, nsfCaseSensitive) );
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//ULONGLONG getSize();
|
ULONGLONG getSize();
|
||||||
|
|
||||||
|
std::string getName();
|
||||||
|
|
||||||
//std::string getName();
|
|
||||||
//std::string getUndecoratedName();
|
//std::string getUndecoratedName();
|
||||||
|
|
||||||
//SymbolPtr getType();
|
SymbolPtr getType();
|
||||||
|
|
||||||
//SymbolPtr getIndexType();
|
//SymbolPtr getIndexType();
|
||||||
|
|
||||||
//ULONG getSymTag();
|
ULONG getSymTag();
|
||||||
|
|
||||||
//ULONG getRva();
|
//ULONG getRva();
|
||||||
//ULONGLONG getVa();
|
ULONGLONG getVa();
|
||||||
|
|
||||||
//ULONG getLocType();
|
ULONG getLocType();
|
||||||
|
|
||||||
//LONG getOffset();
|
LONG getOffset();
|
||||||
|
|
||||||
//ULONG getCount();
|
ULONG getCount();
|
||||||
|
|
||||||
//static void getValueImpl(IDiaSymbol *_symbol, VARIANT &vtValue);
|
//static void getValueImpl(IDiaSymbol *_symbol, VARIANT &vtValue);
|
||||||
//python::object getValue();
|
//python::object getValue();
|
||||||
//void getValue( VARIANT &vtValue);
|
|
||||||
|
void getValue( VARIANT &vtValue);
|
||||||
|
|
||||||
//bool isBasicType();
|
//bool isBasicType();
|
||||||
|
|
||||||
//bool isVirtualBaseClass();
|
bool isVirtualBaseClass();
|
||||||
|
|
||||||
//bool isIndirectVirtualBaseClass();
|
//bool isIndirectVirtualBaseClass();
|
||||||
|
|
||||||
//ULONG getBaseType();
|
ULONG getBaseType();
|
||||||
|
|
||||||
//ULONG getBitPosition();
|
ULONG getBitPosition();
|
||||||
|
|
||||||
//ULONG getIndexId();
|
//ULONG getIndexId();
|
||||||
|
|
||||||
//ULONG getUdtKind();
|
//ULONG getUdtKind();
|
||||||
|
|
||||||
//ULONG getDataKind();
|
ULONG getDataKind();
|
||||||
|
|
||||||
//ULONG getRegisterId();
|
//ULONG getRegisterId();
|
||||||
|
|
||||||
//ULONG getMachineType() const {
|
ULONG getMachineType() {
|
||||||
// return m_machineType;
|
return m_machineType;
|
||||||
//}
|
}
|
||||||
|
|
||||||
//SymbolPtr getChildByName(const std::string &_name);
|
//SymbolPtr getChildByName(const std::string &_name);
|
||||||
|
|
||||||
//template<ULONG symTag>
|
ULONG getChildCount( ULONG symTag );
|
||||||
//ULONG getChildCount();
|
|
||||||
|
|
||||||
//ULONG getChildCount() {
|
ULONG getChildCount() {
|
||||||
// return getChildCount<SymTagNull>();
|
return getChildCount(SymTagNull);
|
||||||
//}
|
}
|
||||||
|
|
||||||
//template<ULONG symTag>
|
SymbolPtr getChildByIndex(ULONG symTag, ULONG _index );
|
||||||
//SymbolPtr getChildByIndex(ULONG _index );
|
|
||||||
|
|
||||||
//SymbolPtr getChildByIndex(ULONG _index ) {
|
SymbolPtr getChildByIndex(ULONG _index ) {
|
||||||
// return getChildByIndex<SymTagNull>( _index );
|
return getChildByIndex( SymTagNull, _index );
|
||||||
//}
|
}
|
||||||
//
|
//
|
||||||
//bool isConstant();
|
//bool isConstant();
|
||||||
|
|
||||||
@ -146,16 +146,16 @@ public:
|
|||||||
|
|
||||||
//bool eq(Symbol &rhs);
|
//bool eq(Symbol &rhs);
|
||||||
|
|
||||||
//int getVirtualBasePointerOffset();
|
int getVirtualBasePointerOffset();
|
||||||
|
|
||||||
//ULONG getVirtualBaseDispIndex();
|
ULONG getVirtualBaseDispIndex();
|
||||||
|
|
||||||
//ULONG getVirtualBaseDispSize();
|
ULONG getVirtualBaseDispSize();
|
||||||
|
|
||||||
//ULONG getSection();
|
//ULONG getSection();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//typedef std::pair<ULONG, const char *> ValueNameEntry;
|
typedef std::pair<ULONG, const char *> ValueNameEntry;
|
||||||
|
|
||||||
//static const ValueNameEntry dataKindName[DataIsConstant + 1];
|
//static const ValueNameEntry dataKindName[DataIsConstant + 1];
|
||||||
|
|
||||||
@ -163,8 +163,8 @@ public:
|
|||||||
|
|
||||||
//static const ValueNameEntry locTypeName[LocTypeMax];
|
//static const ValueNameEntry locTypeName[LocTypeMax];
|
||||||
|
|
||||||
//static const ValueNameEntry basicTypeName[];
|
static const ValueNameEntry basicTypeName[];
|
||||||
//static const size_t cntBasicTypeName;
|
static const size_t cntBasicTypeName;
|
||||||
|
|
||||||
//static const ValueNameEntry udtKindName[];
|
//static const ValueNameEntry udtKindName[];
|
||||||
//static const size_t cntUdtKindName;
|
//static const size_t cntUdtKindName;
|
||||||
@ -175,7 +175,7 @@ public:
|
|||||||
//static const ValueNameEntry amd64RegName[];
|
//static const ValueNameEntry amd64RegName[];
|
||||||
//static const size_t cntAmd64RegName;
|
//static const size_t cntAmd64RegName;
|
||||||
|
|
||||||
//static std::string getBasicTypeName( ULONG basicType );
|
static std::string getBasicTypeName( ULONG basicType );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
509
pykd/diadata.cpp
509
pykd/diadata.cpp
@ -1,509 +0,0 @@
|
|||||||
#include "stdafx.h"
|
|
||||||
|
|
||||||
#include "diawrapper.h"
|
|
||||||
#include "utils.h"
|
|
||||||
|
|
||||||
namespace pyDia {
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#define _DEF_SYM_TAG_VAL(x) Symbol::ValueNameEntry(SymTag##x, #x)
|
|
||||||
const Symbol::ValueNameEntry Symbol::symTagName[SymTagMax] = {
|
|
||||||
_DEF_SYM_TAG_VAL(Null),
|
|
||||||
_DEF_SYM_TAG_VAL(Exe),
|
|
||||||
_DEF_SYM_TAG_VAL(Compiland),
|
|
||||||
_DEF_SYM_TAG_VAL(CompilandDetails),
|
|
||||||
_DEF_SYM_TAG_VAL(CompilandEnv),
|
|
||||||
_DEF_SYM_TAG_VAL(Function),
|
|
||||||
_DEF_SYM_TAG_VAL(Block),
|
|
||||||
_DEF_SYM_TAG_VAL(Data),
|
|
||||||
_DEF_SYM_TAG_VAL(Annotation),
|
|
||||||
_DEF_SYM_TAG_VAL(Label),
|
|
||||||
_DEF_SYM_TAG_VAL(PublicSymbol),
|
|
||||||
_DEF_SYM_TAG_VAL(UDT),
|
|
||||||
_DEF_SYM_TAG_VAL(Enum),
|
|
||||||
_DEF_SYM_TAG_VAL(FunctionType),
|
|
||||||
_DEF_SYM_TAG_VAL(PointerType),
|
|
||||||
_DEF_SYM_TAG_VAL(ArrayType),
|
|
||||||
_DEF_SYM_TAG_VAL(BaseType),
|
|
||||||
_DEF_SYM_TAG_VAL(Typedef),
|
|
||||||
_DEF_SYM_TAG_VAL(BaseClass),
|
|
||||||
_DEF_SYM_TAG_VAL(Friend),
|
|
||||||
_DEF_SYM_TAG_VAL(FunctionArgType),
|
|
||||||
_DEF_SYM_TAG_VAL(FuncDebugStart),
|
|
||||||
_DEF_SYM_TAG_VAL(FuncDebugEnd),
|
|
||||||
_DEF_SYM_TAG_VAL(UsingNamespace),
|
|
||||||
_DEF_SYM_TAG_VAL(VTableShape),
|
|
||||||
_DEF_SYM_TAG_VAL(VTable),
|
|
||||||
_DEF_SYM_TAG_VAL(Custom),
|
|
||||||
_DEF_SYM_TAG_VAL(Thunk),
|
|
||||||
_DEF_SYM_TAG_VAL(CustomType),
|
|
||||||
_DEF_SYM_TAG_VAL(ManagedType),
|
|
||||||
_DEF_SYM_TAG_VAL(Dimension)
|
|
||||||
};
|
|
||||||
#undef _DEF_SYM_TAG_VAL
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#define _DEF_DATA_KIND_VAL(x) Symbol::ValueNameEntry(DataIs##x, #x)
|
|
||||||
const Symbol::ValueNameEntry Symbol::dataKindName[DataIsConstant + 1] = {
|
|
||||||
_DEF_DATA_KIND_VAL(Unknown),
|
|
||||||
_DEF_DATA_KIND_VAL(Local),
|
|
||||||
_DEF_DATA_KIND_VAL(StaticLocal),
|
|
||||||
_DEF_DATA_KIND_VAL(Param),
|
|
||||||
_DEF_DATA_KIND_VAL(ObjectPtr),
|
|
||||||
_DEF_DATA_KIND_VAL(FileStatic),
|
|
||||||
_DEF_DATA_KIND_VAL(Global),
|
|
||||||
_DEF_DATA_KIND_VAL(Member),
|
|
||||||
_DEF_DATA_KIND_VAL(StaticMember),
|
|
||||||
_DEF_DATA_KIND_VAL(Constant)
|
|
||||||
};
|
|
||||||
#undef _DEF_DATA_KIND_VAL
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#define _DEF_LOC_TYPE(x) Symbol::ValueNameEntry(LocIs##x, #x)
|
|
||||||
const Symbol::ValueNameEntry Symbol::locTypeName[LocTypeMax] = {
|
|
||||||
_DEF_LOC_TYPE(Null),
|
|
||||||
_DEF_LOC_TYPE(Static),
|
|
||||||
_DEF_LOC_TYPE(TLS),
|
|
||||||
_DEF_LOC_TYPE(RegRel),
|
|
||||||
_DEF_LOC_TYPE(ThisRel),
|
|
||||||
_DEF_LOC_TYPE(Enregistered),
|
|
||||||
_DEF_LOC_TYPE(BitField),
|
|
||||||
_DEF_LOC_TYPE(Slot),
|
|
||||||
_DEF_LOC_TYPE(IlRel),
|
|
||||||
Symbol::ValueNameEntry(LocInMetaData, "InMetaData"),
|
|
||||||
_DEF_LOC_TYPE(Constant)
|
|
||||||
};
|
|
||||||
#undef _DEF_LOC_TYPE
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#define _DEF_BASIC_TYPE(x) Symbol::ValueNameEntry(bt##x, #x)
|
|
||||||
const Symbol::ValueNameEntry Symbol::basicTypeName[] = {
|
|
||||||
_DEF_BASIC_TYPE(NoType),
|
|
||||||
_DEF_BASIC_TYPE(Void),
|
|
||||||
_DEF_BASIC_TYPE(Char),
|
|
||||||
_DEF_BASIC_TYPE(WChar),
|
|
||||||
_DEF_BASIC_TYPE(Int),
|
|
||||||
_DEF_BASIC_TYPE(UInt),
|
|
||||||
_DEF_BASIC_TYPE(Float),
|
|
||||||
_DEF_BASIC_TYPE(BCD),
|
|
||||||
_DEF_BASIC_TYPE(Bool),
|
|
||||||
_DEF_BASIC_TYPE(Long),
|
|
||||||
_DEF_BASIC_TYPE(ULong),
|
|
||||||
_DEF_BASIC_TYPE(Currency),
|
|
||||||
_DEF_BASIC_TYPE(Date),
|
|
||||||
_DEF_BASIC_TYPE(Variant),
|
|
||||||
_DEF_BASIC_TYPE(Complex),
|
|
||||||
_DEF_BASIC_TYPE(Bit),
|
|
||||||
_DEF_BASIC_TYPE(BSTR),
|
|
||||||
_DEF_BASIC_TYPE(Hresult)
|
|
||||||
};
|
|
||||||
#undef _DEF_BASIC_TYPE
|
|
||||||
|
|
||||||
const size_t Symbol::cntBasicTypeName = _countof(Symbol::basicTypeName);
|
|
||||||
|
|
||||||
std::string Symbol::getBasicTypeName( ULONG basicType )
|
|
||||||
{
|
|
||||||
for ( size_t i = 0; i < Symbol::cntBasicTypeName; ++i )
|
|
||||||
{
|
|
||||||
if ( basicType == Symbol::basicTypeName[i].first )
|
|
||||||
return std::string( Symbol::basicTypeName[i].second );
|
|
||||||
}
|
|
||||||
|
|
||||||
std::stringstream sstr;
|
|
||||||
|
|
||||||
sstr << "faild to find basic type with index %d" << basicType;
|
|
||||||
|
|
||||||
throw Exception( sstr.str() );
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#define _DEF_UDT_KIND(x) Symbol::ValueNameEntry(Udt##x, #x)
|
|
||||||
const Symbol::ValueNameEntry Symbol::udtKindName[] = {
|
|
||||||
_DEF_UDT_KIND(Struct),
|
|
||||||
_DEF_UDT_KIND(Class),
|
|
||||||
_DEF_UDT_KIND(Union)
|
|
||||||
};
|
|
||||||
#undef _DEF_UDT_KIND
|
|
||||||
|
|
||||||
const size_t Symbol::cntUdtKindName = _countof(udtKindName);
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#define _DEF_I386_REG(x) Symbol::ValueNameEntry(CV_REG_##x, #x)
|
|
||||||
const Symbol::ValueNameEntry Symbol::i386RegName[] = {
|
|
||||||
_DEF_I386_REG(AL),
|
|
||||||
_DEF_I386_REG(CL),
|
|
||||||
_DEF_I386_REG(DL),
|
|
||||||
_DEF_I386_REG(BL),
|
|
||||||
_DEF_I386_REG(AH),
|
|
||||||
_DEF_I386_REG(CH),
|
|
||||||
_DEF_I386_REG(DH),
|
|
||||||
_DEF_I386_REG(BH),
|
|
||||||
_DEF_I386_REG(AX),
|
|
||||||
_DEF_I386_REG(CX),
|
|
||||||
_DEF_I386_REG(DX),
|
|
||||||
_DEF_I386_REG(BX),
|
|
||||||
_DEF_I386_REG(SP),
|
|
||||||
_DEF_I386_REG(BP),
|
|
||||||
_DEF_I386_REG(SI),
|
|
||||||
_DEF_I386_REG(DI),
|
|
||||||
_DEF_I386_REG(EAX),
|
|
||||||
_DEF_I386_REG(ECX),
|
|
||||||
_DEF_I386_REG(EDX),
|
|
||||||
_DEF_I386_REG(EBX),
|
|
||||||
_DEF_I386_REG(ESP),
|
|
||||||
_DEF_I386_REG(EBP),
|
|
||||||
_DEF_I386_REG(ESI),
|
|
||||||
_DEF_I386_REG(EDI),
|
|
||||||
_DEF_I386_REG(ES),
|
|
||||||
_DEF_I386_REG(CS),
|
|
||||||
_DEF_I386_REG(SS),
|
|
||||||
_DEF_I386_REG(DS),
|
|
||||||
_DEF_I386_REG(FS),
|
|
||||||
_DEF_I386_REG(GS),
|
|
||||||
_DEF_I386_REG(IP),
|
|
||||||
_DEF_I386_REG(FLAGS ),
|
|
||||||
_DEF_I386_REG(EIP),
|
|
||||||
_DEF_I386_REG(EFLAGS),
|
|
||||||
_DEF_I386_REG(TEMP),
|
|
||||||
_DEF_I386_REG(TEMPH),
|
|
||||||
_DEF_I386_REG(QUOTE),
|
|
||||||
_DEF_I386_REG(PCDR3),
|
|
||||||
_DEF_I386_REG(PCDR4),
|
|
||||||
_DEF_I386_REG(PCDR5),
|
|
||||||
_DEF_I386_REG(PCDR6),
|
|
||||||
_DEF_I386_REG(PCDR7),
|
|
||||||
_DEF_I386_REG(CR0),
|
|
||||||
_DEF_I386_REG(CR1),
|
|
||||||
_DEF_I386_REG(CR2),
|
|
||||||
_DEF_I386_REG(CR3),
|
|
||||||
_DEF_I386_REG(CR4),
|
|
||||||
_DEF_I386_REG(DR0),
|
|
||||||
_DEF_I386_REG(DR1),
|
|
||||||
_DEF_I386_REG(DR2),
|
|
||||||
_DEF_I386_REG(DR3),
|
|
||||||
_DEF_I386_REG(DR4),
|
|
||||||
_DEF_I386_REG(DR5),
|
|
||||||
_DEF_I386_REG(DR6),
|
|
||||||
_DEF_I386_REG(DR7),
|
|
||||||
_DEF_I386_REG(GDTR),
|
|
||||||
_DEF_I386_REG(GDTL),
|
|
||||||
_DEF_I386_REG(IDTR),
|
|
||||||
_DEF_I386_REG(IDTL),
|
|
||||||
_DEF_I386_REG(LDTR),
|
|
||||||
_DEF_I386_REG(TR)
|
|
||||||
};
|
|
||||||
#undef _DEF_I386_REG
|
|
||||||
|
|
||||||
const size_t Symbol::cntI386RegName = _countof(i386RegName);
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#define _DEF_AMD64_REG(x) Symbol::ValueNameEntry(CV_AMD64_##x, #x)
|
|
||||||
const Symbol::ValueNameEntry Symbol::amd64RegName[] = {
|
|
||||||
_DEF_AMD64_REG(AL),
|
|
||||||
_DEF_AMD64_REG(CL),
|
|
||||||
_DEF_AMD64_REG(DL),
|
|
||||||
_DEF_AMD64_REG(BL),
|
|
||||||
_DEF_AMD64_REG(AH),
|
|
||||||
_DEF_AMD64_REG(CH),
|
|
||||||
_DEF_AMD64_REG(DH),
|
|
||||||
_DEF_AMD64_REG(BH),
|
|
||||||
_DEF_AMD64_REG(AX),
|
|
||||||
_DEF_AMD64_REG(CX),
|
|
||||||
_DEF_AMD64_REG(DX),
|
|
||||||
_DEF_AMD64_REG(BX),
|
|
||||||
_DEF_AMD64_REG(SP),
|
|
||||||
_DEF_AMD64_REG(BP),
|
|
||||||
_DEF_AMD64_REG(SI),
|
|
||||||
_DEF_AMD64_REG(DI),
|
|
||||||
_DEF_AMD64_REG(EAX),
|
|
||||||
_DEF_AMD64_REG(ECX),
|
|
||||||
_DEF_AMD64_REG(EDX),
|
|
||||||
_DEF_AMD64_REG(EBX),
|
|
||||||
_DEF_AMD64_REG(ESP),
|
|
||||||
_DEF_AMD64_REG(EBP),
|
|
||||||
_DEF_AMD64_REG(ESI),
|
|
||||||
_DEF_AMD64_REG(EDI),
|
|
||||||
_DEF_AMD64_REG(ES),
|
|
||||||
_DEF_AMD64_REG(CS),
|
|
||||||
_DEF_AMD64_REG(SS),
|
|
||||||
_DEF_AMD64_REG(DS),
|
|
||||||
_DEF_AMD64_REG(FS),
|
|
||||||
_DEF_AMD64_REG(GS),
|
|
||||||
_DEF_AMD64_REG(FLAGS),
|
|
||||||
_DEF_AMD64_REG(RIP),
|
|
||||||
_DEF_AMD64_REG(EFLAGS),
|
|
||||||
_DEF_AMD64_REG(CR0),
|
|
||||||
_DEF_AMD64_REG(CR1),
|
|
||||||
_DEF_AMD64_REG(CR2),
|
|
||||||
_DEF_AMD64_REG(CR3),
|
|
||||||
_DEF_AMD64_REG(CR4),
|
|
||||||
_DEF_AMD64_REG(CR8),
|
|
||||||
_DEF_AMD64_REG(DR0),
|
|
||||||
_DEF_AMD64_REG(DR1),
|
|
||||||
_DEF_AMD64_REG(DR2),
|
|
||||||
_DEF_AMD64_REG(DR3),
|
|
||||||
_DEF_AMD64_REG(DR4),
|
|
||||||
_DEF_AMD64_REG(DR5),
|
|
||||||
_DEF_AMD64_REG(DR6),
|
|
||||||
_DEF_AMD64_REG(DR7),
|
|
||||||
_DEF_AMD64_REG(DR8),
|
|
||||||
_DEF_AMD64_REG(DR9),
|
|
||||||
_DEF_AMD64_REG(DR10),
|
|
||||||
_DEF_AMD64_REG(DR11),
|
|
||||||
_DEF_AMD64_REG(DR12),
|
|
||||||
_DEF_AMD64_REG(DR13),
|
|
||||||
_DEF_AMD64_REG(DR14),
|
|
||||||
_DEF_AMD64_REG(DR15),
|
|
||||||
_DEF_AMD64_REG(GDTR),
|
|
||||||
_DEF_AMD64_REG(GDTL),
|
|
||||||
_DEF_AMD64_REG(IDTR),
|
|
||||||
_DEF_AMD64_REG(IDTL),
|
|
||||||
_DEF_AMD64_REG(LDTR),
|
|
||||||
_DEF_AMD64_REG(TR),
|
|
||||||
_DEF_AMD64_REG(ST0),
|
|
||||||
_DEF_AMD64_REG(ST1),
|
|
||||||
_DEF_AMD64_REG(ST2),
|
|
||||||
_DEF_AMD64_REG(ST3),
|
|
||||||
_DEF_AMD64_REG(ST4),
|
|
||||||
_DEF_AMD64_REG(ST5),
|
|
||||||
_DEF_AMD64_REG(ST6),
|
|
||||||
_DEF_AMD64_REG(ST7),
|
|
||||||
_DEF_AMD64_REG(CTRL),
|
|
||||||
_DEF_AMD64_REG(STAT),
|
|
||||||
_DEF_AMD64_REG(TAG),
|
|
||||||
_DEF_AMD64_REG(FPIP),
|
|
||||||
_DEF_AMD64_REG(FPCS),
|
|
||||||
_DEF_AMD64_REG(FPDO),
|
|
||||||
_DEF_AMD64_REG(FPDS),
|
|
||||||
_DEF_AMD64_REG(ISEM),
|
|
||||||
_DEF_AMD64_REG(FPEIP),
|
|
||||||
_DEF_AMD64_REG(FPEDO),
|
|
||||||
_DEF_AMD64_REG(MM0),
|
|
||||||
_DEF_AMD64_REG(MM1),
|
|
||||||
_DEF_AMD64_REG(MM2),
|
|
||||||
_DEF_AMD64_REG(MM3),
|
|
||||||
_DEF_AMD64_REG(MM4),
|
|
||||||
_DEF_AMD64_REG(MM5),
|
|
||||||
_DEF_AMD64_REG(MM6),
|
|
||||||
_DEF_AMD64_REG(MM7),
|
|
||||||
_DEF_AMD64_REG(XMM0),
|
|
||||||
_DEF_AMD64_REG(XMM1),
|
|
||||||
_DEF_AMD64_REG(XMM2),
|
|
||||||
_DEF_AMD64_REG(XMM3),
|
|
||||||
_DEF_AMD64_REG(XMM4),
|
|
||||||
_DEF_AMD64_REG(XMM5),
|
|
||||||
_DEF_AMD64_REG(XMM6),
|
|
||||||
_DEF_AMD64_REG(XMM7),
|
|
||||||
_DEF_AMD64_REG(XMM0_0),
|
|
||||||
_DEF_AMD64_REG(XMM0_1),
|
|
||||||
_DEF_AMD64_REG(XMM0_2),
|
|
||||||
_DEF_AMD64_REG(XMM0_3),
|
|
||||||
_DEF_AMD64_REG(XMM1_0),
|
|
||||||
_DEF_AMD64_REG(XMM1_1),
|
|
||||||
_DEF_AMD64_REG(XMM1_2),
|
|
||||||
_DEF_AMD64_REG(XMM1_3),
|
|
||||||
_DEF_AMD64_REG(XMM2_0),
|
|
||||||
_DEF_AMD64_REG(XMM2_1),
|
|
||||||
_DEF_AMD64_REG(XMM2_2),
|
|
||||||
_DEF_AMD64_REG(XMM2_3),
|
|
||||||
_DEF_AMD64_REG(XMM3_0),
|
|
||||||
_DEF_AMD64_REG(XMM3_1),
|
|
||||||
_DEF_AMD64_REG(XMM3_2),
|
|
||||||
_DEF_AMD64_REG(XMM3_3),
|
|
||||||
_DEF_AMD64_REG(XMM4_0),
|
|
||||||
_DEF_AMD64_REG(XMM4_1),
|
|
||||||
_DEF_AMD64_REG(XMM4_2),
|
|
||||||
_DEF_AMD64_REG(XMM4_3),
|
|
||||||
_DEF_AMD64_REG(XMM5_0),
|
|
||||||
_DEF_AMD64_REG(XMM5_1),
|
|
||||||
_DEF_AMD64_REG(XMM5_2),
|
|
||||||
_DEF_AMD64_REG(XMM5_3),
|
|
||||||
_DEF_AMD64_REG(XMM6_0),
|
|
||||||
_DEF_AMD64_REG(XMM6_1),
|
|
||||||
_DEF_AMD64_REG(XMM6_2),
|
|
||||||
_DEF_AMD64_REG(XMM6_3),
|
|
||||||
_DEF_AMD64_REG(XMM7_0),
|
|
||||||
_DEF_AMD64_REG(XMM7_1),
|
|
||||||
_DEF_AMD64_REG(XMM7_2),
|
|
||||||
_DEF_AMD64_REG(XMM7_3),
|
|
||||||
_DEF_AMD64_REG(XMM0L),
|
|
||||||
_DEF_AMD64_REG(XMM1L),
|
|
||||||
_DEF_AMD64_REG(XMM2L),
|
|
||||||
_DEF_AMD64_REG(XMM3L),
|
|
||||||
_DEF_AMD64_REG(XMM4L),
|
|
||||||
_DEF_AMD64_REG(XMM5L),
|
|
||||||
_DEF_AMD64_REG(XMM6L),
|
|
||||||
_DEF_AMD64_REG(XMM7L),
|
|
||||||
_DEF_AMD64_REG(XMM0H),
|
|
||||||
_DEF_AMD64_REG(XMM1H),
|
|
||||||
_DEF_AMD64_REG(XMM2H),
|
|
||||||
_DEF_AMD64_REG(XMM3H),
|
|
||||||
_DEF_AMD64_REG(XMM4H),
|
|
||||||
_DEF_AMD64_REG(XMM5H),
|
|
||||||
_DEF_AMD64_REG(XMM6H),
|
|
||||||
_DEF_AMD64_REG(XMM7H),
|
|
||||||
_DEF_AMD64_REG(MXCSR),
|
|
||||||
_DEF_AMD64_REG(EMM0L),
|
|
||||||
_DEF_AMD64_REG(EMM1L),
|
|
||||||
_DEF_AMD64_REG(EMM2L),
|
|
||||||
_DEF_AMD64_REG(EMM3L),
|
|
||||||
_DEF_AMD64_REG(EMM4L),
|
|
||||||
_DEF_AMD64_REG(EMM5L),
|
|
||||||
_DEF_AMD64_REG(EMM6L),
|
|
||||||
_DEF_AMD64_REG(EMM7L),
|
|
||||||
_DEF_AMD64_REG(EMM0H),
|
|
||||||
_DEF_AMD64_REG(EMM1H),
|
|
||||||
_DEF_AMD64_REG(EMM2H),
|
|
||||||
_DEF_AMD64_REG(EMM3H),
|
|
||||||
_DEF_AMD64_REG(EMM4H),
|
|
||||||
_DEF_AMD64_REG(EMM5H),
|
|
||||||
_DEF_AMD64_REG(EMM6H),
|
|
||||||
_DEF_AMD64_REG(EMM7H),
|
|
||||||
_DEF_AMD64_REG(MM00),
|
|
||||||
_DEF_AMD64_REG(MM01),
|
|
||||||
_DEF_AMD64_REG(MM10),
|
|
||||||
_DEF_AMD64_REG(MM11),
|
|
||||||
_DEF_AMD64_REG(MM20),
|
|
||||||
_DEF_AMD64_REG(MM21),
|
|
||||||
_DEF_AMD64_REG(MM30),
|
|
||||||
_DEF_AMD64_REG(MM31),
|
|
||||||
_DEF_AMD64_REG(MM40),
|
|
||||||
_DEF_AMD64_REG(MM41),
|
|
||||||
_DEF_AMD64_REG(MM50),
|
|
||||||
_DEF_AMD64_REG(MM51),
|
|
||||||
_DEF_AMD64_REG(MM60),
|
|
||||||
_DEF_AMD64_REG(MM61),
|
|
||||||
_DEF_AMD64_REG(MM70),
|
|
||||||
_DEF_AMD64_REG(MM71),
|
|
||||||
_DEF_AMD64_REG(XMM8),
|
|
||||||
_DEF_AMD64_REG(XMM9),
|
|
||||||
_DEF_AMD64_REG(XMM10),
|
|
||||||
_DEF_AMD64_REG(XMM11),
|
|
||||||
_DEF_AMD64_REG(XMM12),
|
|
||||||
_DEF_AMD64_REG(XMM13),
|
|
||||||
_DEF_AMD64_REG(XMM14),
|
|
||||||
_DEF_AMD64_REG(XMM15),
|
|
||||||
_DEF_AMD64_REG(XMM8_0),
|
|
||||||
_DEF_AMD64_REG(XMM8_1),
|
|
||||||
_DEF_AMD64_REG(XMM8_2),
|
|
||||||
_DEF_AMD64_REG(XMM8_3),
|
|
||||||
_DEF_AMD64_REG(XMM9_0),
|
|
||||||
_DEF_AMD64_REG(XMM9_1),
|
|
||||||
_DEF_AMD64_REG(XMM9_2),
|
|
||||||
_DEF_AMD64_REG(XMM9_3),
|
|
||||||
_DEF_AMD64_REG(XMM10_0),
|
|
||||||
_DEF_AMD64_REG(XMM10_1),
|
|
||||||
_DEF_AMD64_REG(XMM10_2),
|
|
||||||
_DEF_AMD64_REG(XMM10_3),
|
|
||||||
_DEF_AMD64_REG(XMM11_0),
|
|
||||||
_DEF_AMD64_REG(XMM11_1),
|
|
||||||
_DEF_AMD64_REG(XMM11_2),
|
|
||||||
_DEF_AMD64_REG(XMM11_3),
|
|
||||||
_DEF_AMD64_REG(XMM12_0),
|
|
||||||
_DEF_AMD64_REG(XMM12_1),
|
|
||||||
_DEF_AMD64_REG(XMM12_2),
|
|
||||||
_DEF_AMD64_REG(XMM12_3),
|
|
||||||
_DEF_AMD64_REG(XMM13_0),
|
|
||||||
_DEF_AMD64_REG(XMM13_1),
|
|
||||||
_DEF_AMD64_REG(XMM13_2),
|
|
||||||
_DEF_AMD64_REG(XMM13_3),
|
|
||||||
_DEF_AMD64_REG(XMM14_0),
|
|
||||||
_DEF_AMD64_REG(XMM14_1),
|
|
||||||
_DEF_AMD64_REG(XMM14_2),
|
|
||||||
_DEF_AMD64_REG(XMM14_3),
|
|
||||||
_DEF_AMD64_REG(XMM15_0),
|
|
||||||
_DEF_AMD64_REG(XMM15_1),
|
|
||||||
_DEF_AMD64_REG(XMM15_2),
|
|
||||||
_DEF_AMD64_REG(XMM15_3),
|
|
||||||
_DEF_AMD64_REG(XMM8L),
|
|
||||||
_DEF_AMD64_REG(XMM9L),
|
|
||||||
_DEF_AMD64_REG(XMM10L),
|
|
||||||
_DEF_AMD64_REG(XMM11L),
|
|
||||||
_DEF_AMD64_REG(XMM12L),
|
|
||||||
_DEF_AMD64_REG(XMM13L),
|
|
||||||
_DEF_AMD64_REG(XMM14L),
|
|
||||||
_DEF_AMD64_REG(XMM15L),
|
|
||||||
_DEF_AMD64_REG(XMM8H),
|
|
||||||
_DEF_AMD64_REG(XMM9H),
|
|
||||||
_DEF_AMD64_REG(XMM10H),
|
|
||||||
_DEF_AMD64_REG(XMM11H),
|
|
||||||
_DEF_AMD64_REG(XMM12H),
|
|
||||||
_DEF_AMD64_REG(XMM13H),
|
|
||||||
_DEF_AMD64_REG(XMM14H),
|
|
||||||
_DEF_AMD64_REG(XMM15H),
|
|
||||||
_DEF_AMD64_REG(EMM8L),
|
|
||||||
_DEF_AMD64_REG(EMM9L),
|
|
||||||
_DEF_AMD64_REG(EMM10L),
|
|
||||||
_DEF_AMD64_REG(EMM11L),
|
|
||||||
_DEF_AMD64_REG(EMM12L),
|
|
||||||
_DEF_AMD64_REG(EMM13L),
|
|
||||||
_DEF_AMD64_REG(EMM14L),
|
|
||||||
_DEF_AMD64_REG(EMM15L),
|
|
||||||
_DEF_AMD64_REG(EMM8H),
|
|
||||||
_DEF_AMD64_REG(EMM9H),
|
|
||||||
_DEF_AMD64_REG(EMM10H),
|
|
||||||
_DEF_AMD64_REG(EMM11H),
|
|
||||||
_DEF_AMD64_REG(EMM12H),
|
|
||||||
_DEF_AMD64_REG(EMM13H),
|
|
||||||
_DEF_AMD64_REG(EMM14H),
|
|
||||||
_DEF_AMD64_REG(EMM15H),
|
|
||||||
_DEF_AMD64_REG(SIL),
|
|
||||||
_DEF_AMD64_REG(DIL),
|
|
||||||
_DEF_AMD64_REG(BPL),
|
|
||||||
_DEF_AMD64_REG(SPL),
|
|
||||||
_DEF_AMD64_REG(RAX),
|
|
||||||
_DEF_AMD64_REG(RBX),
|
|
||||||
_DEF_AMD64_REG(RCX),
|
|
||||||
_DEF_AMD64_REG(RDX),
|
|
||||||
_DEF_AMD64_REG(RSI),
|
|
||||||
_DEF_AMD64_REG(RDI),
|
|
||||||
_DEF_AMD64_REG(RBP),
|
|
||||||
_DEF_AMD64_REG(RSP),
|
|
||||||
_DEF_AMD64_REG(R8),
|
|
||||||
_DEF_AMD64_REG(R9),
|
|
||||||
_DEF_AMD64_REG(R10),
|
|
||||||
_DEF_AMD64_REG(R11),
|
|
||||||
_DEF_AMD64_REG(R12),
|
|
||||||
_DEF_AMD64_REG(R13),
|
|
||||||
_DEF_AMD64_REG(R14),
|
|
||||||
_DEF_AMD64_REG(R15),
|
|
||||||
_DEF_AMD64_REG(R8B),
|
|
||||||
_DEF_AMD64_REG(R9B),
|
|
||||||
_DEF_AMD64_REG(R10B),
|
|
||||||
_DEF_AMD64_REG(R11B),
|
|
||||||
_DEF_AMD64_REG(R12B),
|
|
||||||
_DEF_AMD64_REG(R13B),
|
|
||||||
_DEF_AMD64_REG(R14B),
|
|
||||||
_DEF_AMD64_REG(R15B),
|
|
||||||
_DEF_AMD64_REG(R8W),
|
|
||||||
_DEF_AMD64_REG(R9W),
|
|
||||||
_DEF_AMD64_REG(R10W),
|
|
||||||
_DEF_AMD64_REG(R11W),
|
|
||||||
_DEF_AMD64_REG(R12W),
|
|
||||||
_DEF_AMD64_REG(R13W),
|
|
||||||
_DEF_AMD64_REG(R14W),
|
|
||||||
_DEF_AMD64_REG(R15W),
|
|
||||||
_DEF_AMD64_REG(R8D),
|
|
||||||
_DEF_AMD64_REG(R9D),
|
|
||||||
_DEF_AMD64_REG(R10D),
|
|
||||||
_DEF_AMD64_REG(R11D),
|
|
||||||
_DEF_AMD64_REG(R12D),
|
|
||||||
_DEF_AMD64_REG(R13D),
|
|
||||||
_DEF_AMD64_REG(R14D),
|
|
||||||
_DEF_AMD64_REG(R15D)
|
|
||||||
};
|
|
||||||
#undef _DEF_AMD64_REG
|
|
||||||
|
|
||||||
const size_t Symbol::cntAmd64RegName= _countof(amd64RegName);
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
}
|
|
@ -80,6 +80,27 @@ ULONG Module::getRvaByName(const std::string &symName)
|
|||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ULONG64
|
||||||
|
Module::getSymbolSize( const std::string &symName )
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
SymbolPtr &symScope = getSymScope();
|
||||||
|
|
||||||
|
SymbolPtr child = symScope->getChildByName( symName );
|
||||||
|
|
||||||
|
if ( child->getSymTag() == SymTagData )
|
||||||
|
return child->getSize();
|
||||||
|
|
||||||
|
} catch( const SymbolException& )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
return getTypeByName(symName)->getSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
std::string Module::print()
|
std::string Module::print()
|
||||||
{
|
{
|
||||||
std::stringstream sstr;
|
std::stringstream sstr;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "intbase.h"
|
#include "intbase.h"
|
||||||
#include "symengine.h"
|
#include "symengine.h"
|
||||||
|
#include "typeinfo.h"
|
||||||
|
|
||||||
namespace pykd {
|
namespace pykd {
|
||||||
|
|
||||||
@ -73,6 +74,12 @@ public:
|
|||||||
return m_timeDataStamp;
|
return m_timeDataStamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TypeInfoPtr getTypeByName( const std::string &typeName ) {
|
||||||
|
return TypeInfo::getTypeInfo( boost::static_pointer_cast<Symbol>( getSymScope() ), typeName);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG64 getSymbolSize( const std::string &symName );
|
||||||
|
|
||||||
std::string print();
|
std::string print();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -409,6 +409,14 @@
|
|||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\typeinfo.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\udtutils.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Header Files"
|
Name="Header Files"
|
||||||
@ -455,6 +463,10 @@
|
|||||||
RelativePath=".\typeinfo.h"
|
RelativePath=".\typeinfo.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\udtutils.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Resource Files"
|
Name="Resource Files"
|
||||||
@ -489,6 +501,10 @@
|
|||||||
<Filter
|
<Filter
|
||||||
Name="dia"
|
Name="dia"
|
||||||
>
|
>
|
||||||
|
<File
|
||||||
|
RelativePath=".\dia\diadata.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\dia\diawrapper.cpp"
|
RelativePath=".\dia\diawrapper.cpp"
|
||||||
>
|
>
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include "intbase.h"
|
#include "intbase.h"
|
||||||
#include "dbgexcept.h"
|
#include "dbgexcept.h"
|
||||||
#include "dbgmem.h"
|
#include "dbgmem.h"
|
||||||
|
#include "typeinfo.h"
|
||||||
|
|
||||||
using namespace pykd;
|
using namespace pykd;
|
||||||
|
|
||||||
@ -56,7 +57,12 @@ BOOST_PYTHON_MODULE( pykd )
|
|||||||
python::def( "go", &debugGo,
|
python::def( "go", &debugGo,
|
||||||
"Go debugging" );
|
"Go debugging" );
|
||||||
|
|
||||||
|
// system properties
|
||||||
|
python::def( "ptrSize", &ptrSize,
|
||||||
|
"Return effective pointer size" );
|
||||||
|
|
||||||
// Manage target memory access
|
// Manage target memory access
|
||||||
|
|
||||||
python::def( "isValid", &isVaValid,
|
python::def( "isValid", &isVaValid,
|
||||||
"Check if the virtual address is valid" );
|
"Check if the virtual address is valid" );
|
||||||
python::def( "compareMemory", &compareMemory, compareMemory_( python::args( "offset1", "offset2", "length", "phyAddr" ),
|
python::def( "compareMemory", &compareMemory, compareMemory_( python::args( "offset1", "offset2", "length", "phyAddr" ),
|
||||||
@ -118,6 +124,9 @@ BOOST_PYTHON_MODULE( pykd )
|
|||||||
python::def( "loadPtrs", &loadPtrArray,
|
python::def( "loadPtrs", &loadPtrArray,
|
||||||
"Read the block of the target's memory and return it as a list of pointers" );
|
"Read the block of the target's memory and return it as a list of pointers" );
|
||||||
|
|
||||||
|
// typed and vaiables
|
||||||
|
python::def( "sizeof", &TypeInfo::getSymbolSize,
|
||||||
|
"Return a size of the type or variable" );
|
||||||
|
|
||||||
python::class_<intBase>( "intBase", "intBase", python::no_init )
|
python::class_<intBase>( "intBase", "intBase", python::no_init )
|
||||||
.def( python::init<python::object&>() )
|
.def( python::init<python::object&>() )
|
||||||
@ -186,8 +195,8 @@ BOOST_PYTHON_MODULE( pykd )
|
|||||||
"Return rva of the symbol" )
|
"Return rva of the symbol" )
|
||||||
//.def( "sizeof", &Module::getSymbolSize,
|
//.def( "sizeof", &Module::getSymbolSize,
|
||||||
// "Return a size of the type or variable" )
|
// "Return a size of the type or variable" )
|
||||||
//.def("type", &Module::getTypeByName,
|
.def("type", &Module::getTypeByName,
|
||||||
// "Return typeInfo class by type name" )
|
"Return typeInfo class by type name" )
|
||||||
//.def("typedVar", &Module::getTypedVarByAddr,
|
//.def("typedVar", &Module::getTypedVarByAddr,
|
||||||
// "Return a typedVar class instance" )
|
// "Return a typedVar class instance" )
|
||||||
//.def("typedVar",&Module::getTypedVarByName,
|
//.def("typedVar",&Module::getTypedVarByName,
|
||||||
@ -218,12 +227,29 @@ BOOST_PYTHON_MODULE( pykd )
|
|||||||
"Return address of the symbol" )
|
"Return address of the symbol" )
|
||||||
.def( "__str__", &Module::print );
|
.def( "__str__", &Module::print );
|
||||||
|
|
||||||
|
python::class_<TypeInfo, TypeInfoPtr, python::bases<intBase>, boost::noncopyable >("typeInfo", "Class representing typeInfo", python::no_init )
|
||||||
|
.def("__init__", python::make_constructor(TypeInfo::getTypeInfoByName ) )
|
||||||
|
.def( "name", &TypeInfo::getName )
|
||||||
|
.def( "size", &TypeInfo::getSize )
|
||||||
|
.def( "staticOffset", &TypeInfo::getStaticOffset )
|
||||||
|
.def( "fieldOffset", &TypeInfo::getFieldOffsetByNameRecirsive )
|
||||||
|
.def( "bitOffset", &TypeInfo::getBitOffset )
|
||||||
|
.def( "bitWidth", &TypeInfo::getBitWidth )
|
||||||
|
.def( "field", &TypeInfo::getField )
|
||||||
|
.def( "asMap", &TypeInfo::asMap )
|
||||||
|
.def( "deref", &TypeInfo::deref )
|
||||||
|
.def( "__str__", &TypeInfo::print )
|
||||||
|
.def( "__getattr__", &TypeInfo::getField )
|
||||||
|
.def("__len__", &TypeInfo::getElementCount )
|
||||||
|
.def("__getitem__", &TypeInfo::getElementByIndex );
|
||||||
|
|
||||||
|
|
||||||
pykd::exception<DbgException>( "BaseException", "Pykd base exception class" );
|
pykd::exception<DbgException>( "BaseException", "Pykd base exception class" );
|
||||||
pykd::exception<MemoryException,DbgException>( "MemoryException", "Target memory access exception class" );
|
pykd::exception<MemoryException,DbgException>( "MemoryException", "Target memory access exception class" );
|
||||||
//pykd::exception<WaitEventException,DbgException>( "WaitEventException", "Debug interface access exception" );
|
//pykd::exception<WaitEventException,DbgException>( "WaitEventException", "Debug interface access exception" );
|
||||||
pykd::exception<SymbolException,DbgException>( "SymbolException", "Symbol exception" );
|
pykd::exception<SymbolException,DbgException>( "SymbolException", "Symbol exception" );
|
||||||
//pykd::exception<pyDia::Exception,SymbolException>( "DiaException", "Debug interface access exception" );
|
//pykd::exception<pyDia::Exception,SymbolException>( "DiaException", "Debug interface access exception" );
|
||||||
//pykd::exception<TypeException,SymbolException>( "TypeException", "type exception" );
|
pykd::exception<TypeException,SymbolException>( "TypeException", "type exception" );
|
||||||
//pykd::exception<AddSyntheticSymbolException,DbgException>( "AddSynSymbolException", "synthetic symbol exception" );
|
//pykd::exception<AddSyntheticSymbolException,DbgException>( "AddSynSymbolException", "synthetic symbol exception" );
|
||||||
//pykd::exception<ImplementException,DbgException>( "ImplementException", "implementation exception" );
|
//pykd::exception<ImplementException,DbgException>( "ImplementException", "implementation exception" );
|
||||||
}
|
}
|
||||||
|
@ -31,9 +31,9 @@
|
|||||||
#include <atlbase.h>
|
#include <atlbase.h>
|
||||||
#include <psapi.h>
|
#include <psapi.h>
|
||||||
|
|
||||||
#include <dia2.h>
|
//#include <dia2.h>
|
||||||
|
|
||||||
#include <DbgEng.h>
|
//#include <DbgEng.h>
|
||||||
|
|
||||||
//
|
//
|
||||||
//#ifndef __field_ecount_opt
|
//#ifndef __field_ecount_opt
|
||||||
|
@ -3,20 +3,80 @@
|
|||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
#include "typeinfo.h"
|
#include "typeinfo.h"
|
||||||
#include "dbgclient.h"
|
#include "dbgengine.h"
|
||||||
|
#include "module.h"
|
||||||
|
|
||||||
namespace pykd {
|
namespace pykd {
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
TypeInfoPtr TypeInfo::getTypeInfoByName( const std::string &typeName )
|
static const boost::regex moduleSymMatch("^(?:([^!]*)!)?([^!]+)$");
|
||||||
|
|
||||||
|
void splitSymName( const std::string &fullName, std::string &moduleName, std::string &symbolName )
|
||||||
{
|
{
|
||||||
return g_dbgClient->getTypeInfoByName( typeName );
|
boost::cmatch matchResult;
|
||||||
|
|
||||||
|
//OutputReader outputDiscard( m_client );
|
||||||
|
|
||||||
|
if ( !boost::regex_match( fullName.c_str(), matchResult, moduleSymMatch ) )
|
||||||
|
{
|
||||||
|
std::stringstream sstr;
|
||||||
|
sstr << "invalid symbol name: " << fullName;
|
||||||
|
throw SymbolException( sstr.str() );
|
||||||
|
}
|
||||||
|
|
||||||
|
symbolName = std::string( matchResult[2].first, matchResult[2].second );
|
||||||
|
|
||||||
|
if ( matchResult[1].matched )
|
||||||
|
{
|
||||||
|
moduleName = std::string( matchResult[1].first, matchResult[1].second );
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG64 baseOffset = 0;
|
||||||
|
baseOffset = findModuleBySymbol( symbolName );
|
||||||
|
|
||||||
|
moduleName = getModuleName( baseOffset );
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
TypeInfoPtr TypeInfo::getTypeInfo( pyDia::SymbolPtr &typeSym )
|
TypeInfoPtr TypeInfo::getTypeInfoByName( const std::string &typeName )
|
||||||
|
{
|
||||||
|
std::string moduleName;
|
||||||
|
std::string symName;
|
||||||
|
|
||||||
|
if ( TypeInfo::isBaseType( typeName ) )
|
||||||
|
return TypeInfo::getBaseTypeInfo( typeName );
|
||||||
|
|
||||||
|
splitSymName( typeName, moduleName, symName );
|
||||||
|
|
||||||
|
ModulePtr module = Module::loadModuleByName( moduleName );
|
||||||
|
|
||||||
|
return module->getTypeByName( symName );
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ULONG64 TypeInfo::getSymbolSize( const std::string &fullName )
|
||||||
|
{
|
||||||
|
std::string moduleName;
|
||||||
|
std::string symName;
|
||||||
|
|
||||||
|
if ( TypeInfo::isBaseType( fullName ) )
|
||||||
|
return TypeInfo::getBaseTypeInfo( fullName )->getSize();
|
||||||
|
|
||||||
|
splitSymName( fullName, moduleName, symName );
|
||||||
|
|
||||||
|
ModulePtr module = Module::loadModuleByName( moduleName );
|
||||||
|
|
||||||
|
return module->getSymbolSize( symName );
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
TypeInfoPtr TypeInfo::getTypeInfo( SymbolPtr &typeSym )
|
||||||
{
|
{
|
||||||
const ULONG symTag = typeSym->getSymTag();
|
const ULONG symTag = typeSym->getSymTag();
|
||||||
switch( symTag )
|
switch( symTag )
|
||||||
@ -86,7 +146,7 @@ BaseTypeVariant TypeInfo::getValue()
|
|||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
TypeInfoPtr TypeInfo::getTypeInfo( pyDia::SymbolPtr &symScope, const std::string &symName )
|
TypeInfoPtr TypeInfo::getTypeInfo( SymbolPtr &symScope, const std::string &symName )
|
||||||
{
|
{
|
||||||
size_t pos = symName.find_first_of( "*[" );
|
size_t pos = symName.find_first_of( "*[" );
|
||||||
|
|
||||||
@ -104,11 +164,11 @@ TypeInfoPtr TypeInfo::getTypeInfo( pyDia::SymbolPtr &symScope, const std::strin
|
|||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
TypeInfoPtr TypeInfo::getTypeInfo( pyDia::SymbolPtr &symScope, pyDia::SymbolPtr &symChild )
|
TypeInfoPtr TypeInfo::getTypeInfo( SymbolPtr &symScope, SymbolPtr &symChild )
|
||||||
{
|
{
|
||||||
CComVariant constVal;
|
CComVariant constVal;
|
||||||
|
|
||||||
pyDia::SymbolPtr symType = symChild;
|
SymbolPtr symType = symChild;
|
||||||
if ( symType->getSymTag() == SymTagData )
|
if ( symType->getSymTag() == SymTagData )
|
||||||
{
|
{
|
||||||
if ( symType->getLocType() == LocIsBitField )
|
if ( symType->getLocType() == LocIsBitField )
|
||||||
@ -203,9 +263,9 @@ TypeInfo::getBaseTypeInfo( const std::string &symName )
|
|||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
TypeInfoPtr
|
TypeInfoPtr
|
||||||
TypeInfo::getBaseTypeInfo( pyDia::SymbolPtr &symbol )
|
TypeInfo::getBaseTypeInfo( SymbolPtr &symbol )
|
||||||
{
|
{
|
||||||
std::string symName = symbol->getBasicTypeName( symbol->getBaseType() );
|
std::string symName = getBasicTypeName( symbol->getBaseType() );
|
||||||
|
|
||||||
if ( symName == "Int" || symName == "UInt" )
|
if ( symName == "Int" || symName == "UInt" )
|
||||||
{
|
{
|
||||||
@ -225,7 +285,7 @@ TypeInfo::getBaseTypeInfo( pyDia::SymbolPtr &symbol )
|
|||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
BitFieldTypeInfo::BitFieldTypeInfo( pyDia::SymbolPtr &symbol )
|
BitFieldTypeInfo::BitFieldTypeInfo( SymbolPtr &symbol )
|
||||||
{
|
{
|
||||||
m_bitWidth = (ULONG)symbol->getSize();
|
m_bitWidth = (ULONG)symbol->getSize();
|
||||||
m_bitPos = (ULONG)symbol->getBitPosition();
|
m_bitPos = (ULONG)symbol->getBitPosition();
|
||||||
@ -242,9 +302,9 @@ BitFieldTypeInfo::BitFieldTypeInfo( pyDia::SymbolPtr &symbol )
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
PointerTypeInfo::PointerTypeInfo( pyDia::SymbolPtr &symbol )
|
PointerTypeInfo::PointerTypeInfo( SymbolPtr &symbol )
|
||||||
{
|
{
|
||||||
pyDia::SymbolPtr pointTo = symbol->getType();
|
SymbolPtr pointTo = symbol->getType();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
m_derefType = TypeInfo::getTypeInfo( pointTo );
|
m_derefType = TypeInfo::getTypeInfo( pointTo );
|
||||||
@ -280,7 +340,7 @@ PointerTypeInfo::PointerTypeInfo( pyDia::SymbolPtr &symbol )
|
|||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
PointerTypeInfo::PointerTypeInfo( pyDia::SymbolPtr &symScope, const std::string &symName )
|
PointerTypeInfo::PointerTypeInfo( SymbolPtr &symScope, const std::string &symName )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -309,7 +369,7 @@ ULONG PointerTypeInfo::getSize()
|
|||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
ArrayTypeInfo::ArrayTypeInfo( pyDia::SymbolPtr &symbol )
|
ArrayTypeInfo::ArrayTypeInfo( SymbolPtr &symbol )
|
||||||
{
|
{
|
||||||
m_derefType = TypeInfo::getTypeInfo( symbol->getType() );
|
m_derefType = TypeInfo::getTypeInfo( symbol->getType() );
|
||||||
m_count = symbol->getCount();
|
m_count = symbol->getCount();
|
||||||
@ -317,7 +377,7 @@ ArrayTypeInfo::ArrayTypeInfo( pyDia::SymbolPtr &symbol )
|
|||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
ArrayTypeInfo::ArrayTypeInfo( pyDia::SymbolPtr &symScope, const std::string &symName, ULONG count )
|
ArrayTypeInfo::ArrayTypeInfo( SymbolPtr &symScope, const std::string &symName, ULONG count )
|
||||||
{
|
{
|
||||||
m_derefType = TypeInfo::getTypeInfo( symScope, symName );
|
m_derefType = TypeInfo::getTypeInfo( symScope, symName );
|
||||||
m_count = count;
|
m_count = count;
|
||||||
@ -410,7 +470,7 @@ static const boost::regex arrayMatch("^(.*)\\[(\\d+)\\]$");
|
|||||||
|
|
||||||
static const boost::regex symbolMatch("^([\\*]*)([^\\(\\)\\*\\[\\]]*)([\\(\\)\\*\\[\\]\\d]*)$");
|
static const boost::regex symbolMatch("^([\\*]*)([^\\(\\)\\*\\[\\]]*)([\\(\\)\\*\\[\\]\\d]*)$");
|
||||||
|
|
||||||
TypeInfoPtr TypeInfo::getComplexType( pyDia::SymbolPtr &symScope, const std::string &symName )
|
TypeInfoPtr TypeInfo::getComplexType( SymbolPtr &symScope, const std::string &symName )
|
||||||
{
|
{
|
||||||
ULONG ptrSize = (symScope->getMachineType() == IMAGE_FILE_MACHINE_AMD64) ? 8 : 4;
|
ULONG ptrSize = (symScope->getMachineType() == IMAGE_FILE_MACHINE_AMD64) ? 8 : 4;
|
||||||
|
|
||||||
@ -427,7 +487,7 @@ TypeInfoPtr TypeInfo::getComplexType( pyDia::SymbolPtr &symScope, const std::str
|
|||||||
return getRecurciveComplexType( basePtr, std::string( matchResult[3].first, matchResult[3].second ), ptrSize );
|
return getRecurciveComplexType( basePtr, std::string( matchResult[3].first, matchResult[3].second ), ptrSize );
|
||||||
}
|
}
|
||||||
|
|
||||||
pyDia::SymbolPtr lowestSymbol = symScope->getChildByName( innerSymName );
|
SymbolPtr lowestSymbol = symScope->getChildByName( innerSymName );
|
||||||
|
|
||||||
if ( lowestSymbol->getSymTag() == SymTagData )
|
if ( lowestSymbol->getSymTag() == SymTagData )
|
||||||
{
|
{
|
||||||
@ -502,8 +562,8 @@ ULONG UdtTypeInfo::getFieldCount()
|
|||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void UdtTypeInfo::getFields(
|
void UdtTypeInfo::getFields(
|
||||||
pyDia::SymbolPtr &rootSym,
|
SymbolPtr &rootSym,
|
||||||
pyDia::SymbolPtr &baseVirtualSym,
|
SymbolPtr &baseVirtualSym,
|
||||||
ULONG startOffset,
|
ULONG startOffset,
|
||||||
LONG virtualBasePtr,
|
LONG virtualBasePtr,
|
||||||
ULONG virtualDispIndex,
|
ULONG virtualDispIndex,
|
||||||
@ -513,7 +573,7 @@ void UdtTypeInfo::getFields(
|
|||||||
|
|
||||||
for ( ULONG i = 0; i < childCount; ++i )
|
for ( ULONG i = 0; i < childCount; ++i )
|
||||||
{
|
{
|
||||||
pyDia::SymbolPtr childSym = rootSym->getChildByIndex( i );
|
SymbolPtr childSym = rootSym->getChildByIndex( i );
|
||||||
|
|
||||||
ULONG symTag = childSym->getSymTag();
|
ULONG symTag = childSym->getSymTag();
|
||||||
|
|
||||||
@ -521,7 +581,7 @@ void UdtTypeInfo::getFields(
|
|||||||
{
|
{
|
||||||
if ( !childSym->isVirtualBaseClass() )
|
if ( !childSym->isVirtualBaseClass() )
|
||||||
{
|
{
|
||||||
getFields( childSym, pyDia::SymbolPtr(), startOffset + childSym->getOffset() );
|
getFields( childSym, SymbolPtr(), startOffset + childSym->getOffset() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -579,11 +639,11 @@ void UdtTypeInfo::getFields(
|
|||||||
|
|
||||||
void UdtTypeInfo::getVirtualFields()
|
void UdtTypeInfo::getVirtualFields()
|
||||||
{
|
{
|
||||||
ULONG childCount = m_dia->getChildCount<SymTagBaseClass>();
|
ULONG childCount = m_dia->getChildCount(SymTagBaseClass);
|
||||||
|
|
||||||
for ( ULONG i = 0; i < childCount; ++i )
|
for ( ULONG i = 0; i < childCount; ++i )
|
||||||
{
|
{
|
||||||
pyDia::SymbolPtr childSym = m_dia->getChildByIndex( i );
|
SymbolPtr childSym = m_dia->getChildByIndex( i );
|
||||||
|
|
||||||
if ( !childSym->isVirtualBaseClass() )
|
if ( !childSym->isVirtualBaseClass() )
|
||||||
continue;
|
continue;
|
||||||
@ -604,7 +664,7 @@ void UdtTypeInfo::refreshFields()
|
|||||||
{
|
{
|
||||||
if ( m_fields.empty() )
|
if ( m_fields.empty() )
|
||||||
{
|
{
|
||||||
getFields( m_dia, pyDia::SymbolPtr() );
|
getFields( m_dia, SymbolPtr() );
|
||||||
getVirtualFields();
|
getVirtualFields();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -666,7 +726,7 @@ TypeInfoPtr EnumTypeInfo::getFieldByIndex( ULONG index )
|
|||||||
if ( index >= m_dia->getChildCount() )
|
if ( index >= m_dia->getChildCount() )
|
||||||
throw TypeException( m_dia->getName(), ": field not found" );
|
throw TypeException( m_dia->getName(), ": field not found" );
|
||||||
|
|
||||||
pyDia::SymbolPtr field = m_dia->getChildByIndex(index);
|
SymbolPtr field = m_dia->getChildByIndex(index);
|
||||||
|
|
||||||
if ( !field )
|
if ( !field )
|
||||||
throw TypeException( m_dia->getName(), ": field not found" );
|
throw TypeException( m_dia->getName(), ": field not found" );
|
||||||
@ -681,7 +741,7 @@ std::string EnumTypeInfo::getFieldNameByIndex( ULONG index )
|
|||||||
if ( index >= m_dia->getChildCount() )
|
if ( index >= m_dia->getChildCount() )
|
||||||
throw TypeException( m_dia->getName(), ": field not found" );
|
throw TypeException( m_dia->getName(), ": field not found" );
|
||||||
|
|
||||||
pyDia::SymbolPtr field = m_dia->getChildByIndex(index);
|
SymbolPtr field = m_dia->getChildByIndex(index);
|
||||||
|
|
||||||
if ( !field )
|
if ( !field )
|
||||||
throw TypeException( m_dia->getName(), ": field not found" );
|
throw TypeException( m_dia->getName(), ": field not found" );
|
||||||
@ -702,9 +762,9 @@ python::dict EnumTypeInfo::asMap()
|
|||||||
{
|
{
|
||||||
python::dict dct;
|
python::dict dct;
|
||||||
|
|
||||||
pyDia::SymbolPtrList symbolsList = m_dia->findChildrenImpl(SymTagData, "", nsfCaseSensitive );
|
SymbolPtrList symbolsList = m_dia->findChildren(SymTagData, "", TRUE );
|
||||||
|
|
||||||
for ( pyDia::SymbolPtrList::iterator it = symbolsList.begin(); it != symbolsList.end(); it++ )
|
for ( SymbolPtrList::iterator it = symbolsList.begin(); it != symbolsList.end(); it++ )
|
||||||
{
|
{
|
||||||
CComVariant val;
|
CComVariant val;
|
||||||
|
|
||||||
@ -724,9 +784,9 @@ std::string EnumTypeInfo::print()
|
|||||||
|
|
||||||
sstr << "enum: " << getName() << std::endl;
|
sstr << "enum: " << getName() << std::endl;
|
||||||
|
|
||||||
pyDia::SymbolPtrList symbolsList = m_dia->findChildrenImpl(SymTagData, "", nsfCaseSensitive );
|
SymbolPtrList symbolsList = m_dia->findChildren(SymTagData, "", true );
|
||||||
|
|
||||||
for ( pyDia::SymbolPtrList::iterator it = symbolsList.begin(); it != symbolsList.end(); it++ )
|
for ( SymbolPtrList::iterator it = symbolsList.begin(); it != symbolsList.end(); it++ )
|
||||||
{
|
{
|
||||||
CComVariant val;
|
CComVariant val;
|
||||||
(*it)->getValue( val );
|
(*it)->getValue( val );
|
||||||
|
1009
pykd/typeinfo.h
1009
pykd/typeinfo.h
File diff suppressed because it is too large
Load Diff
@ -150,6 +150,26 @@ ULONG64 findModuleBase( ULONG64 offset )
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ULONG64 findModuleBySymbol( const std::string &symbolName )
|
||||||
|
{
|
||||||
|
PyThread_StateRestore pyThreadRestore( g_dbgEng->pystate );
|
||||||
|
|
||||||
|
HRESULT hres;
|
||||||
|
ULONG64 base;
|
||||||
|
|
||||||
|
hres = g_dbgEng->symbols->GetSymbolModule( ( std::string("!") + symbolName ).c_str(), &base );
|
||||||
|
if ( FAILED( hres ) )
|
||||||
|
{
|
||||||
|
std::stringstream sstr;
|
||||||
|
sstr << "failed to find module for symbol: " << symbolName;
|
||||||
|
throw SymbolException( sstr.str() );
|
||||||
|
}
|
||||||
|
|
||||||
|
return base;
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
std::string getModuleName( ULONG64 baseOffset )
|
std::string getModuleName( ULONG64 baseOffset )
|
||||||
{
|
{
|
||||||
PyThread_StateRestore pyThreadRestore( g_dbgEng->pystate );
|
PyThread_StateRestore pyThreadRestore( g_dbgEng->pystate );
|
||||||
|
@ -16,6 +16,7 @@ import target
|
|||||||
import intbase
|
import intbase
|
||||||
import memtest
|
import memtest
|
||||||
import moduletest
|
import moduletest
|
||||||
|
import typeinfo
|
||||||
|
|
||||||
|
|
||||||
def getTestSuite( singleName = "" ):
|
def getTestSuite( singleName = "" ):
|
||||||
@ -25,7 +26,8 @@ def getTestSuite( singleName = "" ):
|
|||||||
unittest.TestLoader().loadTestsFromTestCase( target.TargetTest ),
|
unittest.TestLoader().loadTestsFromTestCase( target.TargetTest ),
|
||||||
unittest.TestLoader().loadTestsFromTestCase( intbase.IntBaseTest ),
|
unittest.TestLoader().loadTestsFromTestCase( intbase.IntBaseTest ),
|
||||||
unittest.TestLoader().loadTestsFromTestCase( moduletest.ModuleTest ),
|
unittest.TestLoader().loadTestsFromTestCase( moduletest.ModuleTest ),
|
||||||
unittest.TestLoader().loadTestsFromTestCase( memtest.MemoryTest )
|
unittest.TestLoader().loadTestsFromTestCase( memtest.MemoryTest ),
|
||||||
|
unittest.TestLoader().loadTestsFromTestCase( typeinfo.TypeInfoTest ),
|
||||||
] )
|
] )
|
||||||
else:
|
else:
|
||||||
return unittest.TestSuite( unittest.TestLoader().loadTestsFromName( singleName ) )
|
return unittest.TestSuite( unittest.TestLoader().loadTestsFromName( singleName ) )
|
||||||
|
Loading…
Reference in New Issue
Block a user