summaryrefslogtreecommitdiffstats
path: root/adbconnection/adbconnection.cc
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2020-01-23 15:39:08 -0800
committerTreehugger Robot <treehugger-gerrit@google.com>2020-01-29 23:31:10 +0000
commitfc58809f7b932d86234130be15487017dc37b0cf (patch)
treed003dedec73d77473aff6b2039860bc76a69d898 /adbconnection/adbconnection.cc
parentd00f129f1b7148f01efe6e9283a72d6ec8f0edd3 (diff)
downloadplatform_art-fc58809f7b932d86234130be15487017dc37b0cf.tar.gz
platform_art-fc58809f7b932d86234130be15487017dc37b0cf.tar.bz2
platform_art-fc58809f7b932d86234130be15487017dc37b0cf.zip
Remove old JDWP implementation from ART
The old 'internal' JDWP implementation hasn't been used for a few releases and it's a lot of code that's barely being tested and is at risk of bit-rot. To simplify the runtime and remove potentially buggy code this removes it. We also needed to rewrite the DdmThreadNotification code since it relied on the suspension functionality from the old debugger and was generally unsafe. Test: ./test.py --host Test: atest --test-mapping cts/tests/jdwp/TEST_MAPPING Test: atest --test-mapping cts/hostsidetests/jdwptunnel/TEST_MAPPING Test: Manual ddms Bug: 119034743 Change-Id: I775f310a009141296b730e4a6c2503506a329481
Diffstat (limited to 'adbconnection/adbconnection.cc')
-rw-r--r--adbconnection/adbconnection.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/adbconnection/adbconnection.cc b/adbconnection/adbconnection.cc
index 2234ce4fa24..c512b0678be 100644
--- a/adbconnection/adbconnection.cc
+++ b/adbconnection/adbconnection.cc
@@ -26,6 +26,8 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/mutex.h"
+#include "base/socket_peer_is_trusted.h"
+#include "debugger.h"
#include "jni/java_vm_ext.h"
#include "jni/jni_env_ext.h"
#include "mirror/throwable.h"
@@ -35,20 +37,24 @@
#include "scoped_thread_state_change-inl.h"
#include "well_known_classes.h"
-#include "jdwp/jdwp_priv.h"
-
#include "fd_transport.h"
#include "poll.h"
#include <sys/ioctl.h>
#include <sys/socket.h>
+#include <sys/uio.h>
#include <sys/un.h>
#include <sys/eventfd.h>
#include <jni.h>
namespace adbconnection {
+static constexpr size_t kJdwpHeaderLen = 11U;
+/* DDM support */
+static constexpr uint8_t kJdwpDdmCmdSet = 199U; // 0xc7, or 'G'+128
+static constexpr uint8_t kJdwpDdmCmd = 1U;
+
// Messages sent from the transport
using dt_fd_forward::kListenStartMessage;
using dt_fd_forward::kListenEndMessage;
@@ -333,7 +339,7 @@ void AdbConnectionState::SendDdmPacket(uint32_t id,
// the adb_write_event_fd_ will ensure that the adb_connection_socket_ will not go away until
// after we have sent our data.
static constexpr uint32_t kDdmPacketHeaderSize =
- kJDWPHeaderLen // jdwp command packet size
+ kJdwpHeaderLen // jdwp command packet size
+ sizeof(uint32_t) // Type
+ sizeof(uint32_t); // length
alignas(sizeof(uint32_t)) std::array<uint8_t, kDdmPacketHeaderSize> pkt;
@@ -352,9 +358,9 @@ void AdbConnectionState::SendDdmPacket(uint32_t id,
switch (packet_type) {
case DdmPacketType::kCmd: {
// Now the cmd-set
- *(pkt_data++) = kJDWPDdmCmdSet;
+ *(pkt_data++) = kJdwpDdmCmdSet;
// Now the command
- *(pkt_data++) = kJDWPDdmCmd;
+ *(pkt_data++) = kJdwpDdmCmd;
break;
}
case DdmPacketType::kReply: {