Mercurial > hg > truffle
annotate truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/SuspendedEvent.java @ 22548:6b76a24fffbd default tip
Use all variables: a, b, u,v and x, y
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Thu, 14 Jan 2016 14:20:57 +0100 |
parents | be8a3334434d |
children |
rev | line source |
---|---|
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
1 /* |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
4 * |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. Oracle designates this |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
8 * particular file as subject to the "Classpath" exception as provided |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
9 * by Oracle in the LICENSE file that accompanied this code. |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
10 * |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
15 * accompanied this code). |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
16 * |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU General Public License version |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
20 * |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
22 * or visit www.oracle.com if you need additional information or have any |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
23 * questions. |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
24 */ |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
25 package com.oracle.truffle.api.debug; |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
26 |
22446
5b6e15432aae
Truffle/debugging: minor changes to get "eval" working correctly in some cases
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22275
diff
changeset
|
27 import java.io.IOException; |
22471
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
28 import java.io.PrintStream; |
22446
5b6e15432aae
Truffle/debugging: minor changes to get "eval" working correctly in some cases
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22275
diff
changeset
|
29 import java.util.Collections; |
5b6e15432aae
Truffle/debugging: minor changes to get "eval" working correctly in some cases
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22275
diff
changeset
|
30 import java.util.List; |
5b6e15432aae
Truffle/debugging: minor changes to get "eval" working correctly in some cases
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22275
diff
changeset
|
31 |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
32 import com.oracle.truffle.api.CompilerDirectives; |
22476
4a83dc15e774
Truffle/Debugging: reorganize Debugger/Suspended event to pass stack as FrameInstances; delete FrameDebugDescription
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22471
diff
changeset
|
33 import com.oracle.truffle.api.frame.FrameInstance; |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
34 import com.oracle.truffle.api.frame.MaterializedFrame; |
22157
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22128
diff
changeset
|
35 import com.oracle.truffle.api.instrument.StandardSyntaxTag; |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
36 import com.oracle.truffle.api.nodes.Node; |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
37 |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
38 /** |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22008
diff
changeset
|
39 * This event is delivered to all |
22172
b31dcacfc8ff
Replacing more TruffleVM references in comments with the new PolyglotEngine name
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22128
diff
changeset
|
40 * {@link com.oracle.truffle.api.vm.PolyglotEngine.Builder#onEvent(com.oracle.truffle.api.vm.EventConsumer) |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
41 * registered event handlers} when an execution is suspended on a |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
42 * {@link Debugger#setLineBreakpoint(int, com.oracle.truffle.api.source.LineLocation, boolean) |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
43 * breakpoint} or during {@link #prepareStepInto(int) stepping}. Methods in this event can only be |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
44 * used while the handlers process the event. Then the state of the event becomes invalid and |
22008
02e4cf046653
Providing a bit more meaningful documentation to our recent debugging improvements
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22003
diff
changeset
|
45 * subsequent calls to the event methods yield {@link IllegalStateException}. One can call |
02e4cf046653
Providing a bit more meaningful documentation to our recent debugging improvements
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22003
diff
changeset
|
46 * {@link #getDebugger()} and keep reference to it for as long as necessary. |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
47 */ |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22008
diff
changeset
|
48 @SuppressWarnings("javadoc") |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
49 public final class SuspendedEvent { |
22471
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
50 |
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
51 private static boolean TRACE = false; |
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
52 private static final String TRACE_PREFIX = "EVENT: "; |
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
53 private static final PrintStream OUT = System.out; |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
54 |
22471
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
55 private static void trace(String format, Object... args) { |
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
56 if (TRACE) { |
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
57 OUT.println(TRACE_PREFIX + String.format(format, args)); |
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
58 } |
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
59 } |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
60 |
22471
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
61 private final Debugger debugger; |
22476
4a83dc15e774
Truffle/Debugging: reorganize Debugger/Suspended event to pass stack as FrameInstances; delete FrameDebugDescription
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22471
diff
changeset
|
62 private final Node haltedNode; |
4a83dc15e774
Truffle/Debugging: reorganize Debugger/Suspended event to pass stack as FrameInstances; delete FrameDebugDescription
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22471
diff
changeset
|
63 private final MaterializedFrame haltedFrame; |
4a83dc15e774
Truffle/Debugging: reorganize Debugger/Suspended event to pass stack as FrameInstances; delete FrameDebugDescription
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22471
diff
changeset
|
64 private final List<FrameInstance> stack; |
22471
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
65 private final List<String> warnings; |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
66 |
22476
4a83dc15e774
Truffle/Debugging: reorganize Debugger/Suspended event to pass stack as FrameInstances; delete FrameDebugDescription
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22471
diff
changeset
|
67 SuspendedEvent(Debugger debugger, Node haltedNode, MaterializedFrame haltedFrame, List<FrameInstance> stack, List<String> warnings) { |
22471
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
68 this.debugger = debugger; |
22476
4a83dc15e774
Truffle/Debugging: reorganize Debugger/Suspended event to pass stack as FrameInstances; delete FrameDebugDescription
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22471
diff
changeset
|
69 this.haltedNode = haltedNode; |
4a83dc15e774
Truffle/Debugging: reorganize Debugger/Suspended event to pass stack as FrameInstances; delete FrameDebugDescription
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22471
diff
changeset
|
70 this.haltedFrame = haltedFrame; |
22471
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
71 this.stack = stack; |
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
72 this.warnings = warnings; |
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
73 if (TRACE) { |
22476
4a83dc15e774
Truffle/Debugging: reorganize Debugger/Suspended event to pass stack as FrameInstances; delete FrameDebugDescription
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22471
diff
changeset
|
74 trace("Execution suspended at Node=" + haltedNode); |
22471
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
75 } |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
76 } |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
77 |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
78 /** |
22008
02e4cf046653
Providing a bit more meaningful documentation to our recent debugging improvements
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22003
diff
changeset
|
79 * Debugger associated with the just suspended execution. This debugger remains valid after the |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
80 * event is processed, it is possible and suggested to keep a reference to it and use it any |
22172
b31dcacfc8ff
Replacing more TruffleVM references in comments with the new PolyglotEngine name
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22128
diff
changeset
|
81 * time later when evaluating sources in the {@link com.oracle.truffle.api.vm.PolyglotEngine}. |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
82 * |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
83 * @return instance of debugger associated with the just suspended execution and any subsequent |
22172
b31dcacfc8ff
Replacing more TruffleVM references in comments with the new PolyglotEngine name
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22128
diff
changeset
|
84 * ones in the same {@link com.oracle.truffle.api.vm.PolyglotEngine}. |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
85 */ |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
86 public Debugger getDebugger() { |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
87 return debugger; |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
88 } |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
89 |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
90 public Node getNode() { |
22476
4a83dc15e774
Truffle/Debugging: reorganize Debugger/Suspended event to pass stack as FrameInstances; delete FrameDebugDescription
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22471
diff
changeset
|
91 return haltedNode; |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
92 } |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
93 |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
94 public MaterializedFrame getFrame() { |
22476
4a83dc15e774
Truffle/Debugging: reorganize Debugger/Suspended event to pass stack as FrameInstances; delete FrameDebugDescription
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22471
diff
changeset
|
95 return haltedFrame; |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
96 } |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
97 |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
98 public List<String> getRecentWarnings() { |
22471
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
99 return Collections.unmodifiableList(warnings); |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
100 } |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
101 |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
102 /** |
22172
b31dcacfc8ff
Replacing more TruffleVM references in comments with the new PolyglotEngine name
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22128
diff
changeset
|
103 * Gets the stack frames from the currently halted |
22476
4a83dc15e774
Truffle/Debugging: reorganize Debugger/Suspended event to pass stack as FrameInstances; delete FrameDebugDescription
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22471
diff
changeset
|
104 * {@link com.oracle.truffle.api.vm.PolyglotEngine} execution, not counting the Node and Frame |
4a83dc15e774
Truffle/Debugging: reorganize Debugger/Suspended event to pass stack as FrameInstances; delete FrameDebugDescription
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22471
diff
changeset
|
105 * where halted. |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
106 * |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
107 * @return list of stack frames |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
108 */ |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
109 @CompilerDirectives.TruffleBoundary |
22476
4a83dc15e774
Truffle/Debugging: reorganize Debugger/Suspended event to pass stack as FrameInstances; delete FrameDebugDescription
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22471
diff
changeset
|
110 public List<FrameInstance> getStack() { |
22471
a6c162686d81
Truffle/Language&Debugger: reimplement completely how the execution stack is gathered and communicated; change the signature of TruffelLanguage.evalInContext() to comply.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22451
diff
changeset
|
111 return stack; |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
112 } |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
113 |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
114 /** |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
115 * Prepare to execute in Continue mode when guest language program execution resumes. In this |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
116 * mode: |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
117 * <ul> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
118 * <li>Execution will continue until either: |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
119 * <ol> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
120 * <li>execution arrives at a node to which an enabled breakpoint is attached, |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
121 * <strong>or:</strong></li> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
122 * <li>execution completes.</li> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
123 * </ol> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
124 * </ul> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
125 */ |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
126 public void prepareContinue() { |
22275
141fe31da7a2
Avoiding check for current stack depth on the initialization of debugger. Only when debugger is suspended the real check is needed.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22206
diff
changeset
|
127 debugger.prepareContinue(-1); |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
128 } |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
129 |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
130 /** |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
131 * Prepare to execute in StepInto mode when guest language program execution resumes. In this |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
132 * mode: |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
133 * <ul> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
134 * <li>User breakpoints are disabled.</li> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
135 * <li>Execution will continue until either: |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
136 * <ol> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
137 * <li>execution arrives at a node with the tag {@linkplain StandardSyntaxTag#STATEMENT |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
138 * STATMENT}, <strong>or:</strong></li> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
139 * <li>execution completes.</li> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
140 * </ol> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
141 * <li>StepInto mode persists only through one resumption (i.e. {@code stepIntoCount} steps), |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
142 * and reverts by default to Continue mode.</li> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
143 * </ul> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
144 * |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
145 * @param stepCount the number of times to perform StepInto before halting |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
146 * @throws IllegalArgumentException if the specified number is {@code <= 0} |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
147 */ |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
148 public void prepareStepInto(int stepCount) { |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
149 debugger.prepareStepInto(stepCount); |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
150 } |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
151 |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
152 /** |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
153 * Prepare to execute in StepOut mode when guest language program execution resumes. In this |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
154 * mode: |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
155 * <ul> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
156 * <li>User breakpoints are enabled.</li> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
157 * <li>Execution will continue until either: |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
158 * <ol> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
159 * <li>execution arrives at the nearest enclosing call site on the stack, <strong>or</strong></li> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
160 * <li>execution completes.</li> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
161 * </ol> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
162 * <li>StepOut mode persists only through one resumption, and reverts by default to Continue |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
163 * mode.</li> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
164 * </ul> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
165 */ |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
166 public void prepareStepOut() { |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
167 debugger.prepareStepOut(); |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
168 } |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
169 |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
170 /** |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
171 * Prepare to execute in StepOver mode when guest language program execution resumes. In this |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
172 * mode: |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
173 * <ul> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
174 * <li>Execution will continue until either: |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
175 * <ol> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
176 * <li>execution arrives at a node with the tag {@linkplain StandardSyntaxTag#STATEMENT |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
177 * STATEMENT} when not nested in one or more function/method calls, <strong>or:</strong></li> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
178 * <li>execution arrives at a node to which a breakpoint is attached and when nested in one or |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
179 * more function/method calls, <strong>or:</strong></li> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
180 * <li>execution completes.</li> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
181 * </ol> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
182 * <li>StepOver mode persists only through one resumption (i.e. {@code stepOverCount} steps), |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
183 * and reverts by default to Continue mode.</li> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
184 * </ul> |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
185 * |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
186 * @param stepCount the number of times to perform StepInto before halting |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
187 * @throws IllegalArgumentException if the specified number is {@code <= 0} |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
188 */ |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
189 public void prepareStepOver(int stepCount) { |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
190 debugger.prepareStepOver(stepCount); |
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
191 } |
22206
dc91e9ee752e
SuspendedEvent.eval to let debugger evaluate variables in currently suspended execution context
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22173
diff
changeset
|
192 |
dc91e9ee752e
SuspendedEvent.eval to let debugger evaluate variables in currently suspended execution context
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22173
diff
changeset
|
193 /** |
dc91e9ee752e
SuspendedEvent.eval to let debugger evaluate variables in currently suspended execution context
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22173
diff
changeset
|
194 * Evaluates given code snippet in the context of currently suspended execution. |
dc91e9ee752e
SuspendedEvent.eval to let debugger evaluate variables in currently suspended execution context
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22173
diff
changeset
|
195 * |
dc91e9ee752e
SuspendedEvent.eval to let debugger evaluate variables in currently suspended execution context
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22173
diff
changeset
|
196 * @param code the snippet to evaluate |
22486
be8a3334434d
Truffle/Debugger: restore signature in SuspendedEvent.eval()
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22476
diff
changeset
|
197 * @param frame the frame in which to evaluate the code; { means the current frame at the halted |
be8a3334434d
Truffle/Debugger: restore signature in SuspendedEvent.eval()
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22476
diff
changeset
|
198 * location. |
22206
dc91e9ee752e
SuspendedEvent.eval to let debugger evaluate variables in currently suspended execution context
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22173
diff
changeset
|
199 * @return the computed value |
dc91e9ee752e
SuspendedEvent.eval to let debugger evaluate variables in currently suspended execution context
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22173
diff
changeset
|
200 * @throws IOException in case an evaluation goes wrong |
dc91e9ee752e
SuspendedEvent.eval to let debugger evaluate variables in currently suspended execution context
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22173
diff
changeset
|
201 */ |
22486
be8a3334434d
Truffle/Debugger: restore signature in SuspendedEvent.eval()
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22476
diff
changeset
|
202 public Object eval(String code, FrameInstance frame) throws IOException { |
be8a3334434d
Truffle/Debugger: restore signature in SuspendedEvent.eval()
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
22476
diff
changeset
|
203 return debugger.evalInContext(this, code, frame); |
22206
dc91e9ee752e
SuspendedEvent.eval to let debugger evaluate variables in currently suspended execution context
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22173
diff
changeset
|
204 } |
22003
5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
205 } |