2362N/A * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 4378N/A * This source code is provided to illustrate the usage of a given feature 4378N/A * or technique and has been deliberately simplified. Additional steps 4378N/A * required for a production-quality application, such as security checks, 4378N/A * input validation and proper error handling, might not be present in 0N/A * Move this towards being only state and functionality 0N/A * that spans across Sessions (and thus VMs). 0N/A ////////////////// Listener registration ////////////////// 0N/A // Session Listeners 0N/A * Adds a JDIListener 0N/A * Adds a JDIListener - at the specified position 0N/A * Removes a JDIListener 0N/A // App Echo Listeners 0N/A // App Output Listeners 0N/A // App Error Listeners 0N/A // Diagnostic Listeners 0N/A /////////// End Listener Registration ////////////// 0N/A //### We probably don't want this public 0N/A * Get JDI trace mode. 0N/A * Set JDI trace mode. 0N/A * Determine if VM is interrupted, i.e, present and not running. 0N/A// ensureActiveSession(); 0N/A * Return a list of ReferenceType objects for all 0N/A * currently loaded classes and interfaces. 0N/A * Array types are not returned. 0N/A * Return a ReferenceType object for the currently 0N/A * loaded class or interface whose fully-qualified 0N/A * class name is specified, else return null if there 0N/A * In general, we must return a list of types, because 0N/A * multiple class loaders could have loaded a class 0N/A * with the same fully-qualified name. 0N/A * Return a list of ReferenceType objects for all 0N/A * currently loaded classes and interfaces whose name 0N/A * matches the given pattern. The pattern syntax is 0N/A * open to some future revision, but currently consists 0N/A * of a fully-qualified class name in which the first 0N/A * component may optionally be a "*" character, designating 0N/A * an arbitrary prefix. 0N/A // Wildcard matches any leading package name. 0N/A // It's a class name. 0N/A * Return a list of ThreadReference objects corresponding 0N/A * to the threads that are currently active in the VM. 0N/A * A thread is removed from the list just before the 0N/A * thread terminates. 0N/A * Return a list of ThreadGroupReference objects corresponding 0N/A * to the top-level threadgroups that are currently active in the VM. 0N/A * Note that a thread group may be empty, or contain no threads as 0N/A * Return the system threadgroup. 0N/A * Evaluate an expression. 0N/A //### Set a breakpoint on 'main' method. 0N/A //### Would be cleaner if we could just bring up VM already suspended. 0N/A //### Set breakpoint at 'main(java.lang.String[])'. 0N/A * Attach to an existing VM. 0N/A //### Changes made here for connectors have broken the 0N/A //### the 'Session' abstraction. The 'Session.attach()' 0N/A //### method is intended to encapsulate all of the various 0N/A //### ways in which session start-up can fail. (maddox 12/18/98) 0N/A * Now that attaches and launches both go through Connectors, 0N/A * it may be worth creating a new subclass of Session for 0N/A "\n Unable to accept connection to target VM: " +
0N/A * Connect via user specified arguments 0N/A * @return true on success 0N/A // we were launched, use ChildSession 0N/A * Detach from VM. If VM was started by debugger, terminate it. 0N/A //### We must allow the deferred breakpoints to be resolved before 0N/A //### we continue executing the class. We could optimize if there 0N/A //### were no deferred breakpoints outstanding for a particular class. 0N/A //### Can we do this with JDI? 0N/A * Suspend all VM activity. 0N/A //### Is it guaranteed that the interrupt has happened? 0N/A * Resume interrupted VM. 0N/A * A previous step may not have completed on this thread; 0N/A * if so, it gets removed here. 0N/A // We want just the next step event and no others 0N/A //### Need an exception now. Which one to use? 0N/A * ThreadInfo objects -- Allow query of thread status and stack. 0N/A //### Should be weak! (in the value, not the key) 0N/A //### Should not hardcode initial frame count and prefetch here! 0N/A //info = new ThreadInfo(thread, 10, 10); 0N/A * Listen for Session control events. 0N/A for (
int i =
0; i < l.
size(); i++) {
0N/A for (
int i =
0; i < l.
size(); i++) {
0N/A for (
int i =
0; i < l.
size(); i++) {
4123N/A ArrayList<SessionListener> l = new ArrayList<SessionListener>(sessionListeners); 0N/A EventObject evt = new EventObject(this); 0N/A for (int i = 0; i < l.size(); i++) { 4123N/A ((SessionListener)l.get(i)).sessionDeath(evt); 0N/A * Listen for input and output requests from the application 0N/A * being debugged. These are generated only when the debuggee 0N/A * is spawned as a child of the debugger. 0N/A // Don't allow reader to be interrupted -- catch and retry. 0N/A // We must not be holding inputLock here, as the listener 0N/A // that we call to echo a line might call us re-entrantly 0N/A // to provide another line of input. 0N/A // Run in Swing event dispatcher thread. 0N/A for (
int i =
0; i < l.
size(); i++) {
0N/A for (
int i =
0; i < l.
size(); i++) {
0N/A for (
int i =
0; i < l.
size(); i++) {
0N/A for (
int i =
0; i < l.
size(); i++) {