summaryrefslogtreecommitdiffstats
path: root/runtime/jdwp
diff options
context:
space:
mode:
authorSebastien Hertz <shertz@google.com>2014-10-08 13:54:55 +0200
committerSebastien Hertz <shertz@google.com>2014-10-09 18:32:50 +0200
commit033aabf9789eda162e183ed34678d665dc903387 (patch)
tree3beaf12012d725296f48877bb9676ea81fe000e5 /runtime/jdwp
parent2d4e89e97812aeca16ff058d7286f29b7549c43a (diff)
downloadart-033aabf9789eda162e183ed34678d665dc903387.tar.gz
art-033aabf9789eda162e183ed34678d665dc903387.tar.bz2
art-033aabf9789eda162e183ed34678d665dc903387.zip
Only watch location for BREAKPOINT event
This CL ensures we watch a location for BREAKPOINT event only. Other events (single-step, method entry/exit, ...) are handled differently and LocationOnly modifier is used as an event filter in this case. This prevents from failing a check when we need to deoptimize for non-breakpoint event. Bug: 17908144 Change-Id: Ib413d62fa31480fec8d750543c0605ba52188350
Diffstat (limited to 'runtime/jdwp')
-rw-r--r--runtime/jdwp/jdwp_event.cc16
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 */