summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author jeffhao <jeffhao@google.com> 2012-12-14 17:50:42 -0800
committer jeffhao <jeffhao@google.com> 2012-12-17 13:49:12 -0800
commit14f0db92225d34622fa5cb1a6dc9287334aaf6c7 (patch)
tree7771b1fa7b9a3553d3ad220e45bea926819ab33c /src
parent4c5b265e66bebf890b6f9e53cddeb512774b1613 (diff)
Fixes to interpreter and debugger for JDWP.
- Fixed off-by-one error for MethodEndCodeIndex. - Changed first instance of dex_pc 0 in interpreter Execute to output METHOD_ENTRY event. Change-Id: I4854cb7cbde0db53db23d8b1c5bb9f08bf8409f1
Diffstat (limited to 'src')
-rw-r--r--src/debugger.cc4
-rw-r--r--src/interpreter/interpreter.cc5
2 files changed, 7 insertions, 2 deletions
diff --git a/src/debugger.cc b/src/debugger.cc
index 12ea5e2d6c..a75cd8c5a0 100644
--- a/src/debugger.cc
+++ b/src/debugger.cc
@@ -1118,8 +1118,8 @@ void Dbg::OutputLineTable(JDWP::RefTypeId, JDWP::MethodId methodId, JDWP::Expand
end = -1;
} else {
start = 0;
- // TODO: what are the units supposed to be? *2?
- end = mh.GetCodeItem()->insns_size_in_code_units_;
+ // Return the index of the last instruction
+ end = mh.GetCodeItem()->insns_size_in_code_units_ - 1;
}
expandBufAdd8BE(pReply, start);
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index fd101fe06c..f89d6488db 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -545,11 +545,16 @@ static JValue Execute(Thread* self, MethodHelper& mh, const DexFile::CodeItem* c
ShadowFrame& shadow_frame) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
const uint16_t* insns = code_item->insns_;
const Instruction* inst = Instruction::At(insns + shadow_frame.GetDexPC());
+ bool entry = (inst->GetDexPc(insns) == 0);
JValue result_register;
while (true) {
CheckSuspend(self);
uint32_t dex_pc = inst->GetDexPc(insns);
shadow_frame.SetDexPC(dex_pc);
+ if (entry) {
+ Dbg::UpdateDebugger(-1, self);
+ }
+ entry = false;
Dbg::UpdateDebugger(dex_pc, self);
DecodedInstruction dec_insn(inst);
const bool kTracing = false;