Package org.teavm.debugging.information

Examples of org.teavm.debugging.information.SourceLocation


    }

    private void emitCFG(DebugInformationEmitter emitter, Program program) {
        Map<InstructionLocation, InstructionLocation[]> cfg = ProgramUtils.getLocationCFG(program);
        for (Map.Entry<InstructionLocation, InstructionLocation[]> entry : cfg.entrySet()) {
            SourceLocation location = map(entry.getKey());
            SourceLocation[] successors = new SourceLocation[entry.getValue().length];
            for (int i = 0; i < entry.getValue().length; ++i) {
                successors[i] = map(entry.getValue()[i]);
            }
            emitter.addSuccessors(location, successors);
View Full Code Here


    private static SourceLocation map(InstructionLocation location) {
        if (location == null) {
            return null;
        }
        return new SourceLocation(location.getFileName(), location.getLine());
    }
View Full Code Here

    @Override
    public String getSourceName(Object object) throws CoreException {
        if (object instanceof TeaVMJavaStackFrame) {
            TeaVMJavaStackFrame stackFrame = (TeaVMJavaStackFrame)object;
            SourceLocation location = stackFrame.callFrame.getLocation();
            if (location != null) {
                return location.getFileName();
            }
            JavaScriptLocation jsLocation = stackFrame.callFrame.getOriginalLocation();
            return jsLocation != null ? jsLocation.getScript() : null;
        } else if (object instanceof TeaVMJSStackFrame) {
            TeaVMJSStackFrame stackFrame = (TeaVMJSStackFrame)object;
            JavaScriptLocation location = stackFrame.callFrame.getLocation();
            return location != null ? location.getScript() : null;
        } else {
            return null;
        }
    }
View Full Code Here

TOP

Related Classes of org.teavm.debugging.information.SourceLocation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.