|
30 | 30 | */
|
31 | 31 |
|
32 | 32 | /**
|
33 |
| - * Control over {@link com.oracle.truffle.api.debug.Debugger debugging} of your {@link com.oracle.truffle.api.vm.PolyglotEngine}. Each {@link com.oracle.truffle.api.vm.PolyglotEngine} |
34 |
| - * is inherently capable to run in debugging mode - there is just one thing |
35 |
| - * to do - the {@link com.oracle.truffle.api.vm.PolyglotEngine.Builder creator of the virtual machine} |
36 |
| - * needs to turn debugging on when constructing its polyglot execution engine: |
| 33 | + * Control over {@link com.oracle.truffle.api.debug.Debugger debugging} of your |
| 34 | + * {@link com.oracle.truffle.api.vm.PolyglotEngine}. Each |
| 35 | + * {@link com.oracle.truffle.api.vm.PolyglotEngine} is inherently capable to run in debugging mode - |
| 36 | + * there is just one thing to do - the {@link com.oracle.truffle.api.vm.PolyglotEngine.Builder |
| 37 | + * creator of the virtual machine} needs to turn debugging on when constructing its polyglot |
| 38 | + * execution engine: |
| 39 | + * |
37 | 40 | * <pre>
|
38 | 41 | * vm = {@link com.oracle.truffle.api.vm.PolyglotEngine#buildNew()}.
|
39 | 42 | * {@link com.oracle.truffle.api.vm.PolyglotEngine.Builder#onEvent(com.oracle.truffle.api.vm.EventConsumer) onEvent}(<b>new</b> {@link com.oracle.truffle.api.vm.EventConsumer EventConsumer}
|
|
49 | 52 | * }
|
50 | 53 | * }).{@link com.oracle.truffle.api.vm.PolyglotEngine.Builder#build() build()};
|
51 | 54 | * </pre>
|
52 |
| - * The debugging is controlled by events emitted by the Truffle virtual machine |
53 |
| - * at important moments. The {@link com.oracle.truffle.api.debug.ExecutionEvent} |
54 |
| - * is sent when a call to {@link com.oracle.truffle.api.vm.PolyglotEngine#eval(com.oracle.truffle.api.source.Source)} |
55 |
| - * is made and allows one to configure {@link com.oracle.truffle.api.debug.Breakpoint breakpoints} and/or decide whether the |
56 |
| - * program should {@link com.oracle.truffle.api.debug.ExecutionEvent#prepareStepInto() step-into} or |
57 |
| - * {@link com.oracle.truffle.api.debug.ExecutionEvent#prepareContinue() just run}. Once the execution is suspended a |
58 |
| - * {@link com.oracle.truffle.api.debug.SuspendedEvent} is generated which |
59 |
| - * allows one to inspect the stack and choose the further execution mode |
60 |
| - * ({@link com.oracle.truffle.api.debug.SuspendedEvent#prepareStepInto(int) step-into}, {@link com.oracle.truffle.api.debug.SuspendedEvent#prepareStepOver(int) step-over}, |
61 |
| - * {@link com.oracle.truffle.api.debug.SuspendedEvent#prepareStepOut() step-out}, {@link com.oracle.truffle.api.debug.SuspendedEvent#prepareContinue() continue}). |
| 55 | + * |
| 56 | + * The debugging is controlled by events emitted by the Truffle virtual machine at important |
| 57 | + * moments. The {@link com.oracle.truffle.api.debug.ExecutionEvent} is sent when a call to |
| 58 | + * {@link com.oracle.truffle.api.vm.PolyglotEngine#eval(com.oracle.truffle.api.source.Source)} is |
| 59 | + * made and allows one to configure {@link com.oracle.truffle.api.debug.Breakpoint breakpoints} |
| 60 | + * and/or decide whether the program should |
| 61 | + * {@link com.oracle.truffle.api.debug.ExecutionEvent#prepareStepInto() step-into} or |
| 62 | + * {@link com.oracle.truffle.api.debug.ExecutionEvent#prepareContinue() just run}. Once the |
| 63 | + * execution is suspended a {@link com.oracle.truffle.api.debug.SuspendedEvent} is generated which |
| 64 | + * allows one to inspect the stack and choose the further execution mode ( |
| 65 | + * {@link com.oracle.truffle.api.debug.SuspendedEvent#prepareStepInto(int) step-into}, |
| 66 | + * {@link com.oracle.truffle.api.debug.SuspendedEvent#prepareStepOver(int) step-over}, |
| 67 | + * {@link com.oracle.truffle.api.debug.SuspendedEvent#prepareStepOut() step-out}, |
| 68 | + * {@link com.oracle.truffle.api.debug.SuspendedEvent#prepareContinue() continue}). |
62 | 69 | * <p>
|
63 |
| - * The events methods are only available when the event is being delivered and |
64 |
| - * shouldn't be used anytime later. Both events however provide access to |
65 |
| - * {@link com.oracle.truffle.api.debug.Debugger} which can be kept and used |
66 |
| - * during whole existence of the {@link com.oracle.truffle.api.vm.PolyglotEngine}. |
67 |
| - * {@link com.oracle.truffle.api.debug.Debugger} is the central class that |
68 |
| - * keeps information about {@link com.oracle.truffle.api.debug.Debugger#getBreakpoints() registered breakpoints} |
69 |
| - * and allows one create new {@link com.oracle.truffle.api.debug.Breakpoint ones}. |
| 70 | + * The events methods are only available when the event is being delivered and shouldn't be used |
| 71 | + * anytime later. Both events however provide access to |
| 72 | + * {@link com.oracle.truffle.api.debug.Debugger} which can be kept and used during whole existence |
| 73 | + * of the {@link com.oracle.truffle.api.vm.PolyglotEngine}. |
| 74 | + * {@link com.oracle.truffle.api.debug.Debugger} is the central class that keeps information about |
| 75 | + * {@link com.oracle.truffle.api.debug.Debugger#getBreakpoints() registered breakpoints} and allows |
| 76 | + * one create new {@link com.oracle.truffle.api.debug.Breakpoint ones}. |
70 | 77 | *
|
71 | 78 | * <h4>Turning on Stepping Mode</h4>
|
72 | 79 | *
|
73 | 80 | * In case you want your execution to pause on first statement, register for
|
74 |
| - * {@link com.oracle.truffle.api.debug.ExecutionEvent} and once delivered |
75 |
| - * call {@link com.oracle.truffle.api.debug.ExecutionEvent#prepareStepInto()}. |
| 81 | + * {@link com.oracle.truffle.api.debug.ExecutionEvent} and once delivered call |
| 82 | + * {@link com.oracle.truffle.api.debug.ExecutionEvent#prepareStepInto()}. |
76 | 83 | *
|
77 | 84 | * <h4>Register a {@link com.oracle.truffle.api.debug.Breakpoint}</h4>
|
78 | 85 | *
|
79 | 86 | * Wait for execution to be started - which generates an
|
80 | 87 | * {@link com.oracle.truffle.api.debug.ExecutionEvent}. Use its
|
81 |
| - * {@link com.oracle.truffle.api.debug.Debugger ev.getDebugger}() |
82 |
| - * methods to submit breakpoints. |
| 88 | + * {@link com.oracle.truffle.api.debug.Debugger ev.getDebugger}() methods to submit breakpoints. |
83 | 89 | *
|
84 | 90 | * <h4>Enable Debugging for your Language</h4>
|
85 | 91 | *
|
86 |
| - * The platform's core support for |
87 |
| - * {@link com.oracle.truffle.api.debug.Debugger debugging} is language-agnostic. A |
88 |
| - * {@link com.oracle.truffle.api.TruffleLanguage language implementation} enables debugging by supplying |
89 |
| - * extra information in every AST that configures debugger behavior for code written in that particular language. |
| 92 | + * The platform's core support for {@link com.oracle.truffle.api.debug.Debugger debugging} is |
| 93 | + * language-agnostic. A {@link com.oracle.truffle.api.TruffleLanguage language implementation} |
| 94 | + * enables debugging by supplying extra information in every AST that configures debugger behavior |
| 95 | + * for code written in that particular language. |
90 | 96 | * <p>
|
91 | 97 | * This extra information is expressed as
|
92 |
| - * {@linkplain com.oracle.truffle.api.source.SourceSection#withTags(java.lang.String...) tags}. |
93 |
| - * The language implementation applies tags to the |
94 |
| - * {@link com.oracle.truffle.api.source.SourceSection source information} associated with |
95 |
| - * {@link com.oracle.truffle.api.nodes.Node nodes} relevant to debugging. |
96 |
| - * At this time the debugger requries two tags for basic behavior; more tags may be required in the future |
97 |
| - * as the debugger acquires more functionality. |
| 98 | + * {@linkplain com.oracle.truffle.api.source.SourceSection#withTags(java.lang.String...) tags}. The |
| 99 | + * language implementation applies tags to the {@link com.oracle.truffle.api.source.SourceSection |
| 100 | + * source information} associated with {@link com.oracle.truffle.api.nodes.Node nodes} relevant to |
| 101 | + * debugging. At this time the debugger requries two tags for basic behavior; more tags may be |
| 102 | + * required in the future as the debugger acquires more functionality. |
98 | 103 | * <ul>
|
99 |
| - * <li>{@link com.oracle.truffle.api.debug.Debugger#HALT_TAG}: must be applied to every Node where the debugger |
100 |
| - * should halt during ordinary <em>stepping</em>. This typically corresponds to "statements" in each language.</li> |
101 |
| - * <li>{@link com.oracle.truffle.api.debug.Debugger#CALL_TAG}: must be applied to every Node where the debugger |
102 |
| - * should halt when either <em>returning</em> or <em>stepping out</em> from a call. This typically corresponds |
103 |
| - * to function/method calls in each language.</li> |
| 104 | + * <li>{@link com.oracle.truffle.api.debug.Debugger#HALT_TAG}: must be applied to every Node where |
| 105 | + * the debugger should halt during ordinary <em>stepping</em>. This typically corresponds to |
| 106 | + * "statements" in each language.</li> |
| 107 | + * <li>{@link com.oracle.truffle.api.debug.Debugger#CALL_TAG}: must be applied to every Node where |
| 108 | + * the debugger should halt when either <em>returning</em> or <em>stepping out</em> from a call. |
| 109 | + * This typically corresponds to function/method calls in each language.</li> |
104 | 110 | * </ul>
|
105 | 111 | */
|
106 | 112 | package com.oracle.truffle.api.debug;
|
107 |
| - |
|
0 commit comments