Add fd-forwarding transport lib
dt_fd_forward is a jdwpTransport that takes as an address a local
socket file-descriptor and uses it to allow some other piece of code
or program to control the actual attach and communication process.
tools/dt_fds_forward.py is a python program that can be used as a
controller for this comms system. This is useful for testing. It
implements the same behavior (excepting DDMS) that the adbconnection
plugin will but is capable of being easily used on normal host
machines. Unlike the plugin, dt_fds_forward.py works by allowing a
socket file-descriptor to be inherited by the forked Java Language
Runtime.
The overall goal of this transport is to use it to allow us to safely
multiplex the out-bound data with DDMS data. This is needed to let us
match current DDMS behavior which transmits packets in the blind on
the same channel JDWP traffic is sent on.
Test: ./tools/dt_fds_forward.py \
./test/run-test --host --dev 001-HelloWorld
Test: jdb -attach localhost:12345
Test: nc localhost 12345, handshake, disconnect
Test: jdb -attach localhost:12345, detach, attach
Test: ./tools/dt_fds_forward.py \
--debug-lib $JAVA_HOME/jre/lib/amd64/libjdwp.so \
-- \
./test/run-test --host --jvm --dev 001-HelloWorld
Test: jdb -attach localhost:12345
Bug: 62821960
Bug: 69169846
Change-Id: I654db6c6991c006933e1e1f0a4e41c13f795f9a8
diff --git a/dt_fd_forward/NOTICE b/dt_fd_forward/NOTICE
new file mode 100644
index 0000000..4fd88fa
--- /dev/null
+++ b/dt_fd_forward/NOTICE
@@ -0,0 +1,30 @@
+Copyright (C) 2017 The Android Open Source Project
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+This file implements interfaces from the file jdwpTransport.h. This
+implementation is licensed under the same terms as the file
+jdwpTransport.h. The copyright and license information for the file
+jdwpTransport.h follows.
+
+Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+This code is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 only, as
+published by the Free Software Foundation. Oracle designates this
+particular file as subject to the "Classpath" exception as provided
+by Oracle in the LICENSE file that accompanied this code.
+
+This code is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+version 2 for more details (a copy is included in the LICENSE file that
+accompanied this code).
+
+You should have received a copy of the GNU General Public License version
+2 along with this work; if not, write to the Free Software Foundation,
+Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+or visit www.oracle.com if you need additional information or have any
+questions.