diff options
author | Raphael Isemann <teemperor@gmail.com> | 2019-08-26 09:20:59 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2019-08-26 09:20:59 +0000 |
commit | d43d912b4bf8f4886ca375225d4ebd7d512ea7cf (patch) | |
tree | 279d0884ae86374b41a10424c99eee7dfe5bd049 /lldb/source/Core | |
parent | 0a6000f2cbb40abd008338895a471f474347b80d (diff) | |
download | bcm5719-llvm-d43d912b4bf8f4886ca375225d4ebd7d512ea7cf.tar.gz bcm5719-llvm-d43d912b4bf8f4886ca375225d4ebd7d512ea7cf.zip |
[lldb] Construct the dummy target when the first Debugger object is constructed
Summary:
We should always have a dummy target, so we might as well construct it directly when we create a Debugger object.
The idea is that if this patch doesn't cause any problems that we can get rid of all the logic
that handles situations where we don't have a dummy target (as all that code is currently
untested as there seems to be no way to have no dummy target in LLDB).
Reviewers: labath, jingham
Reviewed By: labath, jingham
Subscribers: jingham, abidh, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D66581
llvm-svn: 369885
Diffstat (limited to 'lldb/source/Core')
-rw-r--r-- | lldb/source/Core/Debugger.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index 513ea7a0d04..683ecefe097 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -721,6 +721,9 @@ Debugger::Debugger(lldb::LogOutputCallback log_callback, void *baton) assert(default_platform_sp); m_platform_list.Append(default_platform_sp, true); + m_dummy_target_sp = m_target_list.GetDummyTarget(*this); + assert(m_dummy_target_sp.get() && "Couldn't construct dummy target?"); + m_collection_sp->Initialize(g_debugger_properties); m_collection_sp->AppendProperty( ConstString("target"), @@ -1603,10 +1606,6 @@ void Debugger::JoinIOHandlerThread() { } } -Target *Debugger::GetDummyTarget() { - return m_target_list.GetDummyTarget(*this).get(); -} - Target *Debugger::GetSelectedOrDummyTarget(bool prefer_dummy) { Target *target = nullptr; if (!prefer_dummy) { |