
package org.teavm.debugging;

import java.util.Collections;
import java.util.Map;
import org.teavm.debugging.information.SourceLocation;
import org.teavm.debugging.javascript.JavaScriptCallFrame;
import org.teavm.debugging.javascript.JavaScriptLocation;
import org.teavm.model.MethodReference;

/**
 *
 * @author Alexey Andreev
 */
public class CallFrame {
    private Debugger debugger;
    private JavaScriptCallFrame originalCallFrame;
    private SourceLocation location;
    private MethodReference method;
    private Map<String, Variable> variables;

    CallFrame(Debugger debugger, JavaScriptCallFrame originalFrame, SourceLocation location, MethodReference method,
            Map<String, Variable> variables) {
        this.debugger = debugger;
        this.originalCallFrame = originalFrame;
        this.location = location;
        this.method = method;
        this.variables = Collections.unmodifiableMap(variables);
    }

    public Debugger getDebugger() {
        return debugger;
    }

    public JavaScriptLocation getOriginalLocation() {
        return originalCallFrame.getLocation();
    }

    public JavaScriptCallFrame getOriginalCallFrame() {
        return originalCallFrame;
    }

    public SourceLocation getLocation() {
        return location;
    }

    public MethodReference getMethod() {
        return method;
    }

    public Map<String, Variable> getVariables() {
        return variables;
    }
}
