Bug 1532779 - Add a helper for dumping the current state of the thread actor. r=loganfsmyth
authorJason Laster <jlaster@mozilla.com>
Tue, 05 Mar 2019 21:48:58 +0000
changeset 520372 23b3b0f1674465a259e68e723ebd74282d6cb16c
parent 520371 fccf1be20f4b93514bf956a7c826c7990b4c89bd
child 520373 a67f7ae048586447c396bb9d28252929175273ac
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersloganfsmyth
bugs1532779
milestone67.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 1532779 - Add a helper for dumping the current state of the thread actor. r=loganfsmyth Differential Revision: https://phabricator.services.mozilla.com/D22178
devtools/client/debugger/new/src/utils/dbg.js
devtools/server/actors/thread.js
--- a/devtools/client/debugger/new/src/utils/dbg.js
+++ b/devtools/client/debugger/new/src/utils/dbg.js
@@ -17,17 +17,17 @@ function findSources(dbg: any, url: stri
   const sources = dbg.selectors.getSourceList();
   return sources.filter(s => (s.url || "").includes(url));
 }
 
 function sendPacket(dbg: any, packet: any, callback: () => void) {
   dbg.client.sendPacket(packet, callback || console.log);
 }
 
-function sendPacketToThread(dbg: Object, packet: any, callback: () => void) {
+function sendPacketToThread(dbg: Object, packet: any, callback: Function = () => {}) {
   sendPacket(
     dbg,
     { to: dbg.connection.tabConnection.threadClient.actor, ...packet },
     callback
   );
 }
 
 function evaluate(dbg: Object, expression: any, callback: () => void) {
@@ -65,17 +65,18 @@ export function setupHelper(obj: Object)
     features,
     timings,
     getCM,
     helpers: {
       findSource: url => findSource(dbg, url),
       findSources: url => findSources(dbg, url),
       evaluate: (expression, cbk) => evaluate(dbg, expression, cbk),
       sendPacketToThread: (packet, cbk) => sendPacketToThread(dbg, packet, cbk),
-      sendPacket: (packet, cbk) => sendPacket(dbg, packet, cbk)
+      sendPacket: (packet, cbk) => sendPacket(dbg, packet, cbk),
+      dumpThread: () => sendPacketToThread(dbg, { type: "dumpThread" })
     },
     formatters: {
       visibleColumnBreakpoints: () => _formatColumnBreapoints(dbg)
     },
     _telemetry: {
       events: {}
     }
   };
--- a/devtools/server/actors/thread.js
+++ b/devtools/server/actors/thread.js
@@ -1760,30 +1760,38 @@ const ThreadActor = ActorClassWithSpec(t
     for (const actor of bpActors) {
       sourceActor.applyBreakpoint(actor);
     }
 
     this._debuggerSourcesSeen.add(source);
     return true;
   },
 
+  onDump: function() {
+    return {
+      pauseOnExceptions: this._options.pauseOnExceptions,
+      ignoreCaughtExceptions: this._options.ignoreCaughtExceptions,
+      skipBreakpoints: this.skipBreakpoints,
+    };
+  },
 });
 
 Object.assign(ThreadActor.prototype.requestTypes, {
   "attach": ThreadActor.prototype.onAttach,
   "detach": ThreadActor.prototype.onDetach,
   "reconfigure": ThreadActor.prototype.onReconfigure,
   "resume": ThreadActor.prototype.onResume,
   "clientEvaluate": ThreadActor.prototype.onClientEvaluate,
   "frames": ThreadActor.prototype.onFrames,
   "interrupt": ThreadActor.prototype.onInterrupt,
   "releaseMany": ThreadActor.prototype.onReleaseMany,
   "sources": ThreadActor.prototype.onSources,
   "threadGrips": ThreadActor.prototype.onThreadGrips,
   "skipBreakpoints": ThreadActor.prototype.onSkipBreakpoints,
+  "dumpThread": ThreadActor.prototype.onDump,
 });
 
 exports.ThreadActor = ThreadActor;
 
 /**
  * Creates a PauseActor.
  *
  * PauseActors exist for the lifetime of a given debuggee pause.  Used to