diff graal/com.oracle.truffle.ruby.nodes/src/com/oracle/truffle/ruby/nodes/debug/RubyProxyNode.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 0fbee3eb71f0
children 7bab96d62fa3
line wrap: on
line diff
--- a/graal/com.oracle.truffle.ruby.nodes/src/com/oracle/truffle/ruby/nodes/debug/RubyProxyNode.java	Wed Jan 08 14:00:21 2014 -0800
+++ b/graal/com.oracle.truffle.ruby.nodes/src/com/oracle/truffle/ruby/nodes/debug/RubyProxyNode.java	Wed Jan 08 14:03:36 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. This
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. This
  * code is released under a tri EPL/GPL/LGPL license. You can use it,
  * redistribute it and/or modify it under the terms of the:
  *
@@ -10,6 +10,7 @@
 package com.oracle.truffle.ruby.nodes.debug;
 
 import java.math.*;
+import java.util.*;
 
 import com.oracle.truffle.api.*;
 import com.oracle.truffle.api.frame.*;
@@ -34,9 +35,16 @@
 
     public RubyProxyNode(RubyContext context, RubyNode child) {
         super(context, SourceSection.NULL);
-        this.child = adoptChild(child);
         assert !(child instanceof RubyProxyNode);
-        this.probeChain = new ProbeChain(child.getSourceSection(), null);
+        this.child = adoptChild(child);
+        this.probeChain = context.getDebugManager().getProbeChain(child.getSourceSection());
+    }
+
+    public RubyProxyNode(RubyContext context, RubyNode child, ProbeChain probeChain) {
+        super(context, SourceSection.NULL);
+        assert !(child instanceof RubyProxyNode);
+        this.child = adoptChild(child);
+        this.probeChain = probeChain;
     }
 
     @Override
@@ -189,4 +197,16 @@
         }
     }
 
+    public boolean isMarkedAs(NodePhylum phylum) {
+        return probeChain.isMarkedAs(phylum);
+    }
+
+    public Set<NodePhylum> getPhylumMarks() {
+        return probeChain.getPhylumMarks();
+    }
+
+    public void markAs(NodePhylum phylum) {
+        probeChain.markAs(phylum);
+    }
+
 }