[0.2.x] fixed : IDebugEventCallback::LoadModule exception on kernel debugging

git-svn-id: https://pykd.svn.codeplex.com/svn@80733 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2012-10-31 12:19:56 +00:00 committed by Mikhail I. Izmestev
parent aaf35eb2da
commit a2ea430be4
2 changed files with 17 additions and 2 deletions

View File

@ -2,7 +2,7 @@
#define PYKD_VERSION_MAJOR 0
#define PYKD_VERSION_MINOR 2
#define PYKD_VERSION_SUBVERSION 0
#define PYKD_VERSION_BUILDNO 3
#define PYKD_VERSION_BUILDNO 4
#define __VER_STR2__(x) #x

View File

@ -1015,7 +1015,22 @@ HRESULT STDMETHODCALLTYPE DebugEngine::LoadModule(
{
PyThread_StateSave pyThreadSave( it->pystate );
DEBUG_CALLBACK_RESULT ret = it->callback->OnModuleLoad( BaseOffset, std::string(ModuleName) );
std::string modName;
if ( ModuleName )
{
modName = ModuleName;
}
else if ( ImageName )
{
// ïðè ðàáîòîòå kernel îòëàä÷èêà ModuleName ìîæåò áûòü ðàâåí NULL;
modName = ImageName;
modName.erase( modName.rfind('.') );
}
else
modName = "";
DEBUG_CALLBACK_RESULT ret = it->callback->OnModuleLoad( BaseOffset, modName );
result = ret != DebugCallbackNoChange ? ret : result;
}