mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 12:53:23 +08:00
[0.2.x] added: writeDump routine ( Create memory dump file )
git-svn-id: https://pykd.svn.codeplex.com/svn@82203 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
3b7173878b
commit
22496fba41
@ -12,6 +12,7 @@ void detachProcess( ULONG processId = -1);
|
||||
void terminateProcess( ULONG processId = -1);
|
||||
|
||||
void loadDump( const std::wstring &fileName );
|
||||
void writeDump( const std::wstring &fileNamem, bool smallDump );
|
||||
|
||||
bool isDumpAnalyzing();
|
||||
bool isKernelDebugging();
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define PYKD_VERSION_MAJOR 0
|
||||
#define PYKD_VERSION_MINOR 2
|
||||
#define PYKD_VERSION_SUBVERSION 0
|
||||
#define PYKD_VERSION_BUILDNO 11
|
||||
#define PYKD_VERSION_BUILDNO 12
|
||||
|
||||
|
||||
#define __VER_STR2__(x) #x
|
||||
|
@ -104,6 +104,8 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
"Check if kernel dubugging is running" );
|
||||
python::def( "isWindbgExt", &WindbgGlobalSession::isInit,
|
||||
"Check if script works in windbg context" );
|
||||
python::def( "writeDump", &writeDump,
|
||||
"Write memory dump" );
|
||||
|
||||
python::def( "breakin", &debugBreak,
|
||||
"Break into debugger" );
|
||||
|
@ -144,6 +144,32 @@ void loadDump( const std::wstring &fileName )
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void writeDump( const std::wstring &fileName, bool smallDump )
|
||||
{
|
||||
PyThread_StateRestore pyThreadRestore( g_dbgEng->pystate );
|
||||
|
||||
HRESULT hres;
|
||||
|
||||
ULONG debugClass, debugQualifier;
|
||||
|
||||
hres = g_dbgEng->control->GetDebuggeeType( &debugClass, &debugQualifier );
|
||||
|
||||
if ( FAILED( hres ) )
|
||||
throw DbgException( "IDebugControl::GetDebuggeeType failed" );
|
||||
|
||||
hres = g_dbgEng->client->WriteDumpFileWide(
|
||||
fileName.c_str(),
|
||||
NULL,
|
||||
smallDump ? DEBUG_DUMP_SMALL : ( debugClass == DEBUG_CLASS_KERNEL ? DEBUG_DUMP_FULL : DEBUG_DUMP_DEFAULT ),
|
||||
DEBUG_FORMAT_DEFAULT,
|
||||
NULL );
|
||||
|
||||
if ( FAILED(hres) )
|
||||
throw DbgException( "IDebugClient4::WriteDumpFileWide failed" );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool isDumpAnalyzing()
|
||||
{
|
||||
PyThread_StateRestore pyThreadRestore( g_dbgEng->pystate );
|
||||
|
Loading…
Reference in New Issue
Block a user