Bug 1053468 - When setting a breakpoint, only resume if we actually interrupted. r=past
authorNick Fitzgerald <fitzgen@gmail.com>
Tue, 26 Aug 2014 12:37:00 +0200
changeset 223750 2498263e8cf71b03bfda1156646c00b27dd2b398
parent 223749 88847ed61a3544fdf05713e34f8a9b45b1cce91a
child 223751 dc6bb1c3bfbc2c5ef2338604244264ad0ff80ab0
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs1053468
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1053468 - When setting a breakpoint, only resume if we actually interrupted. r=past
toolkit/devtools/client/dbg-client.jsm
--- a/toolkit/devtools/client/dbg-client.jsm
+++ b/toolkit/devtools/client/dbg-client.jsm
@@ -1787,17 +1787,23 @@ ThreadClient.prototype = {
     }
     // Otherwise, force a pause in order to set the breakpoint.
     this.interrupt((aResponse) => {
       if (aResponse.error) {
         // Can't set the breakpoint if pausing failed.
         aOnResponse(aResponse);
         return;
       }
-      doSetBreakpoint(this.resume.bind(this));
+
+      const { type, why } = aResponse;
+      const cleanUp = type == "paused" && why.type == "interrupted"
+        ? () => this.resume()
+        : noop;
+
+      doSetBreakpoint(cleanUp);
     });
   },
 
   /**
    * Release multiple thread-lifetime object actors. If any pause-lifetime
    * actors are included in the request, a |notReleasable| error will return,
    * but all the thread-lifetime ones will have been released.
    *