comparison truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/TagBreakpointFactory.java @ 22110:c2cb9f1c8688

Replacing the langClass.newInstance() hack in Debugger with proper way to obtain the language instance
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Wed, 26 Aug 2015 15:22:31 +0200
parents 78c3d3d8d86e
children dc83cc1f94f2 3aad794eec0e
comparison
equal deleted inserted replaced
22109:b5eaddcdf86a 22110:c2cb9f1c8688
100 * Globally suspends all line breakpoint activity when {@code false}, ignoring whether 100 * Globally suspends all line breakpoint activity when {@code false}, ignoring whether
101 * individual breakpoints are enabled. 101 * individual breakpoints are enabled.
102 */ 102 */
103 @CompilationFinal private boolean breakpointsActive = true; 103 @CompilationFinal private boolean breakpointsActive = true;
104 private final CyclicAssumption breakpointsActiveUnchanged = new CyclicAssumption(BREAKPOINT_NAME + " globally active"); 104 private final CyclicAssumption breakpointsActiveUnchanged = new CyclicAssumption(BREAKPOINT_NAME + " globally active");
105 105 private final Debugger debugger;
106 TagBreakpointFactory(BreakpointCallback breakpointCallback, final WarningLog warningLog) { 106
107 TagBreakpointFactory(Debugger debugger, BreakpointCallback breakpointCallback, final WarningLog warningLog) {
108 this.debugger = debugger;
107 this.breakpointCallback = breakpointCallback; 109 this.breakpointCallback = breakpointCallback;
108 this.warningLog = warningLog; 110 this.warningLog = warningLog;
109 111
110 Probe.addProbeListener(new DefaultProbeListener() { 112 Probe.addProbeListener(new DefaultProbeListener() {
111 113
325 } 327 }
326 Instrument newInstrument = null; 328 Instrument newInstrument = null;
327 if (conditionExpr == null) { 329 if (conditionExpr == null) {
328 newInstrument = Instrument.create(new UnconditionalTagBreakInstrumentListener(), BREAKPOINT_NAME); 330 newInstrument = Instrument.create(new UnconditionalTagBreakInstrumentListener(), BREAKPOINT_NAME);
329 } else { 331 } else {
330 newInstrument = Instrument.create(this, Debugger.createAdvancedInstrumentRootFactory(newProbe, conditionExpr, this), Boolean.class, BREAKPOINT_NAME); 332 newInstrument = Instrument.create(this, debugger.createAdvancedInstrumentRootFactory(newProbe, conditionExpr, this), Boolean.class, BREAKPOINT_NAME);
331 } 333 }
332 newProbe.attach(newInstrument); 334 newProbe.attach(newInstrument);
333 instruments.add(newInstrument); 335 instruments.add(newInstrument);
334 changeState(isEnabled ? ENABLED : DISABLED); 336 changeState(isEnabled ? ENABLED : DISABLED);
335 } 337 }