| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 } | 39 } |
| 40 | 40 |
| 41 | 41 |
| 42 void BreakLocationIterator::SetDebugBreakAtReturn() { | 42 void BreakLocationIterator::SetDebugBreakAtReturn() { |
| 43 // Patch the code changing the return from JS function sequence from | 43 // Patch the code changing the return from JS function sequence from |
| 44 // mov sp, fp | 44 // mov sp, fp |
| 45 // ldmia sp!, {fp, lr} | 45 // ldmia sp!, {fp, lr} |
| 46 // add sp, sp, #4 | 46 // add sp, sp, #4 |
| 47 // bx lr | 47 // bx lr |
| 48 // to a call to the debug break return code. | 48 // to a call to the debug break return code. |
| 49 // #if USE_BLX |
| 50 // ldr ip, [pc, #0] |
| 51 // blx ip |
| 52 // #else |
| 49 // mov lr, pc | 53 // mov lr, pc |
| 50 // ldr pc, [pc, #-4] | 54 // ldr pc, [pc, #-4] |
| 55 // #endif |
| 51 // <debug break return code entry point address> | 56 // <debug break return code entry point address> |
| 52 // bktp 0 | 57 // bktp 0 |
| 53 CodePatcher patcher(rinfo()->pc(), 4); | 58 CodePatcher patcher(rinfo()->pc(), 4); |
| 59 #ifdef USE_BLX |
| 60 patcher.masm()->ldr(v8::internal::ip, MemOperand(v8::internal::pc, 0)); |
| 61 patcher.masm()->blx(v8::internal::ip); |
| 62 #else |
| 54 patcher.masm()->mov(v8::internal::lr, v8::internal::pc); | 63 patcher.masm()->mov(v8::internal::lr, v8::internal::pc); |
| 55 patcher.masm()->ldr(v8::internal::pc, MemOperand(v8::internal::pc, -4)); | 64 patcher.masm()->ldr(v8::internal::pc, MemOperand(v8::internal::pc, -4)); |
| 65 #endif |
| 56 patcher.Emit(Debug::debug_break_return()->entry()); | 66 patcher.Emit(Debug::debug_break_return()->entry()); |
| 57 patcher.masm()->bkpt(0); | 67 patcher.masm()->bkpt(0); |
| 58 } | 68 } |
| 59 | 69 |
| 60 | 70 |
| 61 // Restore the JS frame exit code. | 71 // Restore the JS frame exit code. |
| 62 void BreakLocationIterator::ClearDebugBreakAtReturn() { | 72 void BreakLocationIterator::ClearDebugBreakAtReturn() { |
| 63 rinfo()->PatchCode(original_rinfo()->pc(), | 73 rinfo()->PatchCode(original_rinfo()->pc(), |
| 64 Assembler::kJSReturnSequenceLength); | 74 Assembler::kJSReturnSequenceLength); |
| 65 } | 75 } |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 // ----------------------------------- | 214 // ----------------------------------- |
| 205 Generate_DebugBreakCallHelper(masm, 0); | 215 Generate_DebugBreakCallHelper(masm, 0); |
| 206 } | 216 } |
| 207 | 217 |
| 208 | 218 |
| 209 #undef __ | 219 #undef __ |
| 210 | 220 |
| 211 #endif // ENABLE_DEBUGGER_SUPPORT | 221 #endif // ENABLE_DEBUGGER_SUPPORT |
| 212 | 222 |
| 213 } } // namespace v8::internal | 223 } } // namespace v8::internal |
| OLD | NEW |