| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 | 780 |
| 781 void InspectorDebuggerAgent::resume(ErrorString* errorString) | 781 void InspectorDebuggerAgent::resume(ErrorString* errorString) |
| 782 { | 782 { |
| 783 if (!assertPaused(errorString)) | 783 if (!assertPaused(errorString)) |
| 784 return; | 784 return; |
| 785 m_debuggerStepScheduled = false; | 785 m_debuggerStepScheduled = false; |
| 786 m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtrac
eObjectGroup); | 786 m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtrac
eObjectGroup); |
| 787 scriptDebugServer().continueProgram(); | 787 scriptDebugServer().continueProgram(); |
| 788 } | 788 } |
| 789 | 789 |
| 790 ScriptValue InspectorDebuggerAgent::resolveCallFrame(ErrorString* errorString, c
onst String* callFrameId) | 790 void InspectorDebuggerAgent::stepOver(ErrorString* errorString) |
| 791 { | |
| 792 if (!callFrameId) | |
| 793 return ScriptValue(); | |
| 794 if (!isPaused() || m_currentCallStack.isEmpty()) { | |
| 795 *errorString = "Attempt to access callframe when debugger is not on paus
e"; | |
| 796 return ScriptValue(); | |
| 797 } | |
| 798 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForOb
jectId(*callFrameId); | |
| 799 if (injectedScript.isEmpty()) { | |
| 800 *errorString = "Inspected frame has gone"; | |
| 801 return ScriptValue(); | |
| 802 } | |
| 803 return injectedScript.findCallFrameById(errorString, m_currentCallStack, *ca
llFrameId); | |
| 804 } | |
| 805 | |
| 806 void InspectorDebuggerAgent::stepOver(ErrorString* errorString, const String* ca
llFrameId) | |
| 807 { | 791 { |
| 808 if (!assertPaused(errorString)) | 792 if (!assertPaused(errorString)) |
| 809 return; | 793 return; |
| 810 ScriptValue frame = resolveCallFrame(errorString, callFrameId); | |
| 811 if (!errorString->isEmpty()) | |
| 812 return; | |
| 813 m_debuggerStepScheduled = true; | 794 m_debuggerStepScheduled = true; |
| 814 m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtrac
eObjectGroup); | 795 m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtrac
eObjectGroup); |
| 815 scriptDebugServer().stepOverStatement(frame); | 796 scriptDebugServer().stepOverStatement(); |
| 816 } | 797 } |
| 817 | 798 |
| 818 void InspectorDebuggerAgent::stepInto(ErrorString* errorString) | 799 void InspectorDebuggerAgent::stepInto(ErrorString* errorString) |
| 819 { | 800 { |
| 820 if (!assertPaused(errorString)) | 801 if (!assertPaused(errorString)) |
| 821 return; | 802 return; |
| 822 m_debuggerStepScheduled = true; | 803 m_debuggerStepScheduled = true; |
| 823 m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtrac
eObjectGroup); | 804 m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtrac
eObjectGroup); |
| 824 scriptDebugServer().stepIntoStatement(); | 805 scriptDebugServer().stepIntoStatement(); |
| 825 if (m_listener) | 806 if (m_listener) |
| 826 m_listener->stepInto(); | 807 m_listener->stepInto(); |
| 827 } | 808 } |
| 828 | 809 |
| 829 void InspectorDebuggerAgent::stepOut(ErrorString* errorString, const String* cal
lFrameId) | 810 void InspectorDebuggerAgent::stepOut(ErrorString* errorString) |
| 830 { | 811 { |
| 831 if (!assertPaused(errorString)) | 812 if (!assertPaused(errorString)) |
| 832 return; | 813 return; |
| 833 ScriptValue frame = resolveCallFrame(errorString, callFrameId); | |
| 834 if (!errorString->isEmpty()) | |
| 835 return; | |
| 836 m_debuggerStepScheduled = true; | 814 m_debuggerStepScheduled = true; |
| 837 m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtrac
eObjectGroup); | 815 m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtrac
eObjectGroup); |
| 838 scriptDebugServer().stepOutOfFunction(frame); | 816 scriptDebugServer().stepOutOfFunction(); |
| 839 } | 817 } |
| 840 | 818 |
| 841 void InspectorDebuggerAgent::setPauseOnExceptions(ErrorString* errorString, cons
t String& stringPauseState) | 819 void InspectorDebuggerAgent::setPauseOnExceptions(ErrorString* errorString, cons
t String& stringPauseState) |
| 842 { | 820 { |
| 843 ScriptDebugServer::PauseOnExceptionsState pauseState; | 821 ScriptDebugServer::PauseOnExceptionsState pauseState; |
| 844 if (stringPauseState == "none") | 822 if (stringPauseState == "none") |
| 845 pauseState = ScriptDebugServer::DontPauseOnExceptions; | 823 pauseState = ScriptDebugServer::DontPauseOnExceptions; |
| 846 else if (stringPauseState == "all") | 824 else if (stringPauseState == "all") |
| 847 pauseState = ScriptDebugServer::PauseOnAllExceptions; | 825 pauseState = ScriptDebugServer::PauseOnAllExceptions; |
| 848 else if (stringPauseState == "uncaught") | 826 else if (stringPauseState == "uncaught") |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1277 { | 1255 { |
| 1278 m_scripts.clear(); | 1256 m_scripts.clear(); |
| 1279 m_breakpointIdToDebugServerBreakpointIds.clear(); | 1257 m_breakpointIdToDebugServerBreakpointIds.clear(); |
| 1280 m_asyncCallStackTracker.clear(); | 1258 m_asyncCallStackTracker.clear(); |
| 1281 if (m_frontend) | 1259 if (m_frontend) |
| 1282 m_frontend->globalObjectCleared(); | 1260 m_frontend->globalObjectCleared(); |
| 1283 } | 1261 } |
| 1284 | 1262 |
| 1285 } // namespace WebCore | 1263 } // namespace WebCore |
| 1286 | 1264 |
| OLD | NEW |