Examples of PyDebugTarget


Examples of org.python.pydev.debug.model.PyDebugTarget

            contentAssist.setInformationControlCreator(PyContentAssistant.createInformationControlCreator(viewer));
            ILaunch launch = process.getLaunch();
            IDebugTarget debugTarget = launch.getDebugTarget();
            IInterpreterInfo projectInterpreter = null;
            if (debugTarget instanceof PyDebugTarget) {
                PyDebugTarget pyDebugTarget = (PyDebugTarget) debugTarget;
                PythonNature nature = PythonNature.getPythonNature(pyDebugTarget.project);
                if (nature != null) {
                    try {
                        projectInterpreter = nature.getProjectInterpreter();
                    } catch (Throwable e1) {
View Full Code Here

Examples of org.python.pydev.debug.model.PyDebugTarget

        HashMap<Object, Object> processAttributes = new HashMap<Object, Object>();
        processAttributes.put(IProcess.ATTR_CMDLINE, config.getCommandLineAsString());
        processAttributes.put(Constants.PYDEV_DEBUG_IPROCESS_ATTR, Constants.PYDEV_DEBUG_IPROCESS_ATTR_TRUE);

        //Set the debug target before registering with the debug plugin (we want it before creating the console).
        PyDebugTarget t = new PyDebugTarget(launch, null, config.resource, debugger, config.project);
        IProcess process;
        try {
            process = registerWithDebugPluginForProcessType(config.getRunningName(), launch, p, processAttributes,
                    config);
            t.process = process;
        } finally {
            t.finishedInit = true;
        }

        subMonitor.subTask("Waiting for connection...");
        Socket socket = null;
        try {
            socket = debugger.waitForConnect(subMonitor, p, process);
            if (socket == null) {
                debugger.dispose();
                return;
            }
        } catch (Exception ex) {
            process.terminate();
            p.destroy();
            String message = "Unexpected error setting up the debugger";
            if (ex instanceof SocketTimeoutException)
                message = "Timed out after " + Float.toString(config.acceptTimeout / 1000)
                        + " seconds while waiting for python script to connect.";
            throw new CoreException(PydevDebugPlugin.makeStatus(IStatus.ERROR, message, ex));
        }
        subMonitor.subTask("Done");
        // hook up debug model, and we are off & running
        launch.setSourceLocator(new PySourceLocator());
        t.startTransmission(socket); // this starts reading/writing from sockets
        t.initialize();
        t.addConsoleInputListener();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.