зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1248303 - respect break on exceptions flag in subsequent debugger instances r=ejpbruel
This commit is contained in:
Родитель
d414422132
Коммит
ccf6949bd1
|
@ -48,9 +48,7 @@ function attachThread(toolbox) {
|
|||
let { form: { chromeDebugger, actor } } = target;
|
||||
let threadOptions = {
|
||||
useSourceMaps: Services.prefs.getBoolPref("devtools.debugger.source-maps-enabled"),
|
||||
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")
|
||||
autoBlackBox: Services.prefs.getBoolPref("devtools.debugger.auto-black-box")
|
||||
};
|
||||
|
||||
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 => {
|
||||
if (res.error === "wrongOrder") {
|
||||
const box = toolbox.getNotificationBox();
|
||||
|
|
|
@ -1864,23 +1864,20 @@ ThreadClient.prototype = {
|
|||
this._pauseOnExceptions = aPauseOnExceptions;
|
||||
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.
|
||||
return this.interrupt(aResponse => {
|
||||
if (aResponse.error) {
|
||||
// Can't continue if pausing failed.
|
||||
aOnResponse(aResponse);
|
||||
return aResponse;
|
||||
}
|
||||
return this.resume(aOnResponse);
|
||||
});
|
||||
if(!this.paused) {
|
||||
return this.interrupt(aResponse => {
|
||||
if (aResponse.error) {
|
||||
// Can't continue if pausing failed.
|
||||
aOnResponse(aResponse);
|
||||
return aResponse;
|
||||
}
|
||||
return this.resume(aOnResponse);
|
||||
});
|
||||
}
|
||||
|
||||
aOnResponse();
|
||||
return promise.resolve();
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче