mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 13:35:38 +08:00
Check log shared pointer before using it.
llvm-svn: 137228
This commit is contained in:
@@ -69,7 +69,8 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread,
|
||||
|
||||
if (!executableModuleSP)
|
||||
{
|
||||
log->Printf ("Can't execute code without an executable module.");
|
||||
if (log)
|
||||
log->Printf ("Can't execute code without an executable module.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -77,15 +78,17 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread,
|
||||
ObjectFile *objectFile = executableModuleSP->GetObjectFile();
|
||||
if (!objectFile)
|
||||
{
|
||||
log->Printf ("Could not find object file for module \"%s\".",
|
||||
executableModuleSP->GetFileSpec().GetFilename().AsCString());
|
||||
if (log)
|
||||
log->Printf ("Could not find object file for module \"%s\".",
|
||||
executableModuleSP->GetFileSpec().GetFilename().AsCString());
|
||||
return;
|
||||
}
|
||||
m_start_addr = objectFile->GetEntryPointAddress();
|
||||
if (!m_start_addr.IsValid())
|
||||
{
|
||||
log->Printf ("Could not find entry point address for executable module \"%s\".",
|
||||
executableModuleSP->GetFileSpec().GetFilename().AsCString());
|
||||
if (log)
|
||||
log->Printf ("Could not find entry point address for executable module \"%s\".",
|
||||
executableModuleSP->GetFileSpec().GetFilename().AsCString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -182,7 +185,8 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread,
|
||||
|
||||
if (!executableModuleSP)
|
||||
{
|
||||
log->Printf ("Can't execute code without an executable module.");
|
||||
if (log)
|
||||
log->Printf ("Can't execute code without an executable module.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -190,8 +194,9 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread,
|
||||
ObjectFile *objectFile = executableModuleSP->GetObjectFile();
|
||||
if (!objectFile)
|
||||
{
|
||||
log->Printf ("Could not find object file for module \"%s\".",
|
||||
executableModuleSP->GetFileSpec().GetFilename().AsCString());
|
||||
if (log)
|
||||
log->Printf ("Could not find object file for module \"%s\".",
|
||||
executableModuleSP->GetFileSpec().GetFilename().AsCString());
|
||||
return;
|
||||
}
|
||||
m_start_addr = objectFile->GetEntryPointAddress();
|
||||
|
||||
Reference in New Issue
Block a user