Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/debug/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  breakpoint-oom-01.js   Sprache: JAVA

 
// |jit-test| skip-if: !hasFunction.oomTest

// Test for OOM hitting a breakpoint in a generator.
//
// (The purpose is to test OOM-handling in the code that creates the
// Debugger.Frame object and associates it with the generator object.)

let g = newGlobal({newCompartment: true});
g.eval(`\
    function* gen(x) {  // line 1
        x++;            // 2
        yield x;        // 3
    }                   // 4
`);

let dbg = new Debugger;

// On OOM in the debugger, propagate it to the debuggee.
dbg.uncaughtExceptionHook = exc => exc === "out of memory" ? {throw: exc} : null;

let gw = dbg.addDebuggee(g);
let script = gw.makeDebuggeeValue(g.gen).script;
let hits = 0;
let handler = {
    hit(frame) {
        hits++;
        print("x=", frame.environment.getVariable("x"));
    }
};
for (let offset of script.getLineOffsets(2))
    script.setBreakpoint(offset, handler);

let result;
oomTest(() => {
    hits = 0;
    result = g.gen(1).next();
}, false);
assertEq(hits, 1);
assertEq(result.done, false);
assertEq(result.value, 2);


Messung V0.5
C=93 H=90 G=91

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.