mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 12:53:23 +08:00
[+] getProcessorType: type of physical processor
git-svn-id: https://pykd.svn.codeplex.com/svn@70185 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
b8950859be
commit
c9b63b1bdb
@ -213,6 +213,8 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
"Return current processor mode as string: X86, ARM, IA64 or X64" );
|
||||
boost::python::def( "setProcessorMode", &setProcessorMode,
|
||||
"Set current processor mode by string (X86, ARM, IA64 or X64)" );
|
||||
boost::python::def( "getProcessorType", &getProcessorType,
|
||||
"Returns physical processor type as string: X86, ARM, IA64 or X64");
|
||||
boost::python::def( "addSynSymbol", &addSyntheticSymbol,
|
||||
"Add new synthetic symbol for virtual address" );
|
||||
boost::python::def( "delAllSynSymbols", &delAllSyntheticSymbols,
|
||||
|
@ -119,17 +119,10 @@ getCurrentStack()
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::string
|
||||
getProcessorMode()
|
||||
// Processor type to string
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
static std::string processorToStr(ULONG processorMode)
|
||||
{
|
||||
HRESULT hres;
|
||||
|
||||
ULONG processorMode;
|
||||
hres = dbgExt->control->GetEffectiveProcessorType( &processorMode );
|
||||
if ( FAILED( hres ) )
|
||||
throw DbgException( "IDebugControl::GetEffectiveProcessorType failed" );
|
||||
|
||||
switch( processorMode )
|
||||
{
|
||||
case IMAGE_FILE_MACHINE_I386:
|
||||
@ -146,7 +139,36 @@ getProcessorMode()
|
||||
}
|
||||
|
||||
throw DbgException( "Unknown CPU type" );
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::string
|
||||
getProcessorMode()
|
||||
{
|
||||
HRESULT hres;
|
||||
|
||||
ULONG processorMode;
|
||||
hres = dbgExt->control->GetEffectiveProcessorType( &processorMode );
|
||||
if ( FAILED( hres ) )
|
||||
throw DbgException( "IDebugControl::GetEffectiveProcessorType failed" );
|
||||
|
||||
return processorToStr(processorMode);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::string
|
||||
getProcessorType()
|
||||
{
|
||||
HRESULT hres;
|
||||
|
||||
ULONG processorMode;
|
||||
hres = dbgExt->control->GetActualProcessorType( &processorMode );
|
||||
if ( FAILED( hres ) )
|
||||
throw DbgException( "IDebugControl::GetEffectiveProcessorType failed" );
|
||||
|
||||
return processorToStr(processorMode);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -40,6 +40,9 @@ public:
|
||||
std::string
|
||||
getProcessorMode();
|
||||
|
||||
std::string
|
||||
getProcessorType();
|
||||
|
||||
void
|
||||
setProcessorMode(
|
||||
const std::string &mode );
|
||||
|
Loading…
Reference in New Issue
Block a user