summaryrefslogtreecommitdiffstats
path: root/runtime/jdwp/jdwp_main.cc
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2013-07-19 00:24:00 -0700
committerBrian Carlstrom <bdc@google.com>2013-07-19 00:24:00 -0700
commitf52935278fca8c7aa220543eef4544e3d1105d91 (patch)
tree16f1882fc07c3a8a7dcd271919bb3a7823ebc520 /runtime/jdwp/jdwp_main.cc
parent05eecea70b64095db2bc5f9f8aef7475964a9d7b (diff)
downloadart-f52935278fca8c7aa220543eef4544e3d1105d91.zip
art-f52935278fca8c7aa220543eef4544e3d1105d91.tar.gz
art-f52935278fca8c7aa220543eef4544e3d1105d91.tar.bz2
Move JDWP to std::vector<iovec> to remove runtime/arrays warning
Change-Id: I8494a25a65de4ebac2b1f4f41c0f5eedf117b7ac
Diffstat (limited to 'runtime/jdwp/jdwp_main.cc')
-rw-r--r--runtime/jdwp/jdwp_main.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/runtime/jdwp/jdwp_main.cc b/runtime/jdwp/jdwp_main.cc
index 3b6dd81..790bcb5 100644
--- a/runtime/jdwp/jdwp_main.cc
+++ b/runtime/jdwp/jdwp_main.cc
@@ -132,16 +132,16 @@ ssize_t JdwpNetStateBase::WritePacket(ExpandBuf* pReply) {
/*
* Write a buffered packet. Grabs a mutex to assure atomicity.
*/
-ssize_t JdwpNetStateBase::WriteBufferedPacket(const iovec* iov, int iov_count) {
+ssize_t JdwpNetStateBase::WriteBufferedPacket(const std::vector<iovec>& iov) {
MutexLock mu(Thread::Current(), socket_lock_);
- return TEMP_FAILURE_RETRY(writev(clientSock, iov, iov_count));
+ return TEMP_FAILURE_RETRY(writev(clientSock, &iov[0], iov.size()));
}
bool JdwpState::IsConnected() {
return netState != NULL && netState->IsConnected();
}
-void JdwpState::SendBufferedRequest(uint32_t type, const iovec* iov, int iov_count) {
+void JdwpState::SendBufferedRequest(uint32_t type, const std::vector<iovec>& iov) {
if (netState->clientSock < 0) {
// Can happen with some DDMS events.
VLOG(jdwp) << "Not sending JDWP packet: no debugger attached!";
@@ -149,12 +149,12 @@ void JdwpState::SendBufferedRequest(uint32_t type, const iovec* iov, int iov_cou
}
size_t expected = 0;
- for (int i = 0; i < iov_count; ++i) {
+ for (size_t i = 0; i < iov.size(); ++i) {
expected += iov[i].iov_len;
}
errno = 0;
- ssize_t actual = netState->WriteBufferedPacket(iov, iov_count);
+ ssize_t actual = netState->WriteBufferedPacket(iov);
if (static_cast<size_t>(actual) != expected) {
PLOG(ERROR) << StringPrintf("Failed to send JDWP packet %c%c%c%c to debugger (%d of %d)",
static_cast<uint8_t>(type >> 24),