summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectFile.cpp
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/Commands/CommandObjectFile.cpp
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/Commands/CommandObjectFile.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectFile.cpp23
1 files changed, 3 insertions, 20 deletions
diff --git a/lldb/source/Commands/CommandObjectFile.cpp b/lldb/source/Commands/CommandObjectFile.cpp
index 2700e2075ec..25576e1fe82 100644
--- a/lldb/source/Commands/CommandObjectFile.cpp
+++ b/lldb/source/Commands/CommandObjectFile.cpp
@@ -126,31 +126,14 @@ CommandObjectFile::Execute
TargetSP target_sp;
- ArchSpec arch;
- if (m_options.m_arch.IsValid())
- arch = m_options.m_arch;
- else
- {
- arch = lldb_private::GetDefaultArchitecture ();
- if (!arch.IsValid())
- arch = LLDB_ARCH_DEFAULT;
- }
+ ArchSpec arch = m_options.m_arch;
Debugger &debugger = interpreter.GetDebugger();
- Error error = debugger.GetTargetList().CreateTarget (debugger, file_spec, arch, NULL, true, target_sp);
-
- if (error.Fail() && !m_options.m_arch.IsValid())
- {
- if (arch == LLDB_ARCH_DEFAULT_32BIT)
- arch = LLDB_ARCH_DEFAULT_64BIT;
- else
- arch = LLDB_ARCH_DEFAULT_32BIT;
- error = debugger.GetTargetList().CreateTarget (debugger, file_spec, arch, NULL, true, target_sp);
- }
+ Error error = debugger.GetTargetList().CreateTarget (debugger, file_spec, m_options.m_arch, NULL, true, target_sp);
if (target_sp)
{
debugger.GetTargetList().SetCurrentTarget(target_sp.get());
- result.AppendMessageWithFormat ("Current executable set to '%s' (%s).\n", file_path, arch.AsCString());
+ result.AppendMessageWithFormat ("Current executable set to '%s' (%s).\n", file_path, target_sp->GetArchitecture().AsCString());
result.SetStatus (eReturnStatusSuccessFinishNoResult);
}
else
OpenPOWER on IntegriCloud