diff options
author | Paul Maybee <paulmay@microsoft.com> | 2023-07-29 17:23:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-08-17 14:11:33 (GMT) |
commit | 8b1257e7bf821461e6e0d92bf57e1c4ed885ddf9 (patch) | |
tree | 9ce28af2bff1b6c1d6f97f3e105849d3fe7829f4 /Tests | |
parent | b0054dd65c1d69a437abe85d27e704326884a9c2 (diff) | |
download | CMake-8b1257e7bf821461e6e0d92bf57e1c4ed885ddf9.zip CMake-8b1257e7bf821461e6e0d92bf57e1c4ed885ddf9.tar.gz CMake-8b1257e7bf821461e6e0d92bf57e1c4ed885ddf9.tar.bz2 |
Debugger: Replace libuv with platform-specific connection code
Remove libuv usage from CMake debugger. Libuv has an async io model
and cppdap uses a sync model, so an extra thread and a buffer copy
were necessary to match semantics. In order to eliminate those
costs this commit implements the IO using platform specific APIs.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLib/testDebuggerAdapterPipe.cxx | 6 | ||||
-rw-r--r-- | Tests/CMakeLib/testDebuggerNamedPipe.cxx | 9 |
2 files changed, 11 insertions, 4 deletions
diff --git a/Tests/CMakeLib/testDebuggerAdapterPipe.cxx b/Tests/CMakeLib/testDebuggerAdapterPipe.cxx index 643661d..c0f2e9b 100644 --- a/Tests/CMakeLib/testDebuggerAdapterPipe.cxx +++ b/Tests/CMakeLib/testDebuggerAdapterPipe.cxx @@ -19,13 +19,15 @@ #include <cm3p/cppdap/types.h> #include "cmDebuggerAdapter.h" -#include "cmDebuggerPipeConnection.h" #include "cmDebuggerProtocol.h" #include "cmVersionConfig.h" #ifdef _WIN32 # include "cmCryptoHash.h" +# include "cmDebuggerWindowsPipeConnection.h" # include "cmSystemTools.h" +#else +# include "cmDebuggerPosixPipeConnection.h" #endif #include "testCommon.h" @@ -128,7 +130,7 @@ bool testProtocolWithPipes() auto client2Debugger = std::make_shared<cmDebugger::cmDebuggerPipeClient>(namedPipe); - client2Debugger->Start(); + client2Debugger->WaitForConnection(); client->bind(client2Debugger, client2Debugger); diff --git a/Tests/CMakeLib/testDebuggerNamedPipe.cxx b/Tests/CMakeLib/testDebuggerNamedPipe.cxx index d2b0728..41761eb 100644 --- a/Tests/CMakeLib/testDebuggerNamedPipe.cxx +++ b/Tests/CMakeLib/testDebuggerNamedPipe.cxx @@ -16,7 +16,12 @@ #include "cmsys/RegularExpression.hxx" -#include "cmDebuggerPipeConnection.h" +#ifdef _WIN32 +# include "cmDebuggerWindowsPipeConnection.h" +#else +# include "cmDebuggerPosixPipeConnection.h" +#endif + #include "cmSystemTools.h" #ifdef _WIN32 @@ -104,7 +109,7 @@ int runTest(int argc, char* argv[]) attempt++; try { client = std::make_shared<cmDebugger::cmDebuggerPipeClient>(namedPipe); - client->Start(); + client->WaitForConnection(); std::cout << "cmDebuggerPipeClient connected.\n"; break; |