mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 21:03:23 +08:00
[0.1.x] fixed : intBase for x64
git-svn-id: https://pykd.svn.codeplex.com/svn@72658 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
f93df74624
commit
7c70e6d166
@ -65,4 +65,39 @@ python::object getRegByName( const std::wstring ®Name )
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ULONG64 DebugClient::loadMSR( ULONG msr )
|
||||||
|
{
|
||||||
|
HRESULT hres;
|
||||||
|
ULONG64 value;
|
||||||
|
|
||||||
|
hres = m_dataSpaces->ReadMsr( msr, &value );
|
||||||
|
if ( FAILED( hres ) )
|
||||||
|
throw DbgException( "IDebugDataSpaces::ReadMsr failed" );
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG64 loadMSR( ULONG msr )
|
||||||
|
{
|
||||||
|
return g_dbgClient->loadMSR( msr );
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void DebugClient::setMSR( ULONG msr, ULONG64 value)
|
||||||
|
{
|
||||||
|
HRESULT hres;
|
||||||
|
|
||||||
|
hres = m_dataSpaces->WriteMsr(msr, value);
|
||||||
|
if ( FAILED( hres ) )
|
||||||
|
throw DbgException( "IDebugDataSpaces::WriteMsr failed" );
|
||||||
|
}
|
||||||
|
|
||||||
|
void setMSR( ULONG msr, ULONG64 value)
|
||||||
|
{
|
||||||
|
g_dbgClient->setMSR( msr, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
} // end namespace pykd
|
} // end namespace pykd
|
@ -11,6 +11,10 @@ python::object getRegByName( const std::wstring ®Name );
|
|||||||
|
|
||||||
python::object getRegByIndex( ULONG index );
|
python::object getRegByIndex( ULONG index );
|
||||||
|
|
||||||
|
ULONG64 loadMSR( ULONG msr );
|
||||||
|
|
||||||
|
void setMSR( ULONG msr, ULONG64 value);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
}; // end pykd namespace
|
}; // end pykd namespace
|
||||||
|
@ -179,25 +179,6 @@ void loadDump( const std::wstring &fileName ) {
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
ULONG64 DebugClient::loadMSR( ULONG msr )
|
|
||||||
{
|
|
||||||
HRESULT hres;
|
|
||||||
ULONG64 value;
|
|
||||||
|
|
||||||
hres = m_dataSpaces->ReadMsr( msr, &value );
|
|
||||||
if ( FAILED( hres ) )
|
|
||||||
throw DbgException( "IDebugDataSpaces::ReadMsr failed" );
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
ULONG64 loadMSR( ULONG msr )
|
|
||||||
{
|
|
||||||
return g_dbgClient->loadMSR( msr );
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void DebugClient::startProcess( const std::wstring &processName )
|
void DebugClient::startProcess( const std::wstring &processName )
|
||||||
{
|
{
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
@ -370,22 +351,6 @@ void setExecutionStatus( ULONG status )
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void DebugClient::setMSR( ULONG msr, ULONG64 value)
|
|
||||||
{
|
|
||||||
HRESULT hres;
|
|
||||||
|
|
||||||
hres = m_dataSpaces->WriteMsr(msr, value);
|
|
||||||
if ( FAILED( hres ) )
|
|
||||||
throw DbgException( "IDebugDataSpaces::WriteMsr failed" );
|
|
||||||
}
|
|
||||||
|
|
||||||
void setMSR( ULONG msr, ULONG64 value)
|
|
||||||
{
|
|
||||||
g_dbgClient->setMSR( msr, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void DebugClient::waitForEvent()
|
void DebugClient::waitForEvent()
|
||||||
{
|
{
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
@ -304,14 +304,10 @@ bool isKernelDebugging();
|
|||||||
|
|
||||||
bool isDumpAnalyzing();
|
bool isDumpAnalyzing();
|
||||||
|
|
||||||
ULONG64 loadMSR( ULONG msr );
|
|
||||||
|
|
||||||
ULONG ptrSize();
|
ULONG ptrSize();
|
||||||
|
|
||||||
void setExecutionStatus( ULONG status );
|
void setExecutionStatus( ULONG status );
|
||||||
|
|
||||||
void setMSR( ULONG msr, ULONG64 value);
|
|
||||||
|
|
||||||
void terminateProcess();
|
void terminateProcess();
|
||||||
|
|
||||||
void waitForEvent();
|
void waitForEvent();
|
||||||
|
@ -195,20 +195,15 @@ private:
|
|||||||
|
|
||||||
return BaseTypeVariant(false);
|
return BaseTypeVariant(false);
|
||||||
}
|
}
|
||||||
else if ( _PyLong_Sign( obj.ptr() ) >= 0 )
|
else if ( PyInt_CheckExact( obj.ptr() ) )
|
||||||
{
|
{
|
||||||
if ( PyInt_CheckExact( obj.ptr() ) )
|
return BaseTypeVariant( LONG( PyLong_AsLong( obj.ptr() ) ) );
|
||||||
return BaseTypeVariant( ULONG( PyLong_AsUnsignedLong( obj.ptr() ) ) );
|
|
||||||
else
|
|
||||||
if( PyLong_CheckExact( obj.ptr() ) )
|
|
||||||
return BaseTypeVariant( ULONG64( PyLong_AsUnsignedLongLong( obj.ptr() ) ) );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( PyInt_CheckExact( obj.ptr() ) )
|
if ( _PyLong_Sign( obj.ptr() ) >= 0 )
|
||||||
return BaseTypeVariant( LONG( PyLong_AsLong( obj.ptr() ) ) );
|
return BaseTypeVariant( ULONG64( PyLong_AsUnsignedLongLong( obj.ptr() ) ) );
|
||||||
else
|
else
|
||||||
if( PyLong_CheckExact( obj.ptr() ) )
|
|
||||||
return BaseTypeVariant( LONG64( PyLong_AsLongLong( obj.ptr() ) ) );
|
return BaseTypeVariant( LONG64( PyLong_AsLongLong( obj.ptr() ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ class IntBaseTest( unittest.TestCase ):
|
|||||||
self.assertTrue( 0xFFFFFFFFFFFFFFFF == intBase(0xFFFFFFFFFFFFFFFF) )
|
self.assertTrue( 0xFFFFFFFFFFFFFFFF == intBase(0xFFFFFFFFFFFFFFFF) )
|
||||||
self.assertTrue( -20 == intBase(-20) )
|
self.assertTrue( -20 == intBase(-20) )
|
||||||
self.assertTrue( -2000 == intBase(-2000) )
|
self.assertTrue( -2000 == intBase(-2000) )
|
||||||
|
self.assertTrue( -0x7FFFFFFF == intBase(-0x7FFFFFFF) )
|
||||||
self.assertTrue( -20000000000 == intBase(-20000000000) )
|
self.assertTrue( -20000000000 == intBase(-20000000000) )
|
||||||
self.assertTrue( -0x8000000000000000 == intBase(-0x8000000000000000) )
|
self.assertTrue( -0x8000000000000000 == intBase(-0x8000000000000000) )
|
||||||
self.assertTrue( intBase(0x20L) == intBase(0x20) )
|
self.assertTrue( intBase(0x20L) == intBase(0x20) )
|
||||||
|
Loading…
Reference in New Issue
Block a user