diff options
author | Zachary Turner <zturner@google.com> | 2014-11-17 22:42:57 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2014-11-17 22:42:57 +0000 |
commit | c30189921e45c303d0a5b2ae26573fa7991bdfd4 (patch) | |
tree | b6e584a78101a931a597431ca0d59830a7d290dc /lldb/source/Plugins | |
parent | 5453933867feb886b3c72160dc5d0882e6417fe9 (diff) | |
download | bcm5719-llvm-c30189921e45c303d0a5b2ae26573fa7991bdfd4.tar.gz bcm5719-llvm-c30189921e45c303d0a5b2ae26573fa7991bdfd4.zip |
Change HostThread::GetNativeThread() to return a derived reference.
Previously using HostThread::GetNativeThread() required an ugly
cast to most-derived type. This solves the issue by simply returning
the derived type directly.
llvm-svn: 222185
Diffstat (limited to 'lldb/source/Plugins')
3 files changed, 5 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/Windows/DebuggerThread.cpp b/lldb/source/Plugins/Process/Windows/DebuggerThread.cpp index 2c3ca6f0bf6..c10fb79984d 100644 --- a/lldb/source/Plugins/Process/Windows/DebuggerThread.cpp +++ b/lldb/source/Plugins/Process/Windows/DebuggerThread.cpp @@ -185,7 +185,7 @@ DebuggerThread::HandleCreateProcessEvent(const CREATE_PROCESS_DEBUG_INFO &info, m_process = HostProcess(info.hProcess); ((HostProcessWindows &)m_process.GetNativeProcess()).SetOwnsHandle(false); m_main_thread = HostThread(info.hThread); - ((HostThreadWindows &)m_main_thread.GetNativeThread()).SetOwnsHandle(false); + m_main_thread.GetNativeThread().SetOwnsHandle(false); m_image_file = info.hFile; lldb::addr_t load_addr = reinterpret_cast<lldb::addr_t>(info.lpBaseOfImage); diff --git a/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp index 17083ace04a..84fd23a007d 100644 --- a/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp @@ -365,7 +365,7 @@ ProcessWindows::OnDebuggerConnected(lldb::addr_t image_base) module->SetLoadAddress(GetTarget(), image_base, false, load_addr_changed); DebuggerThreadSP debugger = m_session_data->m_debugger; - const HostThreadWindows &wmain_thread = static_cast<const HostThreadWindows &>(debugger->GetMainThread().GetNativeThread()); + const HostThreadWindows &wmain_thread = debugger->GetMainThread().GetNativeThread(); m_session_data->m_new_threads[wmain_thread.GetThreadId()] = debugger->GetMainThread(); } @@ -417,7 +417,7 @@ ProcessWindows::OnDebugException(bool first_chance, const ExceptionRecord &recor void ProcessWindows::OnCreateThread(const HostThread &new_thread) { - const HostThreadWindows &wnew_thread = static_cast<const HostThreadWindows &>(new_thread.GetNativeThread()); + const HostThreadWindows &wnew_thread = new_thread.GetNativeThread(); m_session_data->m_new_threads[wnew_thread.GetThreadId()] = new_thread; } @@ -426,7 +426,7 @@ ProcessWindows::OnExitThread(const HostThread &exited_thread) { // A thread may have started and exited before the debugger stopped allowing a refresh. // Just remove it from the new threads list in that case. - const HostThreadWindows &wexited_thread = static_cast<const HostThreadWindows &>(exited_thread.GetNativeThread()); + const HostThreadWindows &wexited_thread = exited_thread.GetNativeThread(); auto iter = m_session_data->m_new_threads.find(wexited_thread.GetThreadId()); if (iter != m_session_data->m_new_threads.end()) m_session_data->m_new_threads.erase(iter); diff --git a/lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp b/lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp index 33b5fd1973c..2ca55d73910 100644 --- a/lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp @@ -17,7 +17,7 @@ using namespace lldb; using namespace lldb_private; TargetThreadWindows::TargetThreadWindows(ProcessWindows &process, const HostThread &thread) - : Thread(process, ((HostThreadWindows &)thread.GetNativeThread()).GetThreadId()) + : Thread(process, thread.GetNativeThread().GetThreadId()) , m_host_thread(thread) { } |