pykd/pykd/dbgcmd.h
SND\kernelnet_cp 9a0d80eb23 [pykd] added: typeInfo class
[pykd] added: typeException, memoryException and their translation into python 

git-svn-id: https://pykd.svn.codeplex.com/svn@65714 9b283d60-5439-405e-af05-b73fd8c4d996
2011-05-23 06:43:24 +00:00

88 lines
2.1 KiB
C++

#pragma once
#include <string>
#include <map>
/////////////////////////////////////////////////////////////////////////////////
std::string
dbgCommand( const std::string &command );
template <ULONG status>
bool
setExecutionStatus()
{
HRESULT hres;
try {
hres = dbgExt->control->SetExecutionStatus( status );
if ( FAILED( hres ) )
return false;
ULONG currentStatus;
do {
hres = dbgExt->control->WaitForEvent( 0, INFINITE );
if ( FAILED( hres ) )
throw DbgException( "IDebugControl::SetExecutionStatus failed" );
hres = dbgExt->control->GetExecutionStatus( &currentStatus );
if ( FAILED( hres ) )
throw DbgException( "IDebugControl::GetExecutionStatus failed" );
} while( currentStatus != DEBUG_STATUS_BREAK && currentStatus != DEBUG_STATUS_NO_DEBUGGEE );
return true;
}
catch( std::exception &e )
{
dbgExt->control->Output( DEBUG_OUTPUT_ERROR, "pykd error: %s\n", e.what() );
}
catch(...)
{
dbgExt->control->Output( DEBUG_OUTPUT_ERROR, "pykd unexpected error\n" );
}
return false;
}
/////////////////////////////////////////////////////////////////////////////////
class dbgExtensionClass {
public:
dbgExtensionClass() :
m_handle( NULL )
{}
dbgExtensionClass( const char* path );
~dbgExtensionClass();
std::string
call( const std::string &command, const std::string param );
std::string
print() const;
private:
ULONG64 m_handle;
std::string m_path;
};
/////////////////////////////////////////////////////////////////////////////////
ULONG64
evaluate( const std::string &expression );
/////////////////////////////////////////////////////////////////////////////////