Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
Add ThreadClient methods for rewinding and reverse-stepping a thread. (
Browse files Browse the repository at this point in the history
  • Loading branch information
bhackett1024 authored and jasonLaster committed Jan 10, 2018
1 parent bf383be commit 23a2c8e
Showing 1 changed file with 50 additions and 5 deletions.
55 changes: 50 additions & 5 deletions packages/devtools-connection/src/debugger/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1837,13 +1837,18 @@ ThreadClient.prototype = {
* An object with a type property set to the appropriate limit (next,
* step, or finish) per the remote debugging protocol specification.
* Use null to specify no limit.
* @param bool aRewind
* Whether execution should rewind until the limit is reached, rather
* than proceeding forwards. This parameter has no effect if the
* server does not support rewinding.
* @param function aOnResponse
* Called with the response packet.
*/
_doResume: DebuggerClient.requester(
{
type: "resume",
resumeLimit: args(0),
rewind: args(1)
},
{
before: function(aPacket) {
Expand Down Expand Up @@ -1897,7 +1902,7 @@ ThreadClient.prototype = {
* Resume a paused thread.
*/
resume: function(aOnResponse) {
return this._doResume(null, aOnResponse);
return this._doResume(null, false, aOnResponse);
},

/**
Expand All @@ -1907,7 +1912,17 @@ ThreadClient.prototype = {
* Called with the response packet.
*/
resumeThenPause: function(aOnResponse) {
return this._doResume({ type: "break" }, aOnResponse);
return this._doResume({ type: "break" }, false, aOnResponse);
},

/**
* Rewind a thread.
*
* @param function aOnResponse
* Called with the response packet.
*/
rewind: function(aOnResponse) {
this._doResume(null, true, aOnResponse);
},

/**
Expand All @@ -1917,7 +1932,7 @@ ThreadClient.prototype = {
* Called with the response packet.
*/
stepOver: function(aOnResponse) {
return this._doResume({ type: "next" }, aOnResponse);
return this._doResume({ type: "next" }, false, aOnResponse);
},

/**
Expand All @@ -1927,7 +1942,7 @@ ThreadClient.prototype = {
* Called with the response packet.
*/
stepIn: function(aOnResponse) {
return this._doResume({ type: "step" }, aOnResponse);
return this._doResume({ type: "step" }, false, aOnResponse);
},

/**
Expand All @@ -1937,7 +1952,37 @@ ThreadClient.prototype = {
* Called with the response packet.
*/
stepOut: function(aOnResponse) {
return this._doResume({ type: "finish" }, aOnResponse);
return this._doResume({ type: "finish" }, false, aOnResponse);
},

/**
* Rewind step over a function call.
*
* @param function aOnResponse
* Called with the response packet.
*/
reverseStepOver: function (aOnResponse) {
return this._doResume({ type: "next" }, true, aOnResponse);
},

/**
* Rewind step into a function call.
*
* @param function aOnResponse
* Called with the response packet.
*/
reverseStepIn: function (aOnResponse) {
return this._doResume({ type: "step" }, true, aOnResponse);
},

/**
* Rewind step out of a function call.
*
* @param function aOnResponse
* Called with the response packet.
*/
reverseStepOut: function (aOnResponse) {
return this._doResume({ type: "finish" }, true, aOnResponse);
},

/**
Expand Down

0 comments on commit 23a2c8e

Please sign in to comment.