summaryrefslogtreecommitdiffstats
path: root/runtime/jdwp/jdwp_event.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/jdwp/jdwp_event.cc')
-rw-r--r--runtime/jdwp/jdwp_event.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/jdwp/jdwp_event.cc b/runtime/jdwp/jdwp_event.cc
index e372c26..ede81d2 100644
--- a/runtime/jdwp/jdwp_event.cc
+++ b/runtime/jdwp/jdwp_event.cc
@@ -697,6 +697,11 @@ void JdwpState::EventFinish(ExpandBuf* pReq) {
Set1(buf+9, kJdwpEventCommandSet);
Set1(buf+10, kJdwpCompositeCommand);
+ // Prevents from interleaving commands and events. Otherwise we could end up in sending an event
+ // before sending the reply of the command being processed and would lead to bad synchronization
+ // between the debugger and the debuggee.
+ WaitForProcessingRequest();
+
SendRequest(pReq);
expandBufFree(pReq);