diff options
-rw-r--r-- | runtime/jdwp/jdwp_event.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/runtime/jdwp/jdwp_event.cc b/runtime/jdwp/jdwp_event.cc index 7c8c63ce46..d1229b28a8 100644 --- a/runtime/jdwp/jdwp_event.cc +++ b/runtime/jdwp/jdwp_event.cc @@ -181,8 +181,14 @@ JdwpError JdwpState::RegisterEvent(JdwpEvent* pEvent) { for (int i = 0; i < pEvent->modCount; i++) { const JdwpEventMod* pMod = &pEvent->mods[i]; if (pMod->modKind == MK_LOCATION_ONLY) { - /* should only be for Breakpoint, Step, and Exception */ - Dbg::WatchLocation(&pMod->locationOnly.loc, &req); + // Should only concern breakpoint, field access, field modification, step, and exception + // events. + // However breakpoint requires specific handling. Field access, field modification and step + // events need full deoptimization to be reported while exception event is reported during + // exception handling. + if (pEvent->eventKind == EK_BREAKPOINT) { + Dbg::WatchLocation(&pMod->locationOnly.loc, &req); + } } else if (pMod->modKind == MK_STEP) { /* should only be for EK_SINGLE_STEP; should only be one */ JdwpStepSize size = static_cast<JdwpStepSize>(pMod->step.size); @@ -258,8 +264,10 @@ void JdwpState::UnregisterEvent(JdwpEvent* pEvent) { for (int i = 0; i < pEvent->modCount; i++) { JdwpEventMod* pMod = &pEvent->mods[i]; if (pMod->modKind == MK_LOCATION_ONLY) { - /* should only be for Breakpoint, Step, and Exception */ - Dbg::UnwatchLocation(&pMod->locationOnly.loc, &req); + // Like in RegisterEvent, we need specific handling for breakpoint only. + if (pEvent->eventKind == EK_BREAKPOINT) { + Dbg::UnwatchLocation(&pMod->locationOnly.loc, &req); + } } if (pMod->modKind == MK_STEP) { /* should only be for EK_SINGLE_STEP; should only be one */ |