Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/debug/RubyBreakAfterLineProbe.java @ 13569:1894412de0ed
Ruby: major upgrade in debugging support, mainly for navigation: step, next (passing over calls), return (from enclosing function), etc. Also a few bug fixes.
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Wed, 08 Jan 2014 14:03:36 -0800 |
parents | graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/debug/RubyBreakAfterProbe.java@0fbee3eb71f0 |
children |
comparison
equal
deleted
inserted
replaced
13568:f29a358cf3da | 13569:1894412de0ed |
---|---|
1 /* | |
2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. This | |
3 * code is released under a tri EPL/GPL/LGPL license. You can use it, | |
4 * redistribute it and/or modify it under the terms of the: | |
5 * | |
6 * Eclipse Public License version 1.0 | |
7 * GNU General Public License version 2 | |
8 * GNU Lesser General Public License version 2.1 | |
9 */ | |
10 package com.oracle.truffle.ruby.runtime.debug; | |
11 | |
12 import com.oracle.truffle.api.frame.*; | |
13 import com.oracle.truffle.api.nodes.*; | |
14 import com.oracle.truffle.api.source.*; | |
15 import com.oracle.truffle.ruby.runtime.*; | |
16 | |
17 /** | |
18 * A Ruby probe for halting execution at a line after a child execution method completes. | |
19 */ | |
20 public final class RubyBreakAfterLineProbe extends RubyLineProbe { | |
21 | |
22 /** | |
23 * Creates a probe that will cause a halt when child execution is complete; a {@code oneShot} | |
24 * probe will remove itself the first time it halts. | |
25 */ | |
26 public RubyBreakAfterLineProbe(RubyContext context, SourceLineLocation location, boolean oneShot) { | |
27 super(context, location, oneShot); | |
28 } | |
29 | |
30 @Override | |
31 public void leave(Node astNode, VirtualFrame frame) { | |
32 if (oneShot) { | |
33 // One-shot breakpoints retire after one activation. | |
34 context.getDebugManager().retireLineProbe(location, this); | |
35 } | |
36 context.getDebugManager().haltedAt(astNode, frame.materialize()); | |
37 } | |
38 | |
39 @Override | |
40 public void leave(Node astNode, VirtualFrame frame, boolean result) { | |
41 leave(astNode, frame); | |
42 } | |
43 | |
44 @Override | |
45 public void leave(Node astNode, VirtualFrame frame, int result) { | |
46 leave(astNode, frame); | |
47 } | |
48 | |
49 @Override | |
50 public void leave(Node astNode, VirtualFrame frame, double result) { | |
51 leave(astNode, frame); | |
52 } | |
53 | |
54 @Override | |
55 public void leave(Node astNode, VirtualFrame frame, Object result) { | |
56 leave(astNode, frame); | |
57 } | |
58 | |
59 @Override | |
60 public void leaveExceptional(Node astNode, VirtualFrame frame, Exception e) { | |
61 leave(astNode, frame); | |
62 } | |
63 | |
64 } |