diff options
author | Jim Ingham <jingham@apple.com> | 2010-08-09 23:31:02 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2010-08-09 23:31:02 +0000 |
commit | 5aee162f978eac7ffb6363d25b193e51edfbc0b1 (patch) | |
tree | affe5547d828a14a967f9b5deff564248940554b /lldb/source/Core/Module.cpp | |
parent | 394a69ed528c403248c6354baeedaf0533b33afc (diff) | |
download | bcm5719-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/Core/Module.cpp')
-rw-r--r-- | lldb/source/Core/Module.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index 9887cc96336..1e9187baf1a 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -43,7 +43,6 @@ Module::Module(const FileSpec& file_spec, const ArchSpec& arch, const ConstStrin m_object_name.IsEmpty() ? "" : "(", m_object_name.IsEmpty() ? "" : m_object_name.AsCString(""), m_object_name.IsEmpty() ? "" : ")"); - } Module::~Module() @@ -516,3 +515,30 @@ Module::GetModificationTime () const { return m_mod_time; } + +bool +Module::IsExecutable () +{ + if (GetObjectFile() == NULL) + return false; + else + return GetObjectFile()->IsExecutable(); +} + +bool +Module::SetArchitecture (const ArchSpec &new_arch) +{ + if (m_arch == new_arch) + return true; + else if (!m_arch.IsValid()) + { + m_arch = new_arch; + return true; + } + else + { + return false; + } + +} + |