diff --git a/BUILD b/BUILD index 71308e57..9fc7f15d 100644 --- a/BUILD +++ b/BUILD @@ -190,7 +190,6 @@ filegroup( "Headers/DebugServer2/GDBRemote/Session.h", "Headers/DebugServer2/GDBRemote/SessionBase.h", "Headers/DebugServer2/GDBRemote/SessionDelegate.h", - "Headers/DebugServer2/GDBRemote/SlaveSessionImpl.h", "Headers/DebugServer2/GDBRemote/Types.h", "Headers/DebugServer2/Host/Channel.h", "Headers/DebugServer2/Host/File.h", @@ -339,7 +338,6 @@ filegroup( "Sources/GDBRemote/ProtocolInterpreter.cpp", "Sources/GDBRemote/Session.cpp", "Sources/GDBRemote/SessionBase.cpp", - "Sources/GDBRemote/SlaveSessionImpl.cpp", "Sources/GDBRemote/Structures.cpp", "Sources/Host/Common/Channel.cpp", "Sources/Host/Common/Platform.cpp", diff --git a/CMakeLists.txt b/CMakeLists.txt index aae762d2..83c37a91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,7 +189,6 @@ add_executable(ds2 Sources/GDBRemote/ProtocolInterpreter.cpp Sources/GDBRemote/Session.cpp Sources/GDBRemote/SessionBase.cpp - Sources/GDBRemote/SlaveSessionImpl.cpp Sources/GDBRemote/Structures.cpp Sources/Host/Common/Channel.cpp diff --git a/Headers/DebugServer2/GDBRemote/SlaveSessionImpl.h b/Headers/DebugServer2/GDBRemote/SlaveSessionImpl.h deleted file mode 100644 index 9a7b1674..00000000 --- a/Headers/DebugServer2/GDBRemote/SlaveSessionImpl.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright (c) 2014-present, Facebook, Inc. -// All rights reserved. -// -// This source code is licensed under the University of Illinois/NCSA Open -// Source License found in the LICENSE file in the root directory of this -// source tree. An additional grant of patent rights can be found in the -// PATENTS file in the same directory. -// - -#pragma once - -#include "DebugServer2/GDBRemote/DebugSessionImpl.h" - -namespace ds2 { -namespace GDBRemote { - -class SlaveSessionImpl : public DebugSessionImpl { -public: - SlaveSessionImpl(); -}; -} // namespace GDBRemote -} // namespace ds2 diff --git a/Sources/GDBRemote/PlatformSessionImpl.cpp b/Sources/GDBRemote/PlatformSessionImpl.cpp index ef3c06bc..4b688d3c 100644 --- a/Sources/GDBRemote/PlatformSessionImpl.cpp +++ b/Sources/GDBRemote/PlatformSessionImpl.cpp @@ -101,7 +101,7 @@ ErrorCode PlatformSessionImplBase::onLaunchDebugServer(Session &session, StringCollection args; ps.setExecutable(Platform::GetSelfExecutablePath()); - args.push_back("slave"); + args.push_back("server"); if (GetLogLevel() == kLogLevelDebug) { args.push_back("--debug"); } else if (GetLogLevel() == kLogLevelPacket) { diff --git a/Sources/GDBRemote/SlaveSessionImpl.cpp b/Sources/GDBRemote/SlaveSessionImpl.cpp deleted file mode 100644 index 059abe3e..00000000 --- a/Sources/GDBRemote/SlaveSessionImpl.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// -// Copyright (c) 2014-present, Facebook, Inc. -// All rights reserved. -// -// This source code is licensed under the University of Illinois/NCSA Open -// Source License found in the LICENSE file in the root directory of this -// source tree. An additional grant of patent rights can be found in the -// PATENTS file in the same directory. -// - -#include "DebugServer2/GDBRemote/SlaveSessionImpl.h" - -namespace ds2 { -namespace GDBRemote { - -SlaveSessionImpl::SlaveSessionImpl() = default; -} // namespace GDBRemote -} // namespace ds2 diff --git a/Sources/Host/POSIX/ProcessSpawner.cpp b/Sources/Host/POSIX/ProcessSpawner.cpp index e7c78721..3c6ff372 100644 --- a/Sources/Host/POSIX/ProcessSpawner.cpp +++ b/Sources/Host/POSIX/ProcessSpawner.cpp @@ -34,9 +34,9 @@ namespace Host { static bool open_terminal(int fds[2]) { #if defined(OS_FREEBSD) || defined(OS_DARWIN) - char *slave; + char *device_name; #else - char slave[PATH_MAX]; + char device_name[PATH_MAX]; #endif fds[0] = ::posix_openpt(O_RDWR | O_NOCTTY); @@ -50,13 +50,13 @@ static bool open_terminal(int fds[2]) { goto error_fd0; #if defined(OS_FREEBSD) || defined(OS_DARWIN) - slave = ptsname(fds[0]); + device_name = ptsname(fds[0]); #else - if (::ptsname_r(fds[0], slave, sizeof(slave)) != 0) + if (::ptsname_r(fds[0], device_name, sizeof(device_name)) != 0) goto error_fd0; #endif - fds[1] = ::open(slave, O_RDWR); + fds[1] = ::open(device_name, O_RDWR); if (fds[1] == -1) goto error_fd0; diff --git a/Sources/main.cpp b/Sources/main.cpp index 92bd1bde..9efd1ff6 100644 --- a/Sources/main.cpp +++ b/Sources/main.cpp @@ -13,7 +13,6 @@ #include "DebugServer2/GDBRemote/DebugSessionImpl.h" #include "DebugServer2/GDBRemote/PlatformSessionImpl.h" #include "DebugServer2/GDBRemote/ProtocolHelpers.h" -#include "DebugServer2/GDBRemote/SlaveSessionImpl.h" #include "DebugServer2/Host/Platform.h" #include "DebugServer2/Host/QueueChannel.h" #include "DebugServer2/Host/Socket.h" @@ -47,7 +46,6 @@ using ds2::GDBRemote::DebugSessionImpl; using ds2::GDBRemote::PlatformSessionImpl; using ds2::GDBRemote::Session; using ds2::GDBRemote::SessionDelegate; -using ds2::GDBRemote::SlaveSessionImpl; using ds2::Host::Platform; using ds2::Host::QueueChannel; using ds2::Host::Socket; @@ -564,7 +562,7 @@ static int PlatformMain(int argc, char **argv) { } while (true); } -static int SlaveMain(int argc, char **argv) { +static int ServerMain(int argc, char **argv) { DS2ASSERT(argv[1][0] == 's'); ds2::OptParse opts; @@ -581,7 +579,7 @@ static int SlaveMain(int argc, char **argv) { } if (pid == 0) { - // When in slave mode, output is suppressed but for standard error. + // When in server mode, output is suppressed but for standard error. close(0); close(1); @@ -590,7 +588,7 @@ static int SlaveMain(int argc, char **argv) { std::unique_ptr client = server->accept(); - SlaveSessionImpl impl; + DebugSessionImpl impl; return RunDebugServer(client.get(), &impl); } else { // Write to the standard output to let our parent know @@ -667,7 +665,7 @@ int main(int argc, char **argv) { case 'p': return PlatformMain(argc, argv); case 's': - return SlaveMain(argc, argv); + return ServerMain(argc, argv); #endif case 'v': return VersionMain(argc, argv);