mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 03:23:23 +08:00
[0.1.x] added : implemented typedVar class constructors
git-svn-id: https://pykd.svn.codeplex.com/svn@75068 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
641741e0e5
commit
2d1d141a4c
@ -437,4 +437,83 @@ void terminateProcess()
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static const boost::regex moduleSymMatch("^(?:([^!]*)!)?([^!]+)$");
|
||||
|
||||
TypedVarPtr DebugClient::getTypedVarByName( const std::string &varName )
|
||||
{
|
||||
boost::cmatch matchResult;
|
||||
|
||||
if ( !boost::regex_match( varName.c_str(), matchResult, moduleSymMatch ) )
|
||||
{
|
||||
std::stringstream sstr;
|
||||
sstr << "invalid symbol name: " << varName;
|
||||
throw SymbolException( sstr.str() );
|
||||
}
|
||||
|
||||
std::string symName = std::string( matchResult[2].first, matchResult[2].second );
|
||||
|
||||
if ( matchResult[1].matched )
|
||||
{
|
||||
Module module = loadModuleByName( std::string( matchResult[1].first, matchResult[1].second ) );
|
||||
|
||||
return module.getTypedVarByName( symName );
|
||||
}
|
||||
|
||||
HRESULT hres;
|
||||
ULONG64 base;
|
||||
|
||||
hres = m_symbols->GetSymbolModule( ( std::string("!") + symName ).c_str(), &base );
|
||||
if ( FAILED( hres ) )
|
||||
{
|
||||
std::stringstream sstr;
|
||||
sstr << "failed to find module for symbol: " << symName;
|
||||
throw SymbolException( sstr.str() );
|
||||
}
|
||||
|
||||
Module module = loadModuleByOffset( base );
|
||||
|
||||
return module.getTypedVarByName( symName );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TypedVarPtr DebugClient::getTypedVarByTypeName( const std::string &typeName, ULONG64 addr )
|
||||
{
|
||||
boost::cmatch matchResult;
|
||||
|
||||
if ( !boost::regex_match( typeName.c_str(), matchResult, moduleSymMatch ) )
|
||||
{
|
||||
std::stringstream sstr;
|
||||
sstr << "invalid symbol name: " << typeName;
|
||||
throw SymbolException( sstr.str() );
|
||||
}
|
||||
|
||||
std::string symName = std::string( matchResult[2].first, matchResult[2].second );
|
||||
|
||||
if ( matchResult[1].matched )
|
||||
{
|
||||
Module module = loadModuleByName( std::string( matchResult[1].first, matchResult[1].second ) );
|
||||
|
||||
return module.getTypedVarByTypeName( symName, addr );
|
||||
}
|
||||
|
||||
HRESULT hres;
|
||||
ULONG64 base;
|
||||
|
||||
hres = m_symbols->GetSymbolModule( ( std::string("!") + symName ).c_str(), &base );
|
||||
if ( FAILED( hres ) )
|
||||
{
|
||||
std::stringstream sstr;
|
||||
sstr << "failed to find module for symbol: " << symName;
|
||||
throw SymbolException( sstr.str() );
|
||||
}
|
||||
|
||||
Module module = loadModuleByOffset( base );
|
||||
|
||||
return module.getTypedVarByTypeName( symName, addr );
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}; // end of namespace pykd
|
||||
|
@ -325,15 +325,9 @@ public:
|
||||
void removeBp(BPOINT_ID Id);
|
||||
void removeAllBp();
|
||||
|
||||
TypedVarPtr getTypedVarByName( const std::string &varName )
|
||||
{
|
||||
throw DbgException( "not implemented" );
|
||||
}
|
||||
TypedVarPtr getTypedVarByName( const std::string &varName );
|
||||
|
||||
TypedVarPtr getTypedVarByTypeName( const std::string &typeName, ULONG64 addr )
|
||||
{
|
||||
throw DbgException( "not implemented" );
|
||||
}
|
||||
TypedVarPtr getTypedVarByTypeName( const std::string &typeName, ULONG64 addr );
|
||||
|
||||
TypedVarPtr getTypedVarByTypeInfo( const TypeInfoPtr &typeInfo, ULONG64 addr ) {
|
||||
return TypedVar::getTypedVar( m_client, typeInfo, VarDataMemory::factory(m_dataSpaces, addr) );
|
||||
@ -344,9 +338,6 @@ private:
|
||||
python::list
|
||||
loadArray( ULONG64 offset, ULONG count, bool phyAddr );
|
||||
|
||||
//python::list
|
||||
//loadArray( ULONG64 offset, ULONG count, bool phyAddr );
|
||||
|
||||
BpCallbackMap m_bpCallbacks;
|
||||
|
||||
SynSymbolsPtr m_symSymbols; // DebugClient is creator
|
||||
|
Loading…
Reference in New Issue
Block a user