comparison truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/LineBreakpointFactory.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
109 * Globally suspends all line breakpoint activity when {@code false}, ignoring whether 109 * Globally suspends all line breakpoint activity when {@code false}, ignoring whether
110 * individual breakpoints are enabled. 110 * individual breakpoints are enabled.
111 */ 111 */
112 @CompilationFinal private boolean breakpointsActive = true; 112 @CompilationFinal private boolean breakpointsActive = true;
113 private final CyclicAssumption breakpointsActiveUnchanged = new CyclicAssumption(BREAKPOINT_NAME + " globally active"); 113 private final CyclicAssumption breakpointsActiveUnchanged = new CyclicAssumption(BREAKPOINT_NAME + " globally active");
114 114 private final Debugger debugger;
115 LineBreakpointFactory(BreakpointCallback breakpointCallback, final WarningLog warningLog) { 115
116 LineBreakpointFactory(Debugger debugger, BreakpointCallback breakpointCallback, final WarningLog warningLog) {
117 this.debugger = debugger;
116 this.breakpointCallback = breakpointCallback; 118 this.breakpointCallback = breakpointCallback;
117 this.warningLog = warningLog; 119 this.warningLog = warningLog;
118 120
119 lineToProbesMap = new LineToProbesMap(); 121 lineToProbesMap = new LineToProbesMap();
120 lineToProbesMap.install(); 122 lineToProbesMap.install();
361 } 363 }
362 Instrument newInstrument = null; 364 Instrument newInstrument = null;
363 if (conditionExpr == null) { 365 if (conditionExpr == null) {
364 newInstrument = Instrument.create(new UnconditionalLineBreakInstrumentListener(), BREAKPOINT_NAME); 366 newInstrument = Instrument.create(new UnconditionalLineBreakInstrumentListener(), BREAKPOINT_NAME);
365 } else { 367 } else {
366 newInstrument = Instrument.create(this, Debugger.createAdvancedInstrumentRootFactory(newProbe, conditionExpr, this), Boolean.class, BREAKPOINT_NAME); 368 newInstrument = Instrument.create(this, debugger.createAdvancedInstrumentRootFactory(newProbe, conditionExpr, this), Boolean.class, BREAKPOINT_NAME);
367 } 369 }
368 newProbe.attach(newInstrument); 370 newProbe.attach(newInstrument);
369 instruments.add(newInstrument); 371 instruments.add(newInstrument);
370 changeState(isEnabled ? ENABLED : DISABLED); 372 changeState(isEnabled ? ENABLED : DISABLED);
371 } 373 }