[!] fix:#8229 loadModuel("some_drv") - out message "IDebugSymbol::Reload failed"

git-svn-id: https://pykd.svn.codeplex.com/svn@60723 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\EreTIk_cp 2011-01-26 14:52:55 +00:00
parent 122ec5deea
commit 1afb67fd2e

View File

@ -5,6 +5,7 @@
#include "dbgexcept.h" #include "dbgexcept.h"
#include "dbgmem.h" #include "dbgmem.h"
#include "dbgsym.h" #include "dbgsym.h"
#include "dbgcallback.h"
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
@ -148,13 +149,42 @@ dbgModuleClass::reloadSymbols()
HRESULT hres; HRESULT hres;
try { try {
static const char *szReloadParam = "/f "; //"/f /s ";
std::string reloadParam = "/f "; //"/f /s "; std::string reloadParam = szReloadParam;
reloadParam += m_name; reloadParam += m_name;
hres = dbgExt->symbols->Reload( reloadParam.c_str() );
{
// try reload module by entered name, "silent mode"
OutputReader outputReader( dbgExt->client );
hres = dbgExt->symbols->Reload( reloadParam.c_str() );
}
if ( FAILED( hres ) ) if ( FAILED( hres ) )
throw DbgException( "IDebugSymbol::Reload failed" ); {
// failed => try reload symbols by image file name
char szImageName[MAX_PATH/2];
HRESULT hres2 = dbgExt->symbols2->GetModuleNameString(
DEBUG_MODNAME_IMAGE,
DEBUG_ANY_ID,
m_base,
szImageName,
_countof(szImageName),
NULL);
if (SUCCEEDED(hres2))
{
PCSTR szImageFileName = strrchr(szImageName, '\\');
if (!szImageFileName)
szImageFileName = szImageName;
else
++szImageFileName;
reloadParam = szReloadParam;
reloadParam += szImageFileName;
hres = dbgExt->symbols->Reload( reloadParam.c_str() );
}
}
if ( FAILED( hres ) )
throw DbgException( "IDebugSymbol::Reload failed" );
} }
catch( std::exception &e ) catch( std::exception &e )
{ {