Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.truffle.api.debug;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import org.graalvm.polyglot.Engine;
import com.oracle.truffle.api.CallTarget;
import com.oracle.truffle.api.TruffleLanguage;
import com.oracle.truffle.api.debug.impl.DebuggerInstrument;
import com.oracle.truffle.api.frame.MaterializedFrame;
import com.oracle.truffle.api.impl.Accessor;
import com.oracle.truffle.api.instrumentation.EventBinding;
import com.oracle.truffle.api.instrumentation.Instrumenter;
import com.oracle.truffle.api.instrumentation.LoadSourceEvent;
import com.oracle.truffle.api.instrumentation.LoadSourceListener;
import com.oracle.truffle.api.instrumentation.SourceFilter;
import com.oracle.truffle.api.instrumentation.TruffleInstrument;
import com.oracle.truffle.api.instrumentation.TruffleInstrument.Env;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.RootNode;
import com.oracle.truffle.api.source.Source;
/**
* Class that simplifies implementing a debugger on top of Truffle. Primarily used to implement
* debugging protocol support.
*
* Access to the (singleton) instance in an engine, is available via:
*
*
{@link Debugger#find(Engine)}
*
{@link Debugger#find(TruffleLanguage.Env)}
*
{@link DebuggerSession#getDebugger()}
*
*
* To start new debugger session use {@link #startSession(SuspendedCallback)}. Please see
* {@link DebuggerSession} for a usage example.
*
* The debugger supports diagnostic tracing that can be enabled using the
* -Dtruffle.debug.trace=true Java property. The output of this tracing is not
* guaranteed and will change without notice.
*
* @see Debugger#startSession(SuspendedCallback)
* @see DebuggerSession
* @see Breakpoint
*
* @since 0.9
*/
public final class Debugger {
/**
* Name of a property that is fired when a list of breakpoints changes.
*
* @since 0.27
* @see #getBreakpoints()
* @see #addPropertyChangeListener(java.beans.PropertyChangeListener)
*/
public static final String PROPERTY_BREAKPOINTS = "breakpoints";
static final boolean TRACE = Boolean.getBoolean("truffle.debug.trace");
private final Env env;
final List