diff options
author | Jeff Hao <jeffhao@google.com> | 2013-11-18 13:16:49 -0800 |
---|---|---|
committer | Jeff Hao <jeffhao@google.com> | 2013-11-19 11:16:44 -0800 |
commit | 579b02416e05e32e535126e1ed61613a2cdb030e (patch) | |
tree | 4431587a30c1d5a3e7c0435decbd7ac21104bf7a /runtime/jdwp | |
parent | e4a50ee34695a9d90cf03fbb1e8afd1e434f6ee1 (diff) | |
download | art-579b02416e05e32e535126e1ed61613a2cdb030e.zip art-579b02416e05e32e535126e1ed61613a2cdb030e.tar.gz art-579b02416e05e32e535126e1ed61613a2cdb030e.tar.bz2 |
Add support for JDWP METHOD_EXIT_WITH_RETURN_VALUE events.
Bug: 11569539
Change-Id: Ibc7a80df83470ffd726d73695a05f4938248f292
Diffstat (limited to 'runtime/jdwp')
-rw-r--r-- | runtime/jdwp/jdwp.h | 6 | ||||
-rw-r--r-- | runtime/jdwp/jdwp_event.cc | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/runtime/jdwp/jdwp.h b/runtime/jdwp/jdwp.h index a1657d0..fd78bf2 100644 --- a/runtime/jdwp/jdwp.h +++ b/runtime/jdwp/jdwp.h @@ -31,6 +31,7 @@ struct iovec; namespace art { + union JValue; namespace mirror { class ArtMethod; } // namespace mirror @@ -185,8 +186,11 @@ struct JdwpState { * issuing a MethodEntry on a native method. * * "eventFlags" indicates the types of events that have occurred. + * + * "returnValue" is non-null for MethodExit events only. */ - bool PostLocationEvent(const JdwpLocation* pLoc, ObjectId thisPtr, int eventFlags) + bool PostLocationEvent(const JdwpLocation* pLoc, ObjectId thisPtr, int eventFlags, + const JValue* returnValue) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); /* diff --git a/runtime/jdwp/jdwp_event.cc b/runtime/jdwp/jdwp_event.cc index 345549d..61bd1ed 100644 --- a/runtime/jdwp/jdwp_event.cc +++ b/runtime/jdwp/jdwp_event.cc @@ -719,7 +719,8 @@ bool JdwpState::PostVMStart() { * - Single-step to a line with a breakpoint. Should get a single * event message with both events in it. */ -bool JdwpState::PostLocationEvent(const JdwpLocation* pLoc, ObjectId thisPtr, int eventFlags) { +bool JdwpState::PostLocationEvent(const JdwpLocation* pLoc, ObjectId thisPtr, int eventFlags, + const JValue* returnValue) { ModBasket basket; basket.pLoc = pLoc; basket.classId = pLoc->class_id; @@ -771,9 +772,7 @@ bool JdwpState::PostLocationEvent(const JdwpLocation* pLoc, ObjectId thisPtr, in } if ((eventFlags & Dbg::kMethodExit) != 0) { FindMatchingEvents(EK_METHOD_EXIT, &basket, match_list, &match_count); - - // TODO: match EK_METHOD_EXIT_WITH_RETURN_VALUE too; we need to include the 'value', though. - // FindMatchingEvents(EK_METHOD_EXIT_WITH_RETURN_VALUE, &basket, match_list, &match_count); + FindMatchingEvents(EK_METHOD_EXIT_WITH_RETURN_VALUE, &basket, match_list, &match_count); } if (match_count != 0) { VLOG(jdwp) << "EVENT: " << match_list[0]->eventKind << "(" << match_count << " total) " @@ -792,6 +791,9 @@ bool JdwpState::PostLocationEvent(const JdwpLocation* pLoc, ObjectId thisPtr, in expandBufAdd4BE(pReq, match_list[i]->requestId); expandBufAdd8BE(pReq, basket.threadId); expandBufAddLocation(pReq, *pLoc); + if (match_list[i]->eventKind == EK_METHOD_EXIT_WITH_RETURN_VALUE) { + Dbg::OutputMethodReturnValue(pLoc->method_id, returnValue, pReq); + } } } |