2 /// \file m_jvmdebug.cc
3 /// Mode class for the JVMDebug mode
7 Copyright (C) 2005-2013, Net Direct Inc. (http://www.netdirect.ca/)
8 Copyright (C) 2008-2009, Nicolas VIVIEN
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 See the GNU General Public License in the COPYING file at the
20 root directory of this project for more details.
24 #include "m_jvmdebug.h"
27 #include "protostructs.h"
32 #include "controller.h"
41 #include "ios_state.h"
46 using namespace Barry::Protocol
;
50 ///////////////////////////////////////////////////////////////////////////////
51 // JDModulesList class
53 void JVMModulesList::Parse(const Data
&entry_packet
)
57 size_t size
= entry_packet
.GetSize();
59 while (count
< size
) {
62 const unsigned char *ptr
= (entry_packet
.GetData() + count
);
63 Protocol::JVMModulesEntry
*e
= (Protocol::JVMModulesEntry
*) ptr
;
65 len
= SB_JVMMODULES_ENTRY_HEADER_SIZE
+ be_btohs(e
->sizename
);
66 if( (count
+ len
) > size
)
69 JVMModulesEntry entry
;
71 entry
.Id
= be_btohl(e
->id
);
72 entry
.UniqueID
= be_btohl(e
->uniqueId
);
73 (entry
.Name
).assign((char *) (ptr
+ SB_JVMMODULES_ENTRY_HEADER_SIZE
), be_btohs(e
->sizename
));
82 void JVMModulesList::Dump(std::ostream
&os
) const
84 ios_format_state
state(os
);
86 const_iterator i
= begin(), e
= end();
88 os
<< _(" ID ") << "|";
89 os
<< _(" UniqueID ") << "|";
90 os
<< _(" Module Name") << endl
;
92 os
<< "------------+";
93 os
<< "------------+";
94 os
<< "-------------";
97 for( ; i
!= e
; ++i
) {
103 ///////////////////////////////////////////////////////////////////////////////
104 // JVMModulesEntry class
106 void JVMModulesEntry::Dump(std::ostream
&os
) const
108 ios_format_state
state(os
);
110 os
<< " 0x" << setfill('0') << setw(8) << hex
<< Id
<< " |";
111 os
<< " 0x" << setfill('0') << setw(8) << hex
<< UniqueID
<< " |";
112 os
<< " " << Name
<< endl
;
116 ///////////////////////////////////////////////////////////////////////////////
117 // JVMThreadsList class
119 void JVMThreadsList::Parse(const Data
&entry_packet
)
123 size_t size
= entry_packet
.GetSize();
125 while (count
< size
) {
128 const unsigned char *ptr
= (entry_packet
.GetData() + count
);
129 uint32_t *e
= (uint32_t *) ptr
;
131 len
= sizeof(uint32_t);
132 if( (count
+ len
) > size
)
135 JVMThreadsEntry entry
;
137 entry
.Id
= be_btohl(*e
);
146 void JVMThreadsList::Dump(std::ostream
&os
) const
148 ios_format_state
state(os
);
150 const_iterator i
= begin(), e
= end();
152 os
<< _(" Thread ") << "|";
153 os
<< _(" Address ") << "|";
154 os
<< _(" Byte ") << "|";
155 os
<< _(" Unknown01 ") << "|";
156 os
<< _(" Unknown02 ") << "|";
157 os
<< _(" Unknown03 ") << "|";
158 os
<< _(" Unknown04 ") << "|";
159 os
<< _(" Unknown05 ") << "|";
160 os
<< _(" Unknown06 ") << "|";
162 os
<< "------------+";
163 os
<< "------------+";
165 os
<< "------------+";
166 os
<< "------------+";
167 os
<< "------------+";
168 os
<< "------------+";
169 os
<< "------------+";
170 os
<< "-------------";
173 for(int k
=0 ; i
!= e
; ++i
, k
++ ) {
179 void JVMThreadsEntry::Dump(std::ostream
&os
, int num
) const
181 ios_format_state
state(os
);
183 os
<< " " << setfill(' ') << setw(8) << dec
<< num
<< " |";
184 os
<< " 0x" << setfill('0') << setw(8) << hex
<< (Id
) << " |";
185 os
<< " 0x" << setfill('0') << setw(2) << hex
<< (Byte
) << " |";
186 os
<< " 0x" << setfill('0') << setw(8) << hex
<< (Address
) << " |";
187 os
<< " 0x" << setfill('0') << setw(8) << hex
<< (Unknown01
) << " |";
188 os
<< " 0x" << setfill('0') << setw(8) << hex
<< (Unknown02
) << " |";
189 os
<< " 0x" << setfill('0') << setw(8) << hex
<< (Unknown03
) << " |";
190 os
<< " 0x" << setfill('0') << setw(8) << hex
<< (Unknown04
) << " |";
191 os
<< " 0x" << setfill('0') << setw(8) << hex
<< (Unknown05
) << " |";
192 os
<< " 0x" << setfill('0') << setw(8) << hex
<< (Unknown06
) << endl
;
198 ///////////////////////////////////////////////////////////////////////////////
199 // JVMDebug Mode class
201 JVMDebug::JVMDebug(Controller
&con
)
202 : Mode(con
, Controller::JVMDebug
)
207 JVMDebug::~JVMDebug()
213 ///////////////////////////////////////////////////////////////////////////////
217 ///////////////////////////////////////////////////////////////////////////////
220 void JVMDebug::OnOpen()
224 // FIXME - is this necessary? and if it is, wouldn't it be better
225 // in the m_jvmdebug mode class? I'm not convinced that applications
226 // should have to bother with socket-level details.
227 void JVMDebug::Close()
239 /// These commands are sent to prepare the debug communication.
240 /// Must be called at the start of a JVMDebug session.
242 void JVMDebug::Attach()
249 /// Must be called at the end of a JVMDebug session. The JVM_GOODBYE
250 /// command is sent to the device.
252 void JVMDebug::Detach()
257 void JVMDebug::ThrowJVMError(const std::string
&msg
, uint16_t cmd
)
259 std::ostringstream oss
;
260 oss
<< msg
<< ": " << _("unexpected packet command code: ")
261 << "0x" << std::hex
<< (unsigned int) cmd
;
262 throw Error(oss
.str());
269 void JVMDebug::Unknown01()
273 Data
command(-1, 8), response
;
274 JVMPacket
packet(command
, response
);
276 // Send the command packet
278 m_socket
->Packet(packet
);
279 expect
= packet
.Size();
284 // Read the data stream
285 m_socket
->Receive(response
);
287 size_t bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
289 // Check the size read into the previous packet
290 if( expect
!= bytereceived
) {
291 ThrowJVMError(string("JVMDebug::Unknown01(): ") + _("byte count mismatch"), expect
);
299 void JVMDebug::Unknown02()
303 Data
command(-1, 8), response
;
304 JVMPacket
packet(command
, response
);
306 // Send the command packet
308 m_socket
->Packet(packet
);
309 expect
= packet
.Size();
314 // Read the data stream
315 m_socket
->Receive(response
);
317 size_t bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
319 // Check the size read into the previous packet
320 if( expect
!= bytereceived
) {
321 ThrowJVMError(string("JVMDebug::Unknown02(): ") + _("byte count mismatch"), expect
);
329 void JVMDebug::Unknown03()
333 Data
command(-1, 8), response
;
334 JVMPacket
packet(command
, response
);
336 // Send the command packet
338 m_socket
->Packet(packet
);
339 expect
= packet
.Size();
344 // Read the data stream
345 m_socket
->Receive(response
);
347 size_t bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
349 // Check the size read into the previous packet
350 if( expect
!= bytereceived
) {
351 ThrowJVMError(string("JVMDebug::Unknown03(): ") + _("byte count mismatch"), expect
);
359 void JVMDebug::Unknown04()
363 Data
command(-1, 8), response
;
364 JVMPacket
packet(command
, response
);
366 // Send the command packet
368 m_socket
->Packet(packet
);
369 expect
= packet
.Size();
374 // Read the data stream
375 m_socket
->Receive(response
);
377 size_t bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
379 // Check the size read into the previous packet
380 if( expect
!= bytereceived
) {
381 ThrowJVMError(string("JVMDebug::Unknown04(): ") + _("byte count mismatch"), expect
);
389 void JVMDebug::Unknown05()
393 Data
command(-1, 8), response
;
394 JVMPacket
packet(command
, response
);
396 // Send the command packet
398 m_socket
->Packet(packet
);
399 expect
= packet
.Size();
404 // Read the data stream
405 m_socket
->Receive(response
);
407 size_t bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
409 // Check the size read into the previous packet
410 if( expect
!= bytereceived
) {
411 ThrowJVMError(string("JVMDebug::Unknown05(): ") + _("byte count mismatch"), expect
);
419 void JVMDebug::Unknown06()
423 Data
command(-1, 8), response
;
424 JVMPacket
packet(command
, response
);
426 // Send the command packet
428 m_socket
->Packet(packet
);
429 expect
= packet
.Size();
434 // Read the data stream
435 m_socket
->Receive(response
);
437 size_t bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
439 // Check the size read into the previous packet
440 if( expect
!= bytereceived
) {
441 ThrowJVMError(string("JVMDebug::Unknown06(): ") + _("byte count mismatch"), expect
);
449 void JVMDebug::Unknown07()
453 Data
command(-1, 8), response
;
454 JVMPacket
packet(command
, response
);
456 // Send the command packet
458 m_socket
->Packet(packet
);
459 expect
= packet
.Size();
464 // Read the data stream
465 m_socket
->Receive(response
);
467 size_t bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
469 // Check the size read into the previous packet
470 if( expect
!= bytereceived
) {
471 ThrowJVMError(string("JVMDebug::Unknown07(): ") + _("byte count mismatch"), expect
);
479 void JVMDebug::Unknown08()
483 Data
command(-1, 8), response
;
484 JVMPacket
packet(command
, response
);
486 // Send the command packet
488 m_socket
->Packet(packet
);
489 expect
= packet
.Size();
494 // Read the data stream
495 m_socket
->Receive(response
);
497 size_t bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
499 // Check the size read into the previous packet
500 if( expect
!= bytereceived
) {
501 ThrowJVMError(string("JVMDebug::Unknown08(): ") + _("byte count mismatch"), expect
);
509 void JVMDebug::Unknown09()
513 Data
command(-1, 8), response
;
514 JVMPacket
packet(command
, response
);
516 // Send the command packet
518 m_socket
->Packet(packet
);
519 expect
= packet
.Size();
524 // Read the data stream
525 m_socket
->Receive(response
);
527 size_t bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
529 // Check the size read into the previous packet
530 if( expect
!= bytereceived
) {
531 ThrowJVMError(string("JVMDebug::Unknown09(): ") + _("byte count mismatch"), expect
);
539 void JVMDebug::Unknown10()
543 Data
command(-1, 8), response
;
544 JVMPacket
packet(command
, response
);
546 // Send the command packet
548 m_socket
->Packet(packet
);
549 expect
= packet
.Size();
554 // Read the data stream
555 m_socket
->Receive(response
);
557 size_t bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
559 // Check the size read into the previous packet
560 if( expect
!= bytereceived
) {
561 ThrowJVMError(string("JVMDebug::Unknown10(): ") + _("byte count mismatch"), expect
);
569 bool JVMDebug::GetStatus(int &status
)
573 Data
command(-1, 8), response
;
574 JVMPacket
packet(command
, response
);
576 // Send the command packet
579 m_socket
->Packet(packet
);
581 expect
= packet
.Size();
586 // Read the data stream
587 m_socket
->Receive(response
);
589 MAKE_JVMPACKET(dpack
, response
);
591 size_t bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
593 // Check the size read into the previous packet
594 if( expect
!= bytereceived
) {
595 ThrowJVMError(string("JVMDebug::GetStatus():") + _("byte count mismatch"), expect
);
598 // Make sure we have a header to read
599 CheckSize(response
, SB_JVMPACKET_HEADER_SIZE
+ sizeof(dpack
->u
.status
));
602 status
= dpack
->u
.status
;
611 bool JVMDebug::WaitStatus(int &status
)
615 Data
command(-1, 8), response
;
616 JVMPacket
packet(command
, response
);
618 // Prepare the command packet
622 m_socket
->Receive(packet
.GetReceive(), 100);
623 } catch (Usb::Timeout
&DEBUG_ONLY(to
) ) {
627 expect
= packet
.Size();
632 // Read the data stream
633 m_socket
->Receive(response
);
635 MAKE_JVMPACKET(dpack
, response
);
637 size_t bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
639 // Check the size read into the previous packet
640 if( expect
!= bytereceived
) {
641 ThrowJVMError(string("JVMDebug::WaitStatus():") + _("byte count mismatch"), expect
);
644 // Make sure we have a header to read
645 CheckSize(response
, SB_JVMPACKET_HEADER_SIZE
+ sizeof(dpack
->u
.status
));
648 status
= dpack
->u
.status
;
655 // Get Console Message
656 // Sample, display the output of System.out.println(...) and all JVM messages output
658 // Return the length message or -1 if message doesn't exit or is empty
660 int JVMDebug::GetConsoleMessage(std::string
&message
)
664 Data
command(-1, 8), response
;
665 JVMPacket
packet(command
, response
);
667 // Send the command packet
668 packet
.GetConsoleMessage();
670 m_socket
->Packet(packet
);
672 expect
= packet
.Size();
677 // Read the data stream
678 m_socket
->Receive(response
);
680 MAKE_JVMPACKET(dpack
, response
);
682 size_t bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
684 // Check the size read into the previous packet
685 if( expect
!= bytereceived
) {
686 ThrowJVMError(string("JVMDebug::GetConsoleMessage():") + _("byte count mismatch"), expect
);
689 // Make sure we have a header to read
690 CheckSize(response
, SB_JVMPACKET_HEADER_SIZE
+ sizeof(dpack
->u
.msglength
));
693 uint16_t length
= be_btohs(dpack
->u
.msglength
);
698 CheckSize(response
, SB_JVMPACKET_HEADER_SIZE
+ sizeof(dpack
->u
.msglength
) + length
);
700 // Parse the ID of nextmodules
701 const unsigned char *ptr
= (response
.GetData() + SB_JVMPACKET_HEADER_SIZE
+ sizeof(dpack
->u
.msglength
));
703 message
.assign((char *) ptr
, length
);
710 // Get list of Java modules
712 void JVMDebug::GetModulesList(JVMModulesList
&mylist
)
718 Data
command(-1, 8), response
;
719 JVMPacket
packet(command
, response
);
722 // Send the command packet
723 packet
.GetModulesList(offset
);
725 m_socket
->Packet(packet
);
727 expect
= packet
.Size();
732 // Read the data stream
733 m_socket
->Receive(response
);
735 // MAKE_JVMPACKET(dpack, response); // unused
737 size_t bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
739 // Check the size read into the previous packet
740 if( expect
!= bytereceived
) {
741 ThrowJVMError(string("JVMDebug::GetModulesList():") + _("byte count mismatch"), expect
);
744 // Make sure there's enough for packet header + module list
745 // header + 4 bytes of ID
746 CheckSize(response
, SB_JVMPACKET_HEADER_SIZE
+ SB_JVMMODULES_LIST_HEADER_SIZE
+ 4);
748 // Number of modules entries in the list
749 // (Valid, but unused variable... disabled to stop compiler
751 // uint32_t count = be_btohl(dpack->u.moduleslist.nbr);
753 // Size of modules list
754 // I remove the header of packet (contains the field 'number of modules')
755 // and 4 bytes (contains the field 'ID of next modules')
756 size
= bytereceived
- SB_JVMMODULES_LIST_HEADER_SIZE
- 4;
758 // Parse the modules list
759 mylist
.Parse(Data(response
.GetData() + SB_JVMPACKET_HEADER_SIZE
+ SB_JVMMODULES_LIST_HEADER_SIZE
, size
));
761 // Parse the ID of nextmodules
762 size_t id_offset
= SB_JVMPACKET_HEADER_SIZE
+ SB_JVMMODULES_LIST_HEADER_SIZE
+ size
;
763 const unsigned char *ptr
= (response
.GetData() + id_offset
);
764 CheckSize(response
, id_offset
+ sizeof(uint32_t));
765 uint32_t *poffset
= (uint32_t *) ptr
;
767 offset
= be_btohl(*poffset
);
768 } while (offset
!= 0); // When the offset != 0, there is some modules
773 // Get list of Java threads
775 void JVMDebug::GetThreadsList(JVMThreadsList
&mylist
)
780 Data
command(-1, 8), response
;
781 JVMPacket
packet(command
, response
);
783 // Send the command packet
784 packet
.GetThreadsList();
786 m_socket
->Packet(packet
);
788 expect
= packet
.Size();
793 // Read the data stream
794 m_socket
->Receive(response
);
796 // MAKE_JVMPACKET(dpack, response); // unused
798 size_t bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
800 // Check the size read into the previous packet
801 if( expect
!= bytereceived
) {
802 ThrowJVMError(string("JVMDebug::GetThreadsList():") + _("byte count mismatch"), expect
);
805 CheckSize(response
, SB_JVMPACKET_HEADER_SIZE
+ SB_JVMTHREADS_LIST_HEADER_SIZE
);
807 // Number of threads entries in the list
808 // (Valid, but unused variable... disabled to stop compiler warnings)
809 // uint32_t count = be_btohl(dpack->u.threadslist.nbr);
811 // Size of threads list
812 // I remove the header of packet (contains the field 'number of threads')
813 size
= bytereceived
- SB_JVMTHREADS_LIST_HEADER_SIZE
;
815 // Parse the threads list
816 mylist
.Parse(Data(response
.GetData() + SB_JVMPACKET_HEADER_SIZE
+ SB_JVMTHREADS_LIST_HEADER_SIZE
, size
));
818 // Complete threads list
819 JVMThreadsList::iterator b
= mylist
.begin();
820 for( ; b
!= mylist
.end(); b
++ ) {
821 JVMThreadsEntry entry
= (*b
);
824 // Send the command packet
825 packet
.Unknown11(entry
.Id
);
827 m_socket
->Packet(packet
);
829 expect
= packet
.Size();
834 // Read the data stream
835 m_socket
->Receive(response
);
837 MAKE_JVMPACKET(dpack
, response
);
839 bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
841 // Check the size read into the previous packet
842 if( expect
!= bytereceived
) {
843 ThrowJVMError(string("JVMDebug::GetThreadsList() (1):") + _("byte count mismatch"), expect
);
846 CheckSize(response
, SB_JVMPACKET_HEADER_SIZE
+ SB_JVMUNKNOWN01_HEADER_SIZE
);
849 entry
.Byte
= dpack
->u
.unknown01
.byte
;
850 entry
.Address
= be_btohl(dpack
->u
.unknown01
.address
);
853 if (entry
.Address
!= 0) {
854 // Send the command packet
855 packet
.Unknown12(entry
.Address
);
857 m_socket
->Packet(packet
);
859 expect
= packet
.Size();
864 // Read the data stream
865 m_socket
->Receive(response
);
867 MAKE_JVMPACKET(dpack
, response
);
869 bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
871 // Check the size read into the previous packet
872 if( expect
!= bytereceived
) {
873 ThrowJVMError(string("JVMDebug::GetThreadsList() (2):") + _("byte count mismatch"), expect
);
878 CheckSize(response
, SB_JVMPACKET_HEADER_SIZE
+ sizeof(dpack
->u
.address
));
879 entry
.Unknown01
= be_btohl(dpack
->u
.address
);
885 // Send the command packet
886 packet
.Unknown13(entry
.Id
);
888 m_socket
->Packet(packet
);
890 expect
= packet
.Size();
895 // Read the data stream
896 m_socket
->Receive(response
);
898 dpack
= (const Protocol::JVMPacket
*) response
.GetData();
900 bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
902 // Check the size read into the previous packet
903 if( expect
!= bytereceived
) {
904 ThrowJVMError(string("JVMDebug::GetThreadsList() (3):") + _("byte count mismatch"), expect
);
908 CheckSize(response
, SB_JVMPACKET_HEADER_SIZE
+ sizeof(dpack
->u
.address
));
909 entry
.Unknown02
= be_btohl(dpack
->u
.address
);
912 // Send the command packet
913 packet
.Unknown14(entry
.Id
);
915 m_socket
->Packet(packet
);
917 expect
= packet
.Size();
922 // Read the data stream
923 m_socket
->Receive(response
);
925 dpack
= (const Protocol::JVMPacket
*) response
.GetData();
927 bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
929 // Check the size read into the previous packet
930 if( expect
!= bytereceived
) {
931 ThrowJVMError(string("JVMDebug::GetThreadsList() (4):") + _("byte count mismatch"), expect
);
935 CheckSize(response
, SB_JVMPACKET_HEADER_SIZE
+ SB_JVMUNKNOWN02_HEADER_SIZE
);
936 entry
.Unknown03
= be_btohl(dpack
->u
.unknown02
.address1
);
937 entry
.Unknown04
= be_btohl(dpack
->u
.unknown02
.address2
);
940 // Send the command packet
941 packet
.Unknown15(entry
.Id
);
943 m_socket
->Packet(packet
);
945 expect
= packet
.Size();
950 // Read the data stream
951 m_socket
->Receive(response
);
953 dpack
= (const Protocol::JVMPacket
*) response
.GetData();
955 bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
957 // Check the size read into the previous packet
958 if( expect
!= bytereceived
) {
959 ThrowJVMError(string("JVMDebug::GetThreadsList() (5):") + _("byte count mismatch"), expect
);
963 CheckSize(response
, SB_JVMPACKET_HEADER_SIZE
+ SB_JVMUNKNOWN02_HEADER_SIZE
);
964 entry
.Unknown05
= be_btohl(dpack
->u
.unknown02
.address1
);
965 entry
.Unknown06
= be_btohl(dpack
->u
.unknown02
.address2
);
980 Data
command(-1, 8), response
;
981 JVMPacket
packet(command
, response
);
983 // Send the command packet
985 m_socket
->Packet(packet
);
986 expect
= packet
.Size();
988 while (expect
== 0) {
989 m_socket
->Receive(packet
.GetReceive());
991 expect
= packet
.Size();
994 // Read the data stream
995 m_socket
->Receive(response
);
997 size_t bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
999 // Check the size read into the previous packet
1000 if( expect
!= bytereceived
) {
1001 ThrowJVMError(string("JVMDebug::Go():") + _("byte count mismatch"), expect
);
1009 void JVMDebug::Stop()
1011 uint16_t expect
= 0;
1013 Data
command(-1, 8), response
;
1014 JVMPacket
packet(command
, response
);
1016 // Send the command packet
1018 m_socket
->Packet(packet
);
1019 expect
= packet
.Size();
1021 while (expect
== 0) {
1022 m_socket
->Receive(packet
.GetReceive());
1024 expect
= packet
.Size();
1027 // Read the data stream
1028 m_socket
->Receive(response
);
1030 size_t bytereceived
= response
.GetSize() - SB_JVMPACKET_HEADER_SIZE
;
1032 // Check the size read into the previous packet
1033 if( expect
!= bytereceived
) {
1034 ThrowJVMError(string("JVMDebug::Stop():") + _("byte count mismatch"), expect
);
1039 }} // namespace Barry::Mode