Package com.sun.jdi

Examples of com.sun.jdi.VirtualMachine


    public void suspend() throws DebugException {
        if ( isSuspended() ) {
            return;
        }
        try {
            VirtualMachine vm = getVM();
            if ( vm != null ) {
                vm.suspend();
            }
            suspendThreads();
            setSuspended( true );
            fireSuspendEvent( DebugEvent.CLIENT_REQUEST );
        } catch ( RuntimeException e ) {
View Full Code Here


                e.printStackTrace();
                return -1;
            }

            // override class loader in VM thru an attaching connector
            VirtualMachine vm = ClassLoaderPatcher.hotswapClassLoader(clp, starter.getTransport(), starter.getAddress());
            if (vm == null) {
                process.destroy();
            } else {
              vm.resume();
              vm.dispose();
      }
        }

        // attach VM streams to this streams
        redirectStreams();
View Full Code Here

        } else if ("dt_shmem".equals(transport)) {
            ((Connector.Argument)args.get("name")).setValue(address);
        }

        try {
            VirtualMachine vm = connector.attach(args);
            redefineClass(vm, "java.lang.ClassLoader", getPatchedClassLoader(preProcessorName));
            return vm;
        } catch (IllegalConnectorArgumentsException e) {
            System.err.println("failed to attach to VM ("+transport+", "+address+"):");
            e.printStackTrace();
View Full Code Here

    public VirtualMachine
        launch(Map<String,? extends Connector.Argument> arguments)
        throws IOException, IllegalConnectorArgumentsException,
               VMStartException
    {
        VirtualMachine vm;

        String home = argument(ARG_HOME, arguments).value();
        String options = argument(ARG_OPTIONS, arguments).value();
        String mainClassAndArgs = argument(ARG_MAIN, arguments).value();
        boolean wait = ((BooleanArgumentImpl)argument(ARG_INIT_SUSPEND,
View Full Code Here

        Connector.StringArgument arg = (Connector.StringArgument)args.get("pid");
        arg.setValue(pid);

        System.out.println("Debugger is attaching to: " + pid + " ...");

        VirtualMachine vm = ac.attach(args);

        System.out.println("Attached! Now listing threads ...");

        // list all threads

        for (ThreadReference thr: vm.allThreads()) {
            System.out.println(thr);
        }

        System.out.println("Debugger done.");
    }
View Full Code Here

            return;
        }
        try {
            setSuspended( false );
            resumeThreads();
            VirtualMachine vm = getVM();
            if ( vm != null ) {
                vm.resume();
            }
            if ( fireNotification ) {
                fireResumeEvent( DebugEvent.CLIENT_REQUEST );
            }
        } catch ( VMDisconnectedException e ) {
View Full Code Here

            notSupported( JDIDebugModelMessages.JDIDebugTarget_does_not_support_disconnect );
        }

        try {
            disposeThreadHandler();
            VirtualMachine vm = getVM();
            if ( vm != null ) {
                vm.dispose();
            }
        } catch ( VMDisconnectedException e ) {
            // if the VM disconnects while disconnecting, perform
            // normal disconnect handling
            disconnected();
View Full Code Here

            notSupported( JDIDebugModelMessages.JDIDebugTarget_does_not_support_termination );
        }
        try {
            setTerminating( true );
            disposeThreadHandler();
            VirtualMachine vm = getVM();
            if ( vm != null ) {
                vm.exit( 1 );
            }
            IProcess process = getProcess();
            if ( process != null ) {
                process.terminate();
            }
View Full Code Here

    }

    protected void initializeState() {

        List threads = null;
        VirtualMachine vm = getVM();
        if ( vm != null ) {
            try {
                threads = vm.allThreads();
            } catch ( RuntimeException e ) {
                internalError( e );
            }
            if ( threads != null ) {
                Iterator initialThreads = threads.iterator();
View Full Code Here

    public void suspend() throws DebugException {
        if ( isSuspended() ) {
            return;
        }
        try {
            VirtualMachine vm = getVM();
            if ( vm != null ) {
                vm.suspend();
            }
            suspendThreads();
            setSuspended( true );
            fireSuspendEvent( DebugEvent.CLIENT_REQUEST );
        } catch ( RuntimeException e ) {
View Full Code Here

TOP

Related Classes of com.sun.jdi.VirtualMachine

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.