mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-19 19:13:22 +08:00
[0.2.x] added : setProcessorMode routine
git-svn-id: https://pykd.svn.codeplex.com/svn@81227 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
67e1ce1e63
commit
44fd2e17cb
@ -38,14 +38,6 @@ CpuReg getRegByName( const std::string ®Name );
|
||||
|
||||
CpuReg getRegByIndex( ULONG index );
|
||||
|
||||
ULONG64 loadMSR( ULONG msr );
|
||||
|
||||
void setMSR( ULONG msr, ULONG64 value);
|
||||
|
||||
std::string getProcessorMode();
|
||||
|
||||
std::string getProcessorType();
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}; // end pykd namespace
|
||||
|
@ -52,6 +52,12 @@ std::string getRegNameByIndex( ULONG index );
|
||||
BaseTypeVariant getRegVariantValue( ULONG index );
|
||||
ULONG64 getRegInstructionPointer();
|
||||
|
||||
ULONG64 loadMSR( ULONG msr );
|
||||
void setMSR( ULONG msr, ULONG64 value);
|
||||
std::string getProcessorMode();
|
||||
std::string getProcessorType();
|
||||
void setProcessorMode( const std::string &mode );
|
||||
|
||||
// Stack and local variables
|
||||
struct STACK_FRAME_DESC {
|
||||
ULONG number;
|
||||
|
@ -240,6 +240,8 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
"Return current processor mode as string: X86, ARM, IA64 or X64" );
|
||||
python::def( "getProcessorType", &getProcessorType,
|
||||
"Return type of physical processor: X86, ARM, IA64 or X64" );
|
||||
python::def( "setProcessorMode", &setProcessorMode,
|
||||
"Set current processor mode by string (X86, ARM, IA64 or X64)" );
|
||||
|
||||
// stack and local variables
|
||||
python::def( "getCurrentStack", &getCurrentStack,
|
||||
|
@ -787,6 +787,29 @@ std::string getProcessorMode()
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void setProcessorMode( const std::string &mode )
|
||||
{
|
||||
HRESULT hres;
|
||||
ULONG processorMode;
|
||||
|
||||
if ( mode == "X86" )
|
||||
processorMode = IMAGE_FILE_MACHINE_I386;
|
||||
else if ( mode == "ARM" )
|
||||
processorMode = IMAGE_FILE_MACHINE_ARM;
|
||||
else if ( mode == "IA64" )
|
||||
processorMode = IMAGE_FILE_MACHINE_IA64;
|
||||
else if ( mode == "X64" )
|
||||
processorMode = IMAGE_FILE_MACHINE_AMD64;
|
||||
else
|
||||
throw DbgException( "Unknown processor type" );
|
||||
|
||||
hres = g_dbgEng->control->SetEffectiveProcessorType( processorMode );
|
||||
if ( FAILED( hres ) )
|
||||
throw DbgException( "IDebugControl::SetEffectiveProcessorType failed" );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::string getProcessorType()
|
||||
{
|
||||
PyThread_StateRestore pyThreadRestore( g_dbgEng->pystate );
|
||||
|
Loading…
Reference in New Issue
Block a user