mstorsjo wrote:
Hi Pavel!
Unfortunately, it seems like this change has broken compilation of LLDB for
mingw, on all architectures. With MSVC and clang-cl, it is broken for 32 bit
platforms, while the issue only shows up as a warning for 64 bit architectures
there.
On 64 bit mingw:
```
llvm-project/llvm/tools/lldb/tools/lldb-server/lldb-platform.cpp:277:41: error:
cast from pointer to smaller type 'int' loses information
277 |
launch_info.AppendDuplicateFileAction((int)shared_socket.GetSendableFD(),
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
llvm-project/llvm/tools/lldb/tools/lldb-server/lldb-platform.cpp:278:41: error:
cast from pointer to smaller type 'int' loses information
278 |
(int)shared_socket.GetSendableFD());
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
```
On 32 bit mingw:
```
llvm-project/llvm/tools/lldb/source/Host/windows/ProcessLauncherWindows.cpp:103:3:
error: no matching function for call to 'InitializeProcThreadAttributeList'
103 | InitializeProcThreadAttributeList(/*lpAttributeList=*/nullptr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
llvm-mingw/i686-w64-mingw32/include/processthreadsapi.h:242:29: note: candidate
function not viable: no known conversion from 'size_t *' (aka 'unsigned int *')
to 'PSIZE_T' (aka 'unsigned long *') for 4th argument
242 | WINBASEAPI WINBOOL WINAPI InitializeProcThreadAttributeList
(LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList, DWORD dwAttributeCount, DWORD
dwFlags, PSIZE_T lpSize);
| ^
~~~~~~~~~~~~~~
llvm-project/llvm/tools/lldb/source/Host/windows/ProcessLauncherWindows.cpp:111:8:
error: no matching function for call to 'InitializeProcThreadAttributeList'
111 | if (!InitializeProcThreadAttributeList(startupinfoex.lpAttributeList,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
llvm-mingw/i686-w64-mingw32/include/processthreadsapi.h:242:29: note: candidate
function not viable: no known conversion from 'size_t *' (aka 'unsigned int *')
to 'PSIZE_T' (aka 'unsigned long *') for 4th argument
242 | WINBASEAPI WINBOOL WINAPI InitializeProcThreadAttributeList
(LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList, DWORD dwAttributeCount, DWORD
dwFlags, PSIZE_T lpSize);
| ^
~~~~~~~~~~~~~~
2 errors generated.
```
On 32 bit clang-cl:
```
llvm-project\lldb\source\Host\windows\ProcessLauncherWindows.cpp(103,3): error:
no matching function for call to 'InitializeProcThreadAttributeList'
InitializeProcThreadAttributeList(/*lpAttributeList=*/nullptr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Program Files (x86)\Windows
Kits\10\\include\10.0.19041.0\\um\processthreadsapi.h(673,1): note: candidate
function not viable: no known conversion from 'size_t *' (aka 'unsigned int *')
to 'PSIZE_T' (aka 'unsigned long *') for 4th argument
InitializeProcThreadAttributeList(
^
llvm-project\lldb\source\Host\windows\ProcessLauncherWindows.cpp(111,8): error:
no matching function for call to 'InitializeProcThreadAttributeList'
if (!InitializeProcThreadAttributeList(startupinfoex.lpAttributeList,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Program Files (x86)\Windows
Kits\10\\include\10.0.19041.0\\um\processthreadsapi.h(673,1): note: candidate
function not viable: no known conversion from 'size_t *' (aka 'unsigned int *')
to 'PSIZE_T' (aka 'unsigned long *') for 4th argument
InitializeProcThreadAttributeList(
^
2 errors generated.
```
32 bit MSVC:
```
llvm-project\lldb\source\Host\windows\ProcessLauncherWindows.cpp(103): error
C2664: 'BOOL
InitializeProcThreadAttributeList(LPPROC_THREAD_ATTRIBUTE_LIST,DWORD,DWORD,PSIZE_T)':
cannot convert argument 4 from 'size_t *' to 'PSIZE_T'
llvm-project\lldb\source\Host\windows\ProcessLauncherWindows.cpp(105): note:
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style
cast or parenthesized function-style cast
C:\Program Files (x86)\Windows
Kits\10\\include\10.0.19041.0\\um\processthreadsapi.h(673): note: see
declaration of 'InitializeProcThreadAttributeList'
llvm-project\lldb\source\Host\windows\ProcessLauncherWindows.cpp(103): note:
while trying to match the argument list '(nullptr, int, int, size_t *)'
llvm-project\lldb\source\Host\windows\ProcessLauncherWindows.cpp(111): error
C2664: 'BOOL
InitializeProcThreadAttributeList(LPPROC_THREAD_ATTRIBUTE_LIST,DWORD,DWORD,PSIZE_T)':
cannot convert argument 4 from 'size_t *' to 'PSIZE_T'
llvm-project\lldb\source\Host\windows\ProcessLauncherWindows.cpp(113): note:
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style
cast or parenthesized function-style cast
C:\Program Files (x86)\Windows
Kits\10\\include\10.0.19041.0\\um\processthreadsapi.h(673): note: see
declaration of 'InitializeProcThreadAttributeList'
llvm-project\lldb\source\Host\windows\ProcessLauncherWindows.cpp(111): note:
while trying to match the argument list '(LPPROC_THREAD_ATTRIBUTE_LIST, int,
int, size_t *)'
ninja: build stopped: cannot make progress due to previous errors.
```
On 64 bit clang-cl, it is only a warning:
```
llvm-project\lldb\source\Plugins\Process\gdb-remote\GDBRemoteCommunication.cpp(927,43):
warning: cast to smaller integer type 'int' from 'void *'
[-Wvoid-pointer-to-int-cast]
launch_info.AppendDuplicateFileAction((int)pass_comm_fd, (int)pass_comm_fd);
^~~~~~~~~~~~~~~~~
llvm-project\lldb\source\Plugins\Process\gdb-remote\GDBRemoteCommunication.cpp(927,62):
warning: cast to smaller integer type 'int' from 'void *'
[-Wvoid-pointer-to-int-cast]
launch_info.AppendDuplicateFileAction((int)pass_comm_fd, (int)pass_comm_fd);
^~~~~~~~~~~~~~~~~
2 warnings generated.
llvm-project\lldb\tools\lldb-server\lldb-platform.cpp(277,41): warning: cast to
smaller integer type 'int' from 'void *' [-Wvoid-pointer-to-int-cast]
launch_info.AppendDuplicateFileAction((int)shared_socket.GetSendableFD(),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
llvm-project\lldb\tools\lldb-server\lldb-platform.cpp(278,41): warning: cast to
smaller integer type 'int' from 'void *' [-Wvoid-pointer-to-int-cast]
(int)shared_socket.GetSendableFD());
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
```
And the same for 64 bit MSVC:
```
llvm-project\lldb\source\Plugins\Process\gdb-remote\GDBRemoteCommunication.cpp(927):
warning C4311: 'type cast': pointer truncation from
'lldb_private::shared_fd_t' to 'int'
llvm-project\lldb\source\Plugins\Process\gdb-remote\GDBRemoteCommunication.cpp(927):
warning C4302: 'type cast': truncation from 'lldb_private::shared_fd_t' to
'int'
llvm-project\lldb\source\Plugins\Process\gdb-remote\GDBRemoteCommunication.cpp(927):
warning C4311: 'type cast': pointer truncation from
'lldb_private::shared_fd_t' to 'int'
llvm-project\lldb\source\Plugins\Process\gdb-remote\GDBRemoteCommunication.cpp(927):
warning C4302: 'type cast': truncation from 'lldb_private::shared_fd_t' to
'int'
llvm-project\lldb\tools\lldb-server\lldb-platform.cpp(277): warning C4311:
'type cast': pointer truncation from 'lldb_private::shared_fd_t' to 'int'
llvm-project\lldb\tools\lldb-server\lldb-platform.cpp(277): warning C4302:
'type cast': truncation from 'lldb_private::shared_fd_t' to 'int'
llvm-project\lldb\tools\lldb-server\lldb-platform.cpp(278): warning C4311:
'type cast': pointer truncation from 'lldb_private::shared_fd_t' to 'int'
llvm-project\lldb\tools\lldb-server\lldb-platform.cpp(278): warning C4302:
'type cast': truncation from 'lldb_private::shared_fd_t' to 'int'
```
https://github.com/llvm/llvm-project/pull/138896
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits