| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
| 7 | 7 |
| 8 #include <errno.h> // NOLINT | 8 #include <errno.h> // NOLINT |
| 9 #include <stdio.h> // NOLINT | 9 #include <stdio.h> // NOLINT |
| 10 #include <stdlib.h> // NOLINT | 10 #include <stdlib.h> // NOLINT |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 int DebuggerConnectionImpl::epoll_fd_ = -1; | 23 int DebuggerConnectionImpl::epoll_fd_ = -1; |
| 24 int DebuggerConnectionImpl::wakeup_fds_[2] = {-1, -1}; | 24 int DebuggerConnectionImpl::wakeup_fds_[2] = {-1, -1}; |
| 25 | 25 |
| 26 | 26 |
| 27 void DebuggerConnectionImpl::HandleEvent(struct epoll_event* event) { | 27 void DebuggerConnectionImpl::HandleEvent(struct epoll_event* event) { |
| 28 if (event->data.fd == DebuggerConnectionHandler::listener_fd_) { | 28 if (event->data.fd == DebuggerConnectionHandler::listener_fd_) { |
| 29 if (DebuggerConnectionHandler::IsConnected()) { | 29 if (DebuggerConnectionHandler::IsConnected()) { |
| 30 FATAL("Cannot connect to more than one debugger.\n"); | 30 FATAL("Cannot connect to more than one debugger.\n"); |
| 31 } | 31 } |
| 32 int fd = ServerSocket::Accept(event->data.fd); | 32 intptr_t fd = ServerSocket::Accept(event->data.fd); |
| 33 if (fd < 0) { | 33 if (fd < 0) { |
| 34 FATAL("Accepting new debugger connection failed.\n"); | 34 FATAL("Accepting new debugger connection failed.\n"); |
| 35 } | 35 } |
| 36 FDUtils::SetBlocking(fd); | 36 FDUtils::SetBlocking(fd); |
| 37 DebuggerConnectionHandler::AcceptDbgConnection(fd); | 37 DebuggerConnectionHandler::AcceptDbgConnection(fd); |
| 38 // TODO(hausner): add the debugger wire socket fd to the event poll queue | 38 // TODO(hausner): add the debugger wire socket fd to the event poll queue |
| 39 // once we poll the debugger connection. | 39 // once we poll the debugger connection. |
| 40 } else if (event->data.fd == wakeup_fds_[0]) { | 40 } else if (event->data.fd == wakeup_fds_[0]) { |
| 41 // Sync message. Not yet implemented. | 41 // Sync message. Not yet implemented. |
| 42 UNIMPLEMENTED(); | 42 UNIMPLEMENTED(); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 | 122 |
| 123 intptr_t DebuggerConnectionImpl::Receive(intptr_t socket, char* buf, int len) { | 123 intptr_t DebuggerConnectionImpl::Receive(intptr_t socket, char* buf, int len) { |
| 124 return TEMP_FAILURE_RETRY(read(socket, buf, len)); | 124 return TEMP_FAILURE_RETRY(read(socket, buf, len)); |
| 125 } | 125 } |
| 126 | 126 |
| 127 } // namespace bin | 127 } // namespace bin |
| 128 } // namespace dart | 128 } // namespace dart |
| 129 | 129 |
| 130 #endif // defined(TARGET_OS_LINUX) | 130 #endif // defined(TARGET_OS_LINUX) |
| OLD | NEW |