Commit 3d16060a authored by timothy@apple.com's avatar timothy@apple.com

Fixes a crash when stepping out in the Inspector's debugger.

http://bugs.webkit.org/show_bug.cgi?id=19037

Reviewed by Dan Bernstein.

* page/InspectorController.cpp:
(WebCore::currentCallFrame): Adds a null check of currentCallFrame,
since it can be null. Also returns JSNull to better signify this.
* page/inspector/ScriptsPanel.js: Updates the debugger interface
when stepping so the currentCallFrame isn't accessed when not paused.
Adds a _clearInterface function to remove duplicate code.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1d49bcc3
2008-05-13 Timothy Hatcher <timothy@apple.com>
Fixes a crash when stepping out in the Inspector's debugger.
http://bugs.webkit.org/show_bug.cgi?id=19037
Reviewed by Dan Bernstein.
* page/InspectorController.cpp:
(WebCore::currentCallFrame): Adds a null check of currentCallFrame,
since it can be null. Also returns JSNull to better signify this.
* page/inspector/ScriptsPanel.js: Updates the debugger interface
when stepping so the currentCallFrame isn't accessed when not paused.
Adds a _clearInterface function to remove duplicate code.
2008-05-13 chris fleizach <cfleizach@apple.com>
Reviewed by Beth Dakin
......@@ -828,8 +828,8 @@ static JSValueRef currentCallFrame(JSContextRef ctx, JSObjectRef /*function*/, J
return JSValueMakeUndefined(ctx);
JavaScriptCallFrame* callFrame = controller->currentCallFrame();
if (!callFrame->isValid())
return JSValueMakeUndefined(ctx);
if (!callFrame || !callFrame->isValid())
return JSValueMakeNull(ctx);
ExecState* globalExec = callFrame->execState()->lexicalGlobalObject()->globalExec();
......
......@@ -288,18 +288,13 @@ WebInspector.ScriptsPanel.prototype = {
{
this.visibleView = null;
this._clearCurrentExecutionLine();
if (!InspectorController.debuggerAttached()) {
this._paused = false;
this._waitingToPause = false;
this._stepping = false;
}
this.sidebarPanes.callstack.update(null);
this.sidebarPanes.scopechain.update(null);
this._updateDebuggerButtons();
this._clearInterface();
this.filesSelectElement.removeChildren();
this.functionsSelectElement.removeChildren();
......@@ -564,12 +559,23 @@ WebInspector.ScriptsPanel.prototype = {
}
},
_clearInterface: function()
{
this.sidebarPanes.callstack.update(null);
this.sidebarPanes.scopechain.update(null);
this._clearCurrentExecutionLine();
this._updateDebuggerButtons();
},
_toggleDebugging: function()
{
this._paused = false;
this._waitingToPause = false;
this._stepping = false;
this._clearInterface();
if (InspectorController.debuggerAttached()) {
this.element.appendChild(this.attachOverlayElement);
InspectorController.stopDebugging();
......@@ -577,12 +583,6 @@ WebInspector.ScriptsPanel.prototype = {
this.attachOverlayElement.parentNode.removeChild(this.attachOverlayElement);
InspectorController.startDebuggingAndReloadInspectedPage();
}
this.sidebarPanes.callstack.update(null);
this.sidebarPanes.scopechain.update(null);
this._clearCurrentExecutionLine();
this._updateDebuggerButtons();
},
_togglePause: function()
......@@ -597,11 +597,7 @@ WebInspector.ScriptsPanel.prototype = {
InspectorController.pauseInDebugger();
}
this.sidebarPanes.callstack.update(null);
this.sidebarPanes.scopechain.update(null);
this._clearCurrentExecutionLine();
this._updateDebuggerButtons();
this._clearInterface();
},
_stepOverClicked: function()
......@@ -609,6 +605,8 @@ WebInspector.ScriptsPanel.prototype = {
this._paused = false;
this._stepping = true;
this._clearInterface();
InspectorController.stepOverStatementInDebugger();
},
......@@ -617,6 +615,8 @@ WebInspector.ScriptsPanel.prototype = {
this._paused = false;
this._stepping = true;
this._clearInterface();
InspectorController.stepIntoStatementInDebugger();
},
......@@ -625,6 +625,8 @@ WebInspector.ScriptsPanel.prototype = {
this._paused = false;
this._stepping = true;
this._clearInterface();
InspectorController.stepOutOfFunctionInDebugger();
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment