summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target
diff options
context:
space:
mode:
authorAidan Dodds <aidan@codeplay.com>2015-05-08 09:36:31 +0000
committerAidan Dodds <aidan@codeplay.com>2015-05-08 09:36:31 +0000
commitc0c838516d9d89330c6498c983b770a7e4ea1e1b (patch)
tree315d5f18ddd29d9e6a937b94e94f8f67101f7179 /lldb/source/Target
parent3a6cc51cb90cba16c4485412b71964c89dcb8cd4 (diff)
downloadbcm5719-llvm-c0c838516d9d89330c6498c983b770a7e4ea1e1b.tar.gz
bcm5719-llvm-c0c838516d9d89330c6498c983b770a7e4ea1e1b.zip
This patch allows LLDB to use the $qXfer:Libraries: packet.
Differential Revision: http://reviews.llvm.org/D9471 llvm-svn: 236817
Diffstat (limited to 'lldb/source/Target')
-rw-r--r--lldb/source/Target/Target.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index c2829a6151c..9b794ab6562 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -1057,13 +1057,24 @@ Target::IgnoreWatchpointByID (lldb::watch_id_t watch_id, uint32_t ignore_count)
ModuleSP
Target::GetExecutableModule ()
{
- return m_images.GetModuleAtIndex(0);
+ // search for the first executable in the module list
+ for (size_t i = 0; i < m_images.GetSize(); ++i)
+ {
+ ModuleSP module_sp = m_images.GetModuleAtIndex (i);
+ lldb_private::ObjectFile * obj = module_sp->GetObjectFile();
+ if (obj == nullptr)
+ continue;
+ if (obj->GetType() == ObjectFile::Type::eTypeExecutable)
+ return module_sp;
+ }
+ // as fall back return the first module loaded
+ return m_images.GetModuleAtIndex (0);
}
Module*
Target::GetExecutableModulePointer ()
{
- return m_images.GetModulePointerAtIndex(0);
+ return GetExecutableModule().get();
}
static void
OpenPOWER on IntegriCloud