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);
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 */