diff options
author | Konrad Kleine <kkleine@redhat.com> | 2019-05-23 15:17:39 +0000 |
---|---|---|
committer | Konrad Kleine <kkleine@redhat.com> | 2019-05-23 15:17:39 +0000 |
commit | 85200645c6e86fb684b6e10eb8193f460e31c18d (patch) | |
tree | 7fd6b1dc70ecfb19be52b6ded4394bd857c9e8fe /lldb/source/Plugins/Process/Windows/Common/DebuggerThread.cpp | |
parent | c63b37dd408eb49ed056e97e50a275026b2545b9 (diff) | |
download | bcm5719-llvm-85200645c6e86fb684b6e10eb8193f460e31c18d.tar.gz bcm5719-llvm-85200645c6e86fb684b6e10eb8193f460e31c18d.zip |
[lldb] fix cannot convert from 'nullptr' to 'lldb::thread_result_t'
Summary:
On Windows `lldb::thread_result_t` resolves to `typedef unsigned thread_result_t;` and on other platforms it resolves to `typedef void *thread_result_t;`.
Therefore one cannot use `nullptr` when returning from a function that returns `thread_result_t`.
I've made this change because a windows build bot fails with these errors:
```
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Communication.cpp(362): error C2440: 'return': cannot convert from 'nullptr' to 'lldb::thread_result_t'
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Communication.cpp(362): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
```
and
```
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Debugger.cpp(1619): error C2440: 'return': cannot convert from 'nullptr' to 'lldb::thread_result_t'
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Debugger.cpp(1619): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Debugger.cpp(1664): error C2440: 'return': cannot convert from 'nullptr' to 'lldb::thread_result_t'
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Debugger.cpp(1664): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
```
This is the failing build: http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/5035/steps/build/logs/stdio
Reviewers: JDevlieghere, teemperor, jankratochvil, labath, clayborg, RKSimon, courbet, jhenderson
Reviewed By: labath, clayborg
Subscribers: labath, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D62305
llvm-svn: 361503
Diffstat (limited to 'lldb/source/Plugins/Process/Windows/Common/DebuggerThread.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/Windows/Common/DebuggerThread.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.cpp b/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.cpp index ad7feaa2d37..104ac229f2f 100644 --- a/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.cpp @@ -132,7 +132,7 @@ lldb::thread_result_t DebuggerThread::DebuggerThreadLaunchRoutine( else m_debug_delegate->OnDebuggerError(error, 0); - return 0; + return {}; } lldb::thread_result_t DebuggerThread::DebuggerThreadAttachRoutine( @@ -148,7 +148,7 @@ lldb::thread_result_t DebuggerThread::DebuggerThreadAttachRoutine( if (!DebugActiveProcess((DWORD)pid)) { Status error(::GetLastError(), eErrorTypeWin32); m_debug_delegate->OnDebuggerError(error, 0); - return 0; + return {}; } // The attach was successful, enter the debug loop. From here on out, this @@ -156,7 +156,7 @@ lldb::thread_result_t DebuggerThread::DebuggerThreadAttachRoutine( // in DebugLaunch should apply from this point out. DebugLoop(); - return 0; + return {}; } Status DebuggerThread::StopDebugging(bool terminate) { |