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_MACOS) | 6 #if defined(TARGET_OS_MACOS) |
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 return remaining == 0; | 69 return remaining == 0; |
70 } | 70 } |
71 | 71 |
72 | 72 |
73 void DebuggerConnectionImpl::HandleEvent(struct kevent* event) { | 73 void DebuggerConnectionImpl::HandleEvent(struct kevent* event) { |
74 int ident = event->ident; | 74 int ident = event->ident; |
75 if (ident == DebuggerConnectionHandler::listener_fd_) { | 75 if (ident == DebuggerConnectionHandler::listener_fd_) { |
76 if (DebuggerConnectionHandler::IsConnected()) { | 76 if (DebuggerConnectionHandler::IsConnected()) { |
77 FATAL("Cannot connect to more than one debugger.\n"); | 77 FATAL("Cannot connect to more than one debugger.\n"); |
78 } | 78 } |
79 int fd = ServerSocket::Accept(ident); | 79 intptr_t fd = ServerSocket::Accept(ident); |
80 if (fd < 0) { | 80 if (fd < 0) { |
81 FATAL("Accepting new debugger connection failed.\n"); | 81 FATAL("Accepting new debugger connection failed.\n"); |
82 } | 82 } |
83 FDUtils::SetBlocking(fd); | 83 FDUtils::SetBlocking(fd); |
84 DebuggerConnectionHandler::AcceptDbgConnection(fd); | 84 DebuggerConnectionHandler::AcceptDbgConnection(fd); |
85 | 85 |
86 /* For now, don't poll the debugger connection. | 86 /* For now, don't poll the debugger connection. |
87 struct kevent ev_add; | 87 struct kevent ev_add; |
88 EV_SET(&ev_add, fd, EVFILT_READ, EV_ADD, 0, 0, NULL); | 88 EV_SET(&ev_add, fd, EVFILT_READ, EV_ADD, 0, 0, NULL); |
89 int status = | 89 int status = |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 | 186 |
187 intptr_t DebuggerConnectionImpl::Receive(intptr_t socket, char* buf, int len) { | 187 intptr_t DebuggerConnectionImpl::Receive(intptr_t socket, char* buf, int len) { |
188 return TEMP_FAILURE_RETRY(read(socket, buf, len)); | 188 return TEMP_FAILURE_RETRY(read(socket, buf, len)); |
189 } | 189 } |
190 | 190 |
191 } // namespace bin | 191 } // namespace bin |
192 } // namespace dart | 192 } // namespace dart |
193 | 193 |
194 #endif // defined(TARGET_OS_MACOS) | 194 #endif // defined(TARGET_OS_MACOS) |
OLD | NEW |