From b019cd92b5d42bebeb42b5d43ccab3744e6079d6 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Wed, 11 Sep 2013 21:25:46 +0000 Subject: [PATCH] When target module add/SBTarget::AddModule()'ing, if an architecture isn't specifically requested, use the Target's architecture to pick the correct slice of a universal file. llvm-svn: 190550 --- lldb/source/API/SBTarget.cpp | 2 ++ lldb/source/Commands/CommandObjectTarget.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index f37c8f8a614b..d3cd85c3dd72 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -1905,6 +1905,8 @@ SBTarget::AddModule (const char *path, if (triple) module_spec.GetArchitecture().SetTriple (triple, target_sp->GetPlatform ().get()); + else + module_spec.GetArchitecture() = target_sp->GetArchitecture(); if (symfile) module_spec.GetSymbolFileSpec ().SetFile(symfile, false); diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index e34583a7729b..7f121ecc1c3f 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -2763,6 +2763,8 @@ protected: module_spec.GetUUID() = m_uuid_option_group.GetOptionValue ().GetCurrentValue(); if (m_symbol_file.GetOptionValue().OptionWasSet()) module_spec.GetSymbolFileSpec() = m_symbol_file.GetOptionValue().GetCurrentValue(); + if (!module_spec.GetArchitecture().IsValid()) + module_spec.GetArchitecture() = target->GetArchitecture(); Error error; ModuleSP module_sp (target->GetSharedModule (module_spec, &error)); if (!module_sp)