summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectContainer/Universal-Mach-O
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2010-08-09 23:31:02 +0000
committerJim Ingham <jingham@apple.com>2010-08-09 23:31:02 +0000
commit5aee162f978eac7ffb6363d25b193e51edfbc0b1 (patch)
treeaffe5547d828a14a967f9b5deff564248940554b /lldb/source/Plugins/ObjectContainer/Universal-Mach-O
parent394a69ed528c403248c6354baeedaf0533b33afc (diff)
downloadbcm5719-llvm-5aee162f978eac7ffb6363d25b193e51edfbc0b1.tar.gz
bcm5719-llvm-5aee162f978eac7ffb6363d25b193e51edfbc0b1.zip
Change Target & Process so they can really be initialized with an invalid architecture.
Arrange that this then gets properly set on attach, or when a "file" is set. Add a completer for "process attach -n". Caveats: there isn't currently a way to handle multiple processes with the same name. That will have to wait on a way to pass annotations along with the completion strings. llvm-svn: 110624
Diffstat (limited to 'lldb/source/Plugins/ObjectContainer/Universal-Mach-O')
-rw-r--r--lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
index f9bf3eb8cb1..3a6860fe6de 100644
--- a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
+++ b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
@@ -199,7 +199,18 @@ ObjectFile *
ObjectContainerUniversalMachO::GetObjectFile (const FileSpec *file)
{
uint32_t arch_idx = 0;
- const ArchSpec arch = m_module->GetArchitecture();
+ ArchSpec arch;
+ // If the module hasn't specified an architecture yet, set it to the default
+ // architecture:
+ if (!m_module->GetArchitecture().IsValid())
+ {
+ arch = lldb_private::GetDefaultArchitecture ();
+ if (!arch.IsValid())
+ arch = LLDB_ARCH_DEFAULT;
+ }
+ else
+ arch = m_module->GetArchitecture();
+
ArchSpec curr_arch;
for (arch_idx = 0; arch_idx < m_header.nfat_arch; ++arch_idx)
{
OpenPOWER on IntegriCloud