Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1010 // Clear all current stepping setup. | 1010 // Clear all current stepping setup. |
| 1011 ClearStepping(); | 1011 ClearStepping(); |
| 1012 | 1012 |
| 1013 if (thread_local_.queued_step_count_ > 0) { | 1013 if (thread_local_.queued_step_count_ > 0) { |
| 1014 // Perform queued steps | 1014 // Perform queued steps |
| 1015 int step_count = thread_local_.queued_step_count_; | 1015 int step_count = thread_local_.queued_step_count_; |
| 1016 | 1016 |
| 1017 // Clear queue | 1017 // Clear queue |
| 1018 thread_local_.queued_step_count_ = 0; | 1018 thread_local_.queued_step_count_ = 0; |
| 1019 | 1019 |
| 1020 PrepareStep(StepNext, step_count); | 1020 PrepareStep(StepNext, step_count, StackFrame::NO_ID); |
| 1021 } else { | 1021 } else { |
| 1022 // Notify the debug event listeners. | 1022 // Notify the debug event listeners. |
| 1023 isolate_->debugger()->OnDebugBreak(break_points_hit, false); | 1023 isolate_->debugger()->OnDebugBreak(break_points_hit, false); |
| 1024 } | 1024 } |
| 1025 } else if (thread_local_.last_step_action_ != StepNone) { | 1025 } else if (thread_local_.last_step_action_ != StepNone) { |
| 1026 // Hold on to last step action as it is cleared by the call to | 1026 // Hold on to last step action as it is cleared by the call to |
| 1027 // ClearStepping. | 1027 // ClearStepping. |
| 1028 StepAction step_action = thread_local_.last_step_action_; | 1028 StepAction step_action = thread_local_.last_step_action_; |
| 1029 int step_count = thread_local_.step_count_; | 1029 int step_count = thread_local_.step_count_; |
| 1030 | 1030 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 1048 | 1048 |
| 1049 // Set up for StepOut to reach target frame. | 1049 // Set up for StepOut to reach target frame. |
| 1050 step_action = StepOut; | 1050 step_action = StepOut; |
| 1051 step_count = count; | 1051 step_count = count; |
| 1052 } | 1052 } |
| 1053 | 1053 |
| 1054 // Clear all current stepping setup. | 1054 // Clear all current stepping setup. |
| 1055 ClearStepping(); | 1055 ClearStepping(); |
| 1056 | 1056 |
| 1057 // Set up for the remaining steps. | 1057 // Set up for the remaining steps. |
| 1058 PrepareStep(step_action, step_count); | 1058 PrepareStep(step_action, step_count, StackFrame::NO_ID); |
| 1059 } | 1059 } |
| 1060 | 1060 |
| 1061 if (thread_local_.frame_drop_mode_ == FRAMES_UNTOUCHED) { | 1061 if (thread_local_.frame_drop_mode_ == FRAMES_UNTOUCHED) { |
| 1062 SetAfterBreakTarget(frame); | 1062 SetAfterBreakTarget(frame); |
| 1063 } else if (thread_local_.frame_drop_mode_ == | 1063 } else if (thread_local_.frame_drop_mode_ == |
| 1064 FRAME_DROPPED_IN_IC_CALL) { | 1064 FRAME_DROPPED_IN_IC_CALL) { |
| 1065 // We must have been calling IC stub. Do not go there anymore. | 1065 // We must have been calling IC stub. Do not go there anymore. |
| 1066 Code* plain_return = isolate_->builtins()->builtin( | 1066 Code* plain_return = isolate_->builtins()->builtin( |
| 1067 Builtins::kPlainReturn_LiveEdit); | 1067 Builtins::kPlainReturn_LiveEdit); |
| 1068 thread_local_.after_break_target_ = plain_return->entry(); | 1068 thread_local_.after_break_target_ = plain_return->entry(); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1369 | 1369 |
| 1370 bool Debug::IsBreakOnException(ExceptionBreakType type) { | 1370 bool Debug::IsBreakOnException(ExceptionBreakType type) { |
| 1371 if (type == BreakUncaughtException) { | 1371 if (type == BreakUncaughtException) { |
| 1372 return break_on_uncaught_exception_; | 1372 return break_on_uncaught_exception_; |
| 1373 } else { | 1373 } else { |
| 1374 return break_on_exception_; | 1374 return break_on_exception_; |
| 1375 } | 1375 } |
| 1376 } | 1376 } |
| 1377 | 1377 |
| 1378 | 1378 |
| 1379 void Debug::PrepareStep(StepAction step_action, int step_count) { | 1379 void Debug::PrepareStep(StepAction step_action, int step_count, |
| 1380 StackFrame::Id frame_id) { | |
|
Yang
2013/09/05 15:19:54
same here, just put one argument per line.
Peter.Rybin
2013/09/05 16:58:21
Done.
| |
| 1380 HandleScope scope(isolate_); | 1381 HandleScope scope(isolate_); |
| 1381 | 1382 |
| 1382 PrepareForBreakPoints(); | 1383 PrepareForBreakPoints(); |
| 1383 | 1384 |
| 1384 ASSERT(Debug::InDebugger()); | 1385 ASSERT(Debug::InDebugger()); |
| 1385 | 1386 |
| 1386 // Remember this step action and count. | 1387 // Remember this step action and count. |
| 1387 thread_local_.last_step_action_ = step_action; | 1388 thread_local_.last_step_action_ = step_action; |
| 1388 if (step_action == StepOut) { | 1389 if (step_action == StepOut) { |
| 1389 // For step out target frame will be found on the stack so there is no need | 1390 // For step out target frame will be found on the stack so there is no need |
| 1390 // to set step counter for it. It's expected to always be 0 for StepOut. | 1391 // to set step counter for it. It's expected to always be 0 for StepOut. |
| 1391 thread_local_.step_count_ = 0; | 1392 thread_local_.step_count_ = 0; |
| 1392 } else { | 1393 } else { |
| 1393 thread_local_.step_count_ = step_count; | 1394 thread_local_.step_count_ = step_count; |
| 1394 } | 1395 } |
| 1395 | 1396 |
| 1396 // Get the frame where the execution has stopped and skip the debug frame if | 1397 // Get the frame where the execution has stopped and skip the debug frame if |
| 1397 // any. The debug frame will only be present if execution was stopped due to | 1398 // any. The debug frame will only be present if execution was stopped due to |
| 1398 // hitting a break point. In other situations (e.g. unhandled exception) the | 1399 // hitting a break point. In other situations (e.g. unhandled exception) the |
| 1399 // debug frame is not present. | 1400 // debug frame is not present. |
| 1400 StackFrame::Id id = break_frame_id(); | 1401 StackFrame::Id id = break_frame_id(); |
| 1401 if (id == StackFrame::NO_ID) { | 1402 if (id == StackFrame::NO_ID) { |
| 1402 // If there is no JavaScript stack don't do anything. | 1403 // If there is no JavaScript stack don't do anything. |
| 1403 return; | 1404 return; |
| 1404 } | 1405 } |
| 1406 if (frame_id != StackFrame::NO_ID) { | |
| 1407 id = frame_id; | |
| 1408 } | |
| 1405 JavaScriptFrameIterator frames_it(isolate_, id); | 1409 JavaScriptFrameIterator frames_it(isolate_, id); |
| 1406 JavaScriptFrame* frame = frames_it.frame(); | 1410 JavaScriptFrame* frame = frames_it.frame(); |
| 1407 | 1411 |
| 1408 // First of all ensure there is one-shot break points in the top handler | 1412 // First of all ensure there is one-shot break points in the top handler |
| 1409 // if any. | 1413 // if any. |
| 1410 FloodHandlerWithOneShot(); | 1414 FloodHandlerWithOneShot(); |
| 1411 | 1415 |
| 1412 // If the function on the top frame is unresolved perform step out. This will | 1416 // If the function on the top frame is unresolved perform step out. This will |
| 1413 // be the case when calling unknown functions and having the debugger stopped | 1417 // be the case when calling unknown functions and having the debugger stopped |
| 1414 // in an unhandled exception. | 1418 // in an unhandled exception. |
| (...skipping 2431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3846 { | 3850 { |
| 3847 Locker locker(reinterpret_cast<v8::Isolate*>(isolate_)); | 3851 Locker locker(reinterpret_cast<v8::Isolate*>(isolate_)); |
| 3848 isolate_->debugger()->CallMessageDispatchHandler(); | 3852 isolate_->debugger()->CallMessageDispatchHandler(); |
| 3849 } | 3853 } |
| 3850 } | 3854 } |
| 3851 } | 3855 } |
| 3852 | 3856 |
| 3853 #endif // ENABLE_DEBUGGER_SUPPORT | 3857 #endif // ENABLE_DEBUGGER_SUPPORT |
| 3854 | 3858 |
| 3855 } } // namespace v8::internal | 3859 } } // namespace v8::internal |
| OLD | NEW |