Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: src/arm/debug-arm.cc

Issue 199075: Implemented missing pieces of the debugger for ARM (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/arm/macro-assembler-arm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/debug-arm.cc
===================================================================
--- src/arm/debug-arm.cc (revision 2877)
+++ src/arm/debug-arm.cc (working copy)
@@ -34,28 +34,41 @@
namespace internal {
#ifdef ENABLE_DEBUGGER_SUPPORT
-// Currently debug break is not supported in frame exit code on ARM.
bool BreakLocationIterator::IsDebugBreakAtReturn() {
- return false;
+ return Debug::IsDebugBreakAtReturn(rinfo());
}
-// Currently debug break is not supported in frame exit code on ARM.
void BreakLocationIterator::SetDebugBreakAtReturn() {
- UNIMPLEMENTED();
+ // Patch the code changing the return from JS function sequence from
+ // mov sp, fp
+ // ldmia sp!, {fp, lr}
+ // add sp, sp, #4
+ // bx lr
+ // to a call to the debug break return code.
+ // mov lr, pc
+ // ldr pc, [pc, #-4]
+ // <debug break return code entry point address>
+ // bktp 0
+ CodePatcher patcher(rinfo()->pc(), 4);
+ patcher.masm()->mov(v8::internal::lr, v8::internal::pc);
+ patcher.masm()->ldr(v8::internal::pc, MemOperand(v8::internal::pc, -4));
+ patcher.Emit(Debug::debug_break_return()->entry());
+ patcher.masm()->bkpt(0);
}
-// Currently debug break is not supported in frame exit code on ARM.
+// Restore the JS frame exit code.
void BreakLocationIterator::ClearDebugBreakAtReturn() {
- UNIMPLEMENTED();
+ rinfo()->PatchCode(original_rinfo()->pc(),
+ CodeGenerator::kJSReturnSequenceLength);
}
+// A debug break in the exit code is identified by a call.
bool Debug::IsDebugBreakAtReturn(RelocInfo* rinfo) {
ASSERT(RelocInfo::IsJSReturn(rinfo->rmode()));
- // Currently debug break is not supported in frame exit code on ARM.
- return false;
+ return rinfo->IsCallInstruction();
}
@@ -95,8 +108,6 @@
__ LeaveInternalFrame();
- // Inlined ExitJSFrame ends here.
-
// Finally restore all registers.
__ RestoreRegistersFromMemory(kJSCallerSaved);
@@ -138,12 +149,20 @@
void Debug::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) {
- // Keyed load IC not implemented on ARM.
+ // ---------- S t a t e --------------
+ // -- lr : return address
+ // -- sp[0] : key
+ // -- sp[4] : receiver
+ Generate_DebugBreakCallHelper(masm, 0);
}
void Debug::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) {
- // Keyed store IC not implemented on ARM.
+ // ---------- S t a t e --------------
+ // -- lr : return address
+ // -- sp[0] : key
+ // -- sp[4] : receiver
+ Generate_DebugBreakCallHelper(masm, 0);
}
@@ -180,7 +199,10 @@
void Debug::GenerateStubNoRegistersDebugBreak(MacroAssembler* masm) {
- // Generate nothing as CodeStub CallFunction is not used on ARM.
+ // ----------- S t a t e -------------
+ // No registers used on entry.
+ // -----------------------------------
+ Generate_DebugBreakCallHelper(masm, 0);
}
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/arm/macro-assembler-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698