blob: 9f342f9cf1b500f176744c2f20131bde0401f8d5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
function removeAdd(dbg, g) {
dbg.removeDebuggee(g);
dbg.addDebuggee(g);
switch (dbg.removeDebuggee(g)) {}
}
function newGlobalDebuggerPair(toggleSeq) {
var g = newGlobal();
var dbg = new Debugger;
dbg.addDebuggee(g);
g.eval("" + function f() {
for (var i = 0; i < 100; i++) interruptIf(i == 95);
});
setInterruptCallback(function() {
return true;
});
return [g, dbg];
}
function testEpilogue(toggleSeq) {
var [g, dbg] = newGlobalDebuggerPair(toggleSeq);
dbg.onEnterFrame = function(f) {
f.onPop = function() {
toggleSeq(dbg, g);
}
};
g.f()
}
testEpilogue(removeAdd);
|