Bug 1532779 - Add a helper for dumping the current state of the thread actor. r=loganfsmyth

Differential Revision: https://phabricator.services.mozilla.com/D22178

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jason Laster 2019-03-05 21:48:58 +00:00
Родитель c2edd1c174
Коммит 5b509d2a2c
2 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -22,7 +22,7 @@ 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 },
@ -70,7 +70,8 @@ export function setupHelper(obj: Object) {
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)

Просмотреть файл

@ -1765,6 +1765,13 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
return true;
},
onDump: function() {
return {
pauseOnExceptions: this._options.pauseOnExceptions,
ignoreCaughtExceptions: this._options.ignoreCaughtExceptions,
skipBreakpoints: this.skipBreakpoints,
};
},
});
Object.assign(ThreadActor.prototype.requestTypes, {
@ -1779,6 +1786,7 @@ Object.assign(ThreadActor.prototype.requestTypes, {
"sources": ThreadActor.prototype.onSources,
"threadGrips": ThreadActor.prototype.onThreadGrips,
"skipBreakpoints": ThreadActor.prototype.onSkipBreakpoints,
"dumpThread": ThreadActor.prototype.onDump,
});
exports.ThreadActor = ThreadActor;