Dan Albert | db6fe64 | 2015-03-19 15:21:08 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 17 | #if !ADB_HOST |
Dan Albert | db6fe64 | 2015-03-19 15:21:08 -0700 | [diff] [blame] | 18 | |
Yabin Cui | 19bec5b | 2015-09-22 15:52:57 -0700 | [diff] [blame] | 19 | #define TRACE_TAG JDWP |
Dan Albert | db6fe64 | 2015-03-19 15:21:08 -0700 | [diff] [blame] | 20 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 21 | #include "sysdeps.h" |
Dan Albert | db6fe64 | 2015-03-19 15:21:08 -0700 | [diff] [blame] | 22 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 23 | #include <errno.h> |
| 24 | #include <stdio.h> |
Elliott Hughes | 43df109 | 2015-07-23 17:12:58 -0700 | [diff] [blame] | 25 | #include <stdlib.h> |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 26 | #include <string.h> |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 27 | #include <sys/socket.h> |
| 28 | #include <sys/un.h> |
Teddie Stenvi | f56e7f5 | 2010-02-15 12:20:44 +0100 | [diff] [blame] | 29 | #include <unistd.h> |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 30 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 31 | #include <list> |
| 32 | #include <memory> |
| 33 | #include <vector> |
| 34 | |
Dan Albert | db6fe64 | 2015-03-19 15:21:08 -0700 | [diff] [blame] | 35 | #include "adb.h" |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 36 | #include "adb_io.h" |
Josh Gao | ea7457b | 2016-08-30 15:39:25 -0700 | [diff] [blame] | 37 | #include "adb_unique_fd.h" |
Yabin Cui | 5fc2231 | 2015-10-06 15:10:05 -0700 | [diff] [blame] | 38 | #include "adb_utils.h" |
Dan Albert | db6fe64 | 2015-03-19 15:21:08 -0700 | [diff] [blame] | 39 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 40 | /* here's how these things work. |
| 41 | |
| 42 | when adbd starts, it creates a unix server socket |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 43 | named @jdwp-control (@ is a shortcut for "first byte is zero" |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 44 | to use the private namespace instead of the file system) |
| 45 | |
| 46 | when a new JDWP daemon thread starts in a new VM process, it creates |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 47 | a connection to @jdwp-control to announce its availability. |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 48 | |
| 49 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 50 | JDWP thread @jdwp-control |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 51 | | | |
| 52 | |-------------------------------> | |
| 53 | | hello I'm in process <pid> | |
| 54 | | | |
| 55 | | | |
| 56 | |
| 57 | the connection is kept alive. it will be closed automatically if |
| 58 | the JDWP process terminates (this allows adbd to detect dead |
| 59 | processes). |
| 60 | |
| 61 | adbd thus maintains a list of "active" JDWP processes. it can send |
| 62 | its content to clients through the "device:debug-ports" service, |
| 63 | or even updates through the "device:track-debug-ports" service. |
| 64 | |
| 65 | when a debugger wants to connect, it simply runs the command |
| 66 | equivalent to "adb forward tcp:<hostport> jdwp:<pid>" |
| 67 | |
| 68 | "jdwp:<pid>" is a new forward destination format used to target |
| 69 | a given JDWP process on the device. when sutch a request arrives, |
| 70 | adbd does the following: |
| 71 | |
| 72 | - first, it calls socketpair() to create a pair of equivalent |
| 73 | sockets. |
| 74 | |
| 75 | - it attaches the first socket in the pair to a local socket |
| 76 | which is itself attached to the transport's remote socket: |
| 77 | |
| 78 | |
| 79 | - it sends the file descriptor of the second socket directly |
| 80 | to the JDWP process with the help of sendmsg() |
| 81 | |
| 82 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 83 | JDWP thread @jdwp-control |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 84 | | | |
| 85 | | <----------------------| |
| 86 | | OK, try this file descriptor | |
| 87 | | | |
| 88 | | | |
| 89 | |
| 90 | then, the JDWP thread uses this new socket descriptor as its |
| 91 | pass-through connection to the debugger (and receives the |
| 92 | JDWP-Handshake message, answers to it, etc...) |
| 93 | |
| 94 | this gives the following graphics: |
| 95 | ____________________________________ |
| 96 | | | |
| 97 | | ADB Server (host) | |
| 98 | | | |
| 99 | Debugger <---> LocalSocket <----> RemoteSocket | |
| 100 | | ^^ | |
| 101 | |___________________________||_______| |
| 102 | || |
| 103 | Transport || |
| 104 | (TCP for emulator - USB for device) || |
| 105 | || |
| 106 | ___________________________||_______ |
| 107 | | || | |
| 108 | | ADBD (device) || | |
| 109 | | VV | |
| 110 | JDWP <======> LocalSocket <----> RemoteSocket | |
| 111 | | | |
| 112 | |____________________________________| |
| 113 | |
| 114 | due to the way adb works, this doesn't need a special socket |
| 115 | type or fancy handling of socket termination if either the debugger |
| 116 | or the JDWP process closes the connection. |
| 117 | |
| 118 | THIS IS THE SIMPLEST IMPLEMENTATION I COULD FIND, IF YOU HAPPEN |
| 119 | TO HAVE A BETTER IDEA, LET ME KNOW - Digit |
| 120 | |
| 121 | **********************************************************************/ |
| 122 | |
| 123 | /** JDWP PID List Support Code |
| 124 | ** for each JDWP process, we record its pid and its connected socket |
| 125 | **/ |
| 126 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 127 | // PIDs are transmitted as 4 hex digits in ascii. |
| 128 | static constexpr size_t PID_LEN = 4; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 129 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 130 | static void jdwp_process_event(int socket, unsigned events, void* _proc); |
| 131 | static void jdwp_process_list_updated(void); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 132 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 133 | struct JdwpProcess; |
| 134 | static std::list<std::unique_ptr<JdwpProcess>> _jdwp_list; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 135 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 136 | struct JdwpProcess { |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 137 | explicit JdwpProcess(int socket) { |
| 138 | this->socket = socket; |
| 139 | this->fde = fdevent_create(socket, jdwp_process_event, this); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 140 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 141 | if (!this->fde) { |
| 142 | fatal("could not create fdevent for new JDWP process"); |
| 143 | } |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 144 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 145 | this->fde->state |= FDE_DONT_CLOSE; |
| 146 | |
| 147 | /* start by waiting for the PID */ |
| 148 | fdevent_add(this->fde, FDE_READ); |
| 149 | } |
| 150 | |
| 151 | ~JdwpProcess() { |
| 152 | if (this->socket >= 0) { |
| 153 | adb_shutdown(this->socket); |
| 154 | adb_close(this->socket); |
| 155 | this->socket = -1; |
| 156 | } |
| 157 | |
| 158 | if (this->fde) { |
| 159 | fdevent_destroy(this->fde); |
| 160 | this->fde = nullptr; |
| 161 | } |
| 162 | |
| 163 | out_fds.clear(); |
| 164 | } |
| 165 | |
| 166 | void RemoveFromList() { |
| 167 | if (this->pid >= 0) { |
| 168 | D("removing pid %d from jdwp process list", this->pid); |
| 169 | } else { |
| 170 | D("removing transient JdwpProcess from list"); |
| 171 | } |
| 172 | |
| 173 | auto pred = [this](const auto& proc) { return proc.get() == this; }; |
| 174 | _jdwp_list.remove_if(pred); |
| 175 | } |
| 176 | |
| 177 | int pid = -1; |
| 178 | int socket = -1; |
| 179 | fdevent* fde = nullptr; |
| 180 | |
| 181 | std::vector<unique_fd> out_fds; |
| 182 | char in_buf[PID_LEN + 1]; |
| 183 | ssize_t in_len = 0; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 184 | }; |
| 185 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 186 | static size_t jdwp_process_list(char* buffer, size_t bufferlen) { |
| 187 | std::string temp; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 188 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 189 | for (auto& proc : _jdwp_list) { |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 190 | /* skip transient connections */ |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 191 | if (proc->pid < 0) { |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 192 | continue; |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 193 | } |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 194 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 195 | std::string next = std::to_string(proc->pid) + "\n"; |
| 196 | if (temp.length() + next.length() > bufferlen) { |
| 197 | D("truncating JDWP process list (max len = %zu)", bufferlen); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 198 | break; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 199 | } |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 200 | temp.append(next); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 201 | } |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 202 | |
| 203 | memcpy(buffer, temp.data(), temp.length()); |
| 204 | return temp.length(); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 205 | } |
| 206 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 207 | static size_t jdwp_process_list_msg(char* buffer, size_t bufferlen) { |
| 208 | // Message is length-prefixed with 4 hex digits in ASCII. |
| 209 | static constexpr size_t header_len = 4; |
| 210 | if (bufferlen < header_len) { |
| 211 | fatal("invalid JDWP process list buffer size: %zu", bufferlen); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 212 | } |
| 213 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 214 | char head[header_len + 1]; |
| 215 | size_t len = jdwp_process_list(buffer + header_len, bufferlen - header_len); |
| 216 | snprintf(head, sizeof head, "%04zx", len); |
| 217 | memcpy(buffer, head, header_len); |
| 218 | return len + header_len; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 219 | } |
| 220 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 221 | static void jdwp_process_event(int socket, unsigned events, void* _proc) { |
| 222 | JdwpProcess* proc = reinterpret_cast<JdwpProcess*>(_proc); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 223 | |
| 224 | if (events & FDE_READ) { |
| 225 | if (proc->pid < 0) { |
| 226 | /* read the PID as a 4-hexchar string */ |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 227 | if (proc->in_len < 0) { |
| 228 | fatal("attempting to read JDWP pid again?"); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 229 | } |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 230 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 231 | char* p = proc->in_buf + proc->in_len; |
| 232 | size_t size = PID_LEN - proc->in_len; |
| 233 | |
| 234 | ssize_t rc = TEMP_FAILURE_RETRY(recv(socket, p, size, 0)); |
| 235 | if (rc < 0) { |
| 236 | if (errno == EAGAIN) { |
| 237 | return; |
| 238 | } |
| 239 | |
| 240 | D("failed to read jdwp pid: %s", strerror(errno)); |
| 241 | goto CloseProcess; |
| 242 | } |
| 243 | |
| 244 | proc->in_len += rc; |
| 245 | if (proc->in_len != PID_LEN) { |
| 246 | return; |
| 247 | } |
| 248 | |
| 249 | proc->in_buf[PID_LEN] = '\0'; |
| 250 | proc->in_len = -1; |
| 251 | |
| 252 | if (sscanf(proc->in_buf, "%04x", &proc->pid) != 1) { |
| 253 | D("could not decode JDWP %p PID number: '%s'", proc, p); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 254 | goto CloseProcess; |
| 255 | } |
| 256 | |
| 257 | /* all is well, keep reading to detect connection closure */ |
Yabin Cui | 815ad88 | 2015-09-02 17:44:28 -0700 | [diff] [blame] | 258 | D("Adding pid %d to jdwp process list", proc->pid); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 259 | jdwp_process_list_updated(); |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 260 | } else { |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 261 | /* the pid was read, if we get there it's probably because the connection |
| 262 | * was closed (e.g. the JDWP process exited or crashed) */ |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 263 | char buf[32]; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 264 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 265 | while (true) { |
| 266 | int len = TEMP_FAILURE_RETRY(recv(socket, buf, sizeof(buf), 0)); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 267 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 268 | if (len == 0) { |
| 269 | D("terminating JDWP %d connection: EOF", proc->pid); |
| 270 | break; |
| 271 | } else if (len < 0) { |
| 272 | if (len < 0 && errno == EAGAIN) { |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 273 | return; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 274 | } |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 275 | |
| 276 | D("terminating JDWP %d connection: EOF", proc->pid); |
| 277 | break; |
| 278 | } else { |
| 279 | D("ignoring unexpected JDWP %d control socket activity (%d bytes)", proc->pid, |
| 280 | len); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 281 | } |
| 282 | } |
| 283 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 284 | goto CloseProcess; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 285 | } |
| 286 | } |
| 287 | |
| 288 | if (events & FDE_WRITE) { |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 289 | D("trying to send fd to JDWP process (count = %zu)", proc->out_fds.size()); |
| 290 | if (!proc->out_fds.empty()) { |
| 291 | int fd = proc->out_fds.back().get(); |
| 292 | struct cmsghdr* cmsg; |
| 293 | struct msghdr msg; |
| 294 | struct iovec iov; |
| 295 | char dummy = '!'; |
| 296 | char buffer[sizeof(struct cmsghdr) + sizeof(int)]; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 297 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 298 | iov.iov_base = &dummy; |
| 299 | iov.iov_len = 1; |
| 300 | msg.msg_name = NULL; |
| 301 | msg.msg_namelen = 0; |
| 302 | msg.msg_iov = &iov; |
| 303 | msg.msg_iovlen = 1; |
| 304 | msg.msg_flags = 0; |
| 305 | msg.msg_control = buffer; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 306 | msg.msg_controllen = sizeof(buffer); |
| 307 | |
| 308 | cmsg = CMSG_FIRSTHDR(&msg); |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 309 | cmsg->cmsg_len = msg.msg_controllen; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 310 | cmsg->cmsg_level = SOL_SOCKET; |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 311 | cmsg->cmsg_type = SCM_RIGHTS; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 312 | ((int*)CMSG_DATA(cmsg))[0] = fd; |
| 313 | |
Yabin Cui | 5fc2231 | 2015-10-06 15:10:05 -0700 | [diff] [blame] | 314 | if (!set_file_block_mode(proc->socket, true)) { |
| 315 | VLOG(JDWP) << "failed to set blocking mode for fd " << proc->socket; |
Teddie Stenvi | f56e7f5 | 2010-02-15 12:20:44 +0100 | [diff] [blame] | 316 | goto CloseProcess; |
| 317 | } |
| 318 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 319 | int ret = TEMP_FAILURE_RETRY(sendmsg(proc->socket, &msg, 0)); |
| 320 | if (ret < 0) { |
| 321 | D("sending new file descriptor to JDWP %d failed: %s", proc->pid, strerror(errno)); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 322 | goto CloseProcess; |
| 323 | } |
| 324 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 325 | adb_close(fd); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 326 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 327 | D("sent file descriptor %d to JDWP process %d", fd, proc->pid); |
| 328 | |
| 329 | proc->out_fds.pop_back(); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 330 | |
Yabin Cui | 5fc2231 | 2015-10-06 15:10:05 -0700 | [diff] [blame] | 331 | if (!set_file_block_mode(proc->socket, false)) { |
| 332 | VLOG(JDWP) << "failed to set non-blocking mode for fd " << proc->socket; |
Teddie Stenvi | f56e7f5 | 2010-02-15 12:20:44 +0100 | [diff] [blame] | 333 | goto CloseProcess; |
| 334 | } |
| 335 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 336 | if (proc->out_fds.empty()) { |
| 337 | fdevent_del(proc->fde, FDE_WRITE); |
| 338 | } |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 339 | } |
| 340 | } |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 341 | |
| 342 | return; |
| 343 | |
| 344 | CloseProcess: |
| 345 | proc->RemoveFromList(); |
| 346 | jdwp_process_list_updated(); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 347 | } |
| 348 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 349 | int create_jdwp_connection_fd(int pid) { |
Yabin Cui | 815ad88 | 2015-09-02 17:44:28 -0700 | [diff] [blame] | 350 | D("looking for pid %d in JDWP process list", pid); |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 351 | |
| 352 | for (auto& proc : _jdwp_list) { |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 353 | if (proc->pid == pid) { |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 354 | int fds[2]; |
| 355 | |
| 356 | if (adb_socketpair(fds) < 0) { |
| 357 | D("%s: socket pair creation failed: %s", __FUNCTION__, strerror(errno)); |
| 358 | return -1; |
| 359 | } |
| 360 | D("socketpair: (%d,%d)", fds[0], fds[1]); |
| 361 | |
| 362 | proc->out_fds.emplace_back(fds[1]); |
| 363 | if (proc->out_fds.size() == 1) { |
| 364 | fdevent_add(proc->fde, FDE_WRITE); |
| 365 | } |
| 366 | |
| 367 | return fds[0]; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 368 | } |
| 369 | } |
Yabin Cui | 815ad88 | 2015-09-02 17:44:28 -0700 | [diff] [blame] | 370 | D("search failed !!"); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 371 | return -1; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 372 | } |
| 373 | |
| 374 | /** VM DEBUG CONTROL SOCKET |
| 375 | ** |
| 376 | ** we do implement a custom asocket to receive the data |
| 377 | **/ |
| 378 | |
| 379 | /* name of the debug control Unix socket */ |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 380 | #define JDWP_CONTROL_NAME "\0jdwp-control" |
| 381 | #define JDWP_CONTROL_NAME_LEN (sizeof(JDWP_CONTROL_NAME) - 1) |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 382 | |
Elliott Hughes | fe7ff81 | 2015-04-17 09:47:42 -0700 | [diff] [blame] | 383 | struct JdwpControl { |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 384 | int listen_socket; |
| 385 | fdevent* fde; |
Elliott Hughes | fe7ff81 | 2015-04-17 09:47:42 -0700 | [diff] [blame] | 386 | }; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 387 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 388 | static JdwpControl _jdwp_control; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 389 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 390 | static void jdwp_control_event(int s, unsigned events, void* user); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 391 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 392 | static int jdwp_control_init(JdwpControl* control, const char* sockname, int socknamelen) { |
| 393 | sockaddr_un addr; |
| 394 | socklen_t addrlen; |
| 395 | int s; |
| 396 | int maxpath = sizeof(addr.sun_path); |
| 397 | int pathlen = socknamelen; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 398 | |
| 399 | if (pathlen >= maxpath) { |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 400 | D("vm debug control socket name too long (%d extra chars)", pathlen + 1 - maxpath); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 401 | return -1; |
| 402 | } |
| 403 | |
| 404 | memset(&addr, 0, sizeof(addr)); |
| 405 | addr.sun_family = AF_UNIX; |
| 406 | memcpy(addr.sun_path, sockname, socknamelen); |
| 407 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 408 | s = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 409 | if (s < 0) { |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 410 | D("could not create vm debug control socket. %d: %s", errno, strerror(errno)); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 411 | return -1; |
| 412 | } |
| 413 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 414 | addrlen = pathlen + sizeof(addr.sun_family); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 415 | |
Erik Kline | 3c8d44d | 2015-12-01 17:27:59 +0900 | [diff] [blame] | 416 | if (bind(s, reinterpret_cast<sockaddr*>(&addr), addrlen) < 0) { |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 417 | D("could not bind vm debug control socket: %d: %s", errno, strerror(errno)); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 418 | adb_close(s); |
| 419 | return -1; |
| 420 | } |
| 421 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 422 | if (listen(s, 4) < 0) { |
| 423 | D("listen failed in jdwp control socket: %d: %s", errno, strerror(errno)); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 424 | adb_close(s); |
| 425 | return -1; |
| 426 | } |
| 427 | |
| 428 | control->listen_socket = s; |
| 429 | |
| 430 | control->fde = fdevent_create(s, jdwp_control_event, control); |
| 431 | if (control->fde == NULL) { |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 432 | D("could not create fdevent for jdwp control socket"); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 433 | adb_close(s); |
| 434 | return -1; |
| 435 | } |
| 436 | |
| 437 | /* only wait for incoming connections */ |
| 438 | fdevent_add(control->fde, FDE_READ); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 439 | |
Yabin Cui | 815ad88 | 2015-09-02 17:44:28 -0700 | [diff] [blame] | 440 | D("jdwp control socket started (%d)", control->listen_socket); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 441 | return 0; |
| 442 | } |
| 443 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 444 | static void jdwp_control_event(int s, unsigned events, void* _control) { |
| 445 | JdwpControl* control = (JdwpControl*)_control; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 446 | |
| 447 | if (events & FDE_READ) { |
Josh Gao | 782d8d4 | 2016-08-23 15:41:56 -0700 | [diff] [blame] | 448 | int s = adb_socket_accept(control->listen_socket, nullptr, nullptr); |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 449 | if (s < 0) { |
| 450 | if (errno == ECONNABORTED) { |
| 451 | /* oops, the JDWP process died really quick */ |
| 452 | D("oops, the JDWP process died really quick"); |
| 453 | return; |
| 454 | } else { |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 455 | /* the socket is probably closed ? */ |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 456 | D("weird accept() failed on jdwp control socket: %s", strerror(errno)); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 457 | return; |
| 458 | } |
| 459 | } |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 460 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 461 | auto proc = std::make_unique<JdwpProcess>(s); |
| 462 | if (!proc) { |
| 463 | fatal("failed to allocate JdwpProcess"); |
| 464 | } |
| 465 | |
| 466 | _jdwp_list.emplace_back(std::move(proc)); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 467 | } |
| 468 | } |
| 469 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 470 | /** "jdwp" local service implementation |
| 471 | ** this simply returns the list of known JDWP process pids |
| 472 | **/ |
| 473 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 474 | struct JdwpSocket : public asocket { |
| 475 | bool pass; |
Elliott Hughes | fe7ff81 | 2015-04-17 09:47:42 -0700 | [diff] [blame] | 476 | }; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 477 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 478 | static void jdwp_socket_close(asocket* s) { |
| 479 | D("LS(%d): closing jdwp socket", s->id); |
| 480 | |
| 481 | if (s->peer) { |
| 482 | D("LS(%d) peer->close()ing peer->id=%d peer->fd=%d", s->id, s->peer->id, s->peer->fd); |
| 483 | s->peer->peer = nullptr; |
| 484 | s->peer->close(s->peer); |
| 485 | s->peer = nullptr; |
| 486 | } |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 487 | |
| 488 | remove_socket(s); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 489 | free(s); |
| 490 | } |
| 491 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 492 | static int jdwp_socket_enqueue(asocket* s, apacket* p) { |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 493 | /* you can't write to this asocket */ |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 494 | D("LS(%d): JDWP socket received data?", s->id); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 495 | put_apacket(p); |
| 496 | s->peer->close(s->peer); |
| 497 | return -1; |
| 498 | } |
| 499 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 500 | static void jdwp_socket_ready(asocket* s) { |
| 501 | JdwpSocket* jdwp = (JdwpSocket*)s; |
| 502 | asocket* peer = jdwp->peer; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 503 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 504 | /* on the first call, send the list of pids, |
| 505 | * on the second one, close the connection |
| 506 | */ |
| 507 | if (!jdwp->pass) { |
| 508 | apacket* p = get_apacket(); |
Tamas Berghammer | a1c60c0 | 2015-07-13 19:12:28 +0100 | [diff] [blame] | 509 | p->len = jdwp_process_list((char*)p->data, s->get_max_payload()); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 510 | peer->enqueue(peer, p); |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 511 | jdwp->pass = true; |
| 512 | } else { |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 513 | peer->close(peer); |
| 514 | } |
| 515 | } |
| 516 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 517 | asocket* create_jdwp_service_socket(void) { |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 518 | JdwpSocket* s = reinterpret_cast<JdwpSocket*>(calloc(sizeof(*s), 1)); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 519 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 520 | if (!s) { |
| 521 | fatal("failed to allocate JdwpSocket"); |
| 522 | } |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 523 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 524 | install_local_socket(s); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 525 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 526 | s->ready = jdwp_socket_ready; |
| 527 | s->enqueue = jdwp_socket_enqueue; |
| 528 | s->close = jdwp_socket_close; |
| 529 | s->pass = false; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 530 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 531 | return s; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 532 | } |
| 533 | |
| 534 | /** "track-jdwp" local service implementation |
| 535 | ** this periodically sends the list of known JDWP process pids |
| 536 | ** to the client... |
| 537 | **/ |
| 538 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 539 | struct JdwpTracker : public asocket { |
| 540 | bool need_initial; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 541 | }; |
| 542 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 543 | static std::vector<std::unique_ptr<JdwpTracker>> _jdwp_trackers; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 544 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 545 | static void jdwp_process_list_updated(void) { |
| 546 | char buffer[1024]; |
| 547 | int len = jdwp_process_list_msg(buffer, sizeof(buffer)); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 548 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 549 | for (auto& t : _jdwp_trackers) { |
| 550 | apacket* p = get_apacket(); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 551 | memcpy(p->data, buffer, len); |
| 552 | p->len = len; |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 553 | |
| 554 | if (t->peer) { |
| 555 | // The tracker might not have been connected yet. |
| 556 | t->peer->enqueue(t->peer, p); |
| 557 | } |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 558 | } |
| 559 | } |
| 560 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 561 | static void jdwp_tracker_close(asocket* s) { |
| 562 | D("LS(%d): destroying jdwp tracker service", s->id); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 563 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 564 | if (s->peer) { |
| 565 | D("LS(%d) peer->close()ing peer->id=%d peer->fd=%d", s->id, s->peer->id, s->peer->fd); |
| 566 | s->peer->peer = nullptr; |
| 567 | s->peer->close(s->peer); |
| 568 | s->peer = nullptr; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 569 | } |
| 570 | |
| 571 | remove_socket(s); |
| 572 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 573 | auto pred = [s](const auto& tracker) { return tracker.get() == s; }; |
| 574 | std::remove_if(_jdwp_trackers.begin(), _jdwp_trackers.end(), pred); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 575 | } |
| 576 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 577 | static void jdwp_tracker_ready(asocket* s) { |
| 578 | JdwpTracker* t = (JdwpTracker*)s; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 579 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 580 | if (t->need_initial) { |
| 581 | apacket* p = get_apacket(); |
| 582 | t->need_initial = false; |
Tamas Berghammer | a1c60c0 | 2015-07-13 19:12:28 +0100 | [diff] [blame] | 583 | p->len = jdwp_process_list_msg((char*)p->data, s->get_max_payload()); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 584 | s->peer->enqueue(s->peer, p); |
| 585 | } |
| 586 | } |
| 587 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 588 | static int jdwp_tracker_enqueue(asocket* s, apacket* p) { |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 589 | /* you can't write to this socket */ |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 590 | D("LS(%d): JDWP tracker received data?", s->id); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 591 | put_apacket(p); |
| 592 | s->peer->close(s->peer); |
| 593 | return -1; |
| 594 | } |
| 595 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 596 | asocket* create_jdwp_tracker_service_socket(void) { |
| 597 | auto t = std::make_unique<JdwpTracker>(); |
| 598 | if (!t) { |
| 599 | fatal("failed to allocate JdwpTracker"); |
| 600 | } |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 601 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 602 | memset(t.get(), 0, sizeof(asocket)); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 603 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 604 | install_local_socket(t.get()); |
| 605 | D("LS(%d): created new jdwp tracker service", t->id); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 606 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 607 | t->ready = jdwp_tracker_ready; |
| 608 | t->enqueue = jdwp_tracker_enqueue; |
| 609 | t->close = jdwp_tracker_close; |
| 610 | t->need_initial = true; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 611 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 612 | asocket* result = t.get(); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 613 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 614 | _jdwp_trackers.emplace_back(std::move(t)); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 615 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 616 | return result; |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 617 | } |
| 618 | |
Josh Gao | 9eaf33c | 2016-05-13 15:28:34 -0700 | [diff] [blame] | 619 | int init_jdwp(void) { |
| 620 | return jdwp_control_init(&_jdwp_control, JDWP_CONTROL_NAME, JDWP_CONTROL_NAME_LEN); |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 621 | } |
| 622 | |
| 623 | #endif /* !ADB_HOST */ |