Bug 1248303 - respect break on exceptions flag in subsequent debugger instances r=ejpbruel

This commit is contained in:
James Long 2016-03-16 13:53:34 -04:00
Родитель d414422132
Коммит ccf6949bd1
2 изменённых файлов: 23 добавлений и 19 удалений

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

@ -48,9 +48,7 @@ function attachThread(toolbox) {
let { form: { chromeDebugger, actor } } = target; let { form: { chromeDebugger, actor } } = target;
let threadOptions = { let threadOptions = {
useSourceMaps: Services.prefs.getBoolPref("devtools.debugger.source-maps-enabled"), useSourceMaps: Services.prefs.getBoolPref("devtools.debugger.source-maps-enabled"),
autoBlackBox: Services.prefs.getBoolPref("devtools.debugger.auto-black-box"), autoBlackBox: Services.prefs.getBoolPref("devtools.debugger.auto-black-box")
pauseOnExceptions: Services.prefs.getBoolPref("devtools.debugger.pause-on-exceptions"),
ignoreCaughtExceptions: Services.prefs.getBoolPref("devtools.debugger.ignore-caught-exceptions")
}; };
let handleResponse = (res, threadClient) => { let handleResponse = (res, threadClient) => {
@ -67,6 +65,15 @@ function attachThread(toolbox) {
); );
} }
// These flags need to be set here because the client sends them
// with the `resume` request. We make sure to do this before
// resuming to avoid another interrupt. We can't pass it in with
// `threadOptions` because the resume request will override them.
threadClient.pauseOnExceptions(
Services.prefs.getBoolPref("devtools.debugger.pause-on-exceptions"),
Services.prefs.getBoolPref("devtools.debugger.ignore-caught-exceptions")
);
threadClient.resume(res => { threadClient.resume(res => {
if (res.error === "wrongOrder") { if (res.error === "wrongOrder") {
const box = toolbox.getNotificationBox(); const box = toolbox.getNotificationBox();

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

@ -1864,23 +1864,20 @@ ThreadClient.prototype = {
this._pauseOnExceptions = aPauseOnExceptions; this._pauseOnExceptions = aPauseOnExceptions;
this._ignoreCaughtExceptions = aIgnoreCaughtExceptions; this._ignoreCaughtExceptions = aIgnoreCaughtExceptions;
// If the debuggee is paused, we have to send the flag via a reconfigure
// request.
if (this.paused) {
return this.reconfigure({
pauseOnExceptions: aPauseOnExceptions,
ignoreCaughtExceptions: aIgnoreCaughtExceptions
}, aOnResponse);
}
// Otherwise send the flag using a standard resume request. // Otherwise send the flag using a standard resume request.
return this.interrupt(aResponse => { if(!this.paused) {
if (aResponse.error) { return this.interrupt(aResponse => {
// Can't continue if pausing failed. if (aResponse.error) {
aOnResponse(aResponse); // Can't continue if pausing failed.
return aResponse; aOnResponse(aResponse);
} return aResponse;
return this.resume(aOnResponse); }
}); return this.resume(aOnResponse);
});
}
aOnResponse();
return promise.resolve();
}, },
/** /**