1 /*
2 * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
232 * will be suspended once again. Note that any threads started during
233 * the single threaded invocation will not be suspended when the
234 * invocation completes.
235 * <p>
236 * If the target VM is disconnected during the invoke (for example, through
237 * {@link VirtualMachine#dispose}) the method invocation continues.
238 *
239 * @param thread the thread in which to invoke.
240 * @param method the {@link Method} to invoke.
241 * @param arguments the list of {@link Value} arguments bound to the
242 * invoked method. Values from the list are assigned to arguments
243 * in the order they appear in the method signature.
244 * @param options the integer bit flag options.
245 * @return a {@link Value} mirror of the invoked method's return value.
246 * @throws java.lang.IllegalArgumentException if the method is not
247 * a member of this object's class, if the size of the argument list
248 * does not match the number of declared arguments for the method,
249 * if the method is a constructor or static initializer, or
250 * if {@link #INVOKE_NONVIRTUAL} is specified and the method is
251 * abstract.
252 * @throws {@link InvalidTypeException} if any argument in the
253 * argument list is not assignable to the corresponding method argument
254 * type.
255 * @throws ClassNotLoadedException if any argument type has not yet been loaded
256 * through the appropriate class loader.
257 * @throws IncompatibleThreadStateException if the specified thread has not
258 * been suspended by an event.
259 * @throws InvocationException if the method invocation resulted in
260 * an exception in the target VM.
261 * @throws InvalidTypeException If the arguments do not meet this requirement --
262 * Object arguments must be assignment compatible with the argument
263 * type. This implies that the argument type must be
264 * loaded through the enclosing class's class loader.
265 * Primitive arguments must be either assignment compatible with the
266 * argument type or must be convertible to the argument type without loss
267 * of information. See JLS section 5.2 for more information on assignment
268 * compatibility.
269 * @throws VMCannotBeModifiedException if the VirtualMachine is read-only - see {@link VirtualMachine#canBeModified()}.
270 */
271 Value invokeMethod(ThreadReference thread, Method method,
272 List<? extends Value> arguments, int options)
273 throws InvalidTypeException,
274 ClassNotLoadedException,
|
1 /*
2 * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
232 * will be suspended once again. Note that any threads started during
233 * the single threaded invocation will not be suspended when the
234 * invocation completes.
235 * <p>
236 * If the target VM is disconnected during the invoke (for example, through
237 * {@link VirtualMachine#dispose}) the method invocation continues.
238 *
239 * @param thread the thread in which to invoke.
240 * @param method the {@link Method} to invoke.
241 * @param arguments the list of {@link Value} arguments bound to the
242 * invoked method. Values from the list are assigned to arguments
243 * in the order they appear in the method signature.
244 * @param options the integer bit flag options.
245 * @return a {@link Value} mirror of the invoked method's return value.
246 * @throws java.lang.IllegalArgumentException if the method is not
247 * a member of this object's class, if the size of the argument list
248 * does not match the number of declared arguments for the method,
249 * if the method is a constructor or static initializer, or
250 * if {@link #INVOKE_NONVIRTUAL} is specified and the method is
251 * abstract.
252 * @throws ClassNotLoadedException if any argument type has not yet been loaded
253 * through the appropriate class loader.
254 * @throws IncompatibleThreadStateException if the specified thread has not
255 * been suspended by an event.
256 * @throws InvocationException if the method invocation resulted in
257 * an exception in the target VM.
258 * @throws InvalidTypeException If the arguments do not meet this requirement --
259 * Object arguments must be assignment compatible with the argument
260 * type. This implies that the argument type must be
261 * loaded through the enclosing class's class loader.
262 * Primitive arguments must be either assignment compatible with the
263 * argument type or must be convertible to the argument type without loss
264 * of information. See JLS section 5.2 for more information on assignment
265 * compatibility.
266 * @throws VMCannotBeModifiedException if the VirtualMachine is read-only - see {@link VirtualMachine#canBeModified()}.
267 */
268 Value invokeMethod(ThreadReference thread, Method method,
269 List<? extends Value> arguments, int options)
270 throws InvalidTypeException,
271 ClassNotLoadedException,
|