Mercurial > hg > truffle
comparison truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/LineToProbesMap.java @ 22219:1c0f490984d5
Merge with f47b601edbc626dcfe8b3636933b4834c89f7779
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Wed, 16 Sep 2015 15:36:22 -0700 |
parents | dc83cc1f94f2 3aad794eec0e |
children | c92d6117696f |
comparison
equal
deleted
inserted
replaced
22160:0599e2df6a9f | 22219:1c0f490984d5 |
---|---|
22 * or visit www.oracle.com if you need additional information or have any | 22 * or visit www.oracle.com if you need additional information or have any |
23 * questions. | 23 * questions. |
24 */ | 24 */ |
25 package com.oracle.truffle.api.debug; | 25 package com.oracle.truffle.api.debug; |
26 | 26 |
27 import java.io.PrintStream; | |
28 import java.util.ArrayList; | |
29 import java.util.Collection; | |
30 import java.util.Collections; | |
31 import java.util.HashMap; | |
32 import java.util.Map; | |
33 | |
27 import com.oracle.truffle.api.instrument.InstrumentationTool; | 34 import com.oracle.truffle.api.instrument.InstrumentationTool; |
28 import com.oracle.truffle.api.instrument.Probe; | 35 import com.oracle.truffle.api.instrument.Probe; |
29 import com.oracle.truffle.api.instrument.ProbeListener; | 36 import com.oracle.truffle.api.instrument.ProbeListener; |
30 import com.oracle.truffle.api.instrument.impl.DefaultProbeListener; | 37 import com.oracle.truffle.api.instrument.impl.DefaultProbeListener; |
31 import com.oracle.truffle.api.source.LineLocation; | 38 import com.oracle.truffle.api.source.LineLocation; |
32 import com.oracle.truffle.api.source.Source; | 39 import com.oracle.truffle.api.source.Source; |
33 import com.oracle.truffle.api.source.SourceSection; | 40 import com.oracle.truffle.api.source.SourceSection; |
34 import java.io.PrintStream; | |
35 import java.util.ArrayList; | |
36 import java.util.Collection; | |
37 import java.util.Collections; | |
38 import java.util.HashMap; | |
39 import java.util.Map; | |
40 | 41 |
41 /** | 42 /** |
42 * An {@link InstrumentationTool} that builds a map of every {@link Probe} attached to some AST, | 43 * An {@link InstrumentationTool} that builds a map of every {@link Probe} attached to some AST, |
43 * indexed by {@link Source} and line number. | 44 * indexed by {@link Source} and line number. |
44 */ | 45 */ |
66 this.probeListener = new LineToProbesListener(); | 67 this.probeListener = new LineToProbesListener(); |
67 } | 68 } |
68 | 69 |
69 @Override | 70 @Override |
70 protected boolean internalInstall() { | 71 protected boolean internalInstall() { |
71 Probe.addProbeListener(probeListener); | 72 getInstrumenter().addProbeListener(probeListener); |
72 return true; | 73 return true; |
73 } | 74 } |
74 | 75 |
75 @Override | 76 @Override |
76 protected void internalReset() { | 77 protected void internalReset() { |
77 lineToProbesMap.clear(); | 78 lineToProbesMap.clear(); |
78 } | 79 } |
79 | 80 |
80 @Override | 81 @Override |
81 protected void internalDispose() { | 82 protected void internalDispose() { |
82 Probe.removeProbeListener(probeListener); | 83 getInstrumenter().removeProbeListener(probeListener); |
83 } | 84 } |
84 | 85 |
85 /** | 86 /** |
86 * Returns the {@link Probe}, if any, associated with a specific line of guest language code; if | 87 * Returns the {@link Probe}, if any, associated with a specific line of guest language code; if |
87 * more than one, return the one with the first starting character location. | 88 * more than one, return the one with the first starting character location. |