/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* An AttachingConnector that connects to a debuggee by specifying the process
* id (pid) as the connector argument. If the process is a debuggee listening
* on a transport address then this connector reads the transport address
* and attempts to attach to it using the appropriate transport.
*/
public class ProcessAttachingConnector
extends ConnectorImpl implements AttachingConnector
{
/*
* The arguments that this connector supports
*/
public ProcessAttachingConnector() {
getString("process_attaching.pid.label"),
getString("process_attaching.pid"),
"",
true);
"",
false,
return "local";
}
};
}
/**
* Attach to a target VM using the specified address and Connector arguments.
*/
{
int timeout = 0;
if (t.length() > 0) {
}
// Use Attach API to attach to target VM and read value of
// sun.jdwp.listenAddress property.
try {
} catch (Exception x) {
throw new IOException(x.getMessage());
} finally {
}
// check that the property value is formatted correctly
throw new IOException("Not a debuggee, or not listening for debugger to attach");
}
if (pos < 1) {
throw new IOException("Unable to determine transport endpoint");
}
// parse into transport library name and address
ts = new SocketTransportService();
} else {
try {
} catch (Exception x) { }
}
}
}
// connect to the debuggee
}
return "com.sun.jdi.ProcessAttach";
}
return getString("process_attaching.description");
}
return new Transport() {
return "local";
}
};
}
return transport;
}
}