Bug 1573966 - Fix variable previewing when using cached pause data, r=loganfsmyth.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brian Hackett 2019-08-16 20:55:19 +00:00
Родитель 091f2992d2
Коммит 9c7cf7138d
4 изменённых файлов: 24 добавлений и 9 удалений

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

@ -23,6 +23,16 @@ add_task(async function() {
await stepInToLine(threadFront, 30);
await stepOverToLine(threadFront, 31);
await stepOverToLine(threadFront, 32);
// Check that the scopes pane shows the value of the local variable.
await waitForPaused(dbg);
for (let i = 1; ; i++) {
if (getScopeLabel(dbg, i) == "c") {
is("NaN", getScopeValue(dbg, i));
break;
}
}
await stepOverToLine(threadFront, 33);
await reverseStepOverToLine(threadFront, 32);
await stepOutToLine(threadFront, 27);

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

@ -1097,13 +1097,12 @@ function waitUntilPauseFinishes() {
return;
}
while (true) {
while (gPauseMode != PauseModes.PAUSED) {
gActiveChild.waitUntilPaused();
if (pointEquals(gActiveChild.pausePoint(), gPausePoint)) {
return;
}
pokeChild(gActiveChild);
}
gActiveChild.waitUntilPaused();
}
// Synchronously send a child to the specific point and pause.

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

@ -408,7 +408,7 @@ ReplayDebugger.prototype = {
if (!this._objects[data.id]) {
this._addObject(data);
}
this._getObject(data.id)._names = names;
this._getObject(data.id)._setNames(names);
}
for (const frame of pauseData.frames) {
@ -1297,6 +1297,13 @@ ReplayDebuggerEnvironment.prototype = {
return this._data.optimizedOut;
},
_setNames(names) {
this._names = {};
names.forEach(({ name, value }) => {
this._names[name] = this._dbg._convertValue(value);
});
},
_ensureNames() {
if (!this._names) {
const names = this._dbg._sendRequestAllowDiverge(
@ -1306,10 +1313,7 @@ ReplayDebuggerEnvironment.prototype = {
},
[]
);
this._names = {};
names.forEach(({ name, value }) => {
this._names[name] = this._dbg._convertValue(value);
});
this._setNames(names);
}
},

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

@ -1471,6 +1471,8 @@ function getPauseData() {
const names = getEnvironmentNames(env);
rv.environments[id] = { data, names };
names.forEach(({ value }) => addValue(value, true));
addObject(data.callee);
addEnvironment(data.parent);
}