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

Commit 23a2c8e

Browse files
bhackett1024jasonLaster
authored andcommitted
Add ThreadClient methods for rewinding and reverse-stepping a thread. (#891)
1 parent bf383be commit 23a2c8e

File tree

1 file changed

+50
-5
lines changed
  • packages/devtools-connection/src/debugger

1 file changed

+50
-5
lines changed

packages/devtools-connection/src/debugger/client.js

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,13 +1837,18 @@ ThreadClient.prototype = {
18371837
* An object with a type property set to the appropriate limit (next,
18381838
* step, or finish) per the remote debugging protocol specification.
18391839
* Use null to specify no limit.
1840+
* @param bool aRewind
1841+
* Whether execution should rewind until the limit is reached, rather
1842+
* than proceeding forwards. This parameter has no effect if the
1843+
* server does not support rewinding.
18401844
* @param function aOnResponse
18411845
* Called with the response packet.
18421846
*/
18431847
_doResume: DebuggerClient.requester(
18441848
{
18451849
type: "resume",
18461850
resumeLimit: args(0),
1851+
rewind: args(1)
18471852
},
18481853
{
18491854
before: function(aPacket) {
@@ -1897,7 +1902,7 @@ ThreadClient.prototype = {
18971902
* Resume a paused thread.
18981903
*/
18991904
resume: function(aOnResponse) {
1900-
return this._doResume(null, aOnResponse);
1905+
return this._doResume(null, false, aOnResponse);
19011906
},
19021907

19031908
/**
@@ -1907,7 +1912,17 @@ ThreadClient.prototype = {
19071912
* Called with the response packet.
19081913
*/
19091914
resumeThenPause: function(aOnResponse) {
1910-
return this._doResume({ type: "break" }, aOnResponse);
1915+
return this._doResume({ type: "break" }, false, aOnResponse);
1916+
},
1917+
1918+
/**
1919+
* Rewind a thread.
1920+
*
1921+
* @param function aOnResponse
1922+
* Called with the response packet.
1923+
*/
1924+
rewind: function(aOnResponse) {
1925+
this._doResume(null, true, aOnResponse);
19111926
},
19121927

19131928
/**
@@ -1917,7 +1932,7 @@ ThreadClient.prototype = {
19171932
* Called with the response packet.
19181933
*/
19191934
stepOver: function(aOnResponse) {
1920-
return this._doResume({ type: "next" }, aOnResponse);
1935+
return this._doResume({ type: "next" }, false, aOnResponse);
19211936
},
19221937

19231938
/**
@@ -1927,7 +1942,7 @@ ThreadClient.prototype = {
19271942
* Called with the response packet.
19281943
*/
19291944
stepIn: function(aOnResponse) {
1930-
return this._doResume({ type: "step" }, aOnResponse);
1945+
return this._doResume({ type: "step" }, false, aOnResponse);
19311946
},
19321947

19331948
/**
@@ -1937,7 +1952,37 @@ ThreadClient.prototype = {
19371952
* Called with the response packet.
19381953
*/
19391954
stepOut: function(aOnResponse) {
1940-
return this._doResume({ type: "finish" }, aOnResponse);
1955+
return this._doResume({ type: "finish" }, false, aOnResponse);
1956+
},
1957+
1958+
/**
1959+
* Rewind step over a function call.
1960+
*
1961+
* @param function aOnResponse
1962+
* Called with the response packet.
1963+
*/
1964+
reverseStepOver: function (aOnResponse) {
1965+
return this._doResume({ type: "next" }, true, aOnResponse);
1966+
},
1967+
1968+
/**
1969+
* Rewind step into a function call.
1970+
*
1971+
* @param function aOnResponse
1972+
* Called with the response packet.
1973+
*/
1974+
reverseStepIn: function (aOnResponse) {
1975+
return this._doResume({ type: "step" }, true, aOnResponse);
1976+
},
1977+
1978+
/**
1979+
* Rewind step out of a function call.
1980+
*
1981+
* @param function aOnResponse
1982+
* Called with the response packet.
1983+
*/
1984+
reverseStepOut: function (aOnResponse) {
1985+
return this._doResume({ type: "finish" }, true, aOnResponse);
19411986
},
19421987

19431988
/**

0 commit comments

Comments
 (0)