forked from OSchip/llvm-project
Follow on to: f05dc40c31
When you pass in a bogus ArchSpec, TargetList.CreateTarget makes a target with the arch of the executable. That wasn't the case with a bogus triple, so this change caused one of the bogus input data tests to fail. So check that the ArchSpec is valid before passing it to CreateTarget.
This commit is contained in:
parent
118c33ef47
commit
1fba21778f
|
@ -808,13 +808,15 @@ SBTarget SBDebugger::CreateTargetWithFileAndArch(const char *filename,
|
|||
PlatformSP platform_sp = m_opaque_sp->GetPlatformList().GetSelectedPlatform();
|
||||
ArchSpec arch = Platform::GetAugmentedArchSpec(
|
||||
platform_sp.get(), arch_cstr);
|
||||
error = m_opaque_sp->GetTargetList().CreateTarget(
|
||||
*m_opaque_sp, filename, arch,
|
||||
add_dependent_modules ? eLoadDependentsYes : eLoadDependentsNo,
|
||||
platform_sp, target_sp);
|
||||
if (arch.IsValid()) {
|
||||
error = m_opaque_sp->GetTargetList().CreateTarget(
|
||||
*m_opaque_sp, filename, arch,
|
||||
add_dependent_modules ? eLoadDependentsYes : eLoadDependentsNo,
|
||||
platform_sp, target_sp);
|
||||
|
||||
if (error.Success())
|
||||
sb_target.SetSP(target_sp);
|
||||
if (error.Success())
|
||||
sb_target.SetSP(target_sp);
|
||||
}
|
||||
}
|
||||
|
||||
LLDB_LOGF(log,
|
||||
|
|
Loading…
Reference in New Issue