1 /*
2 * Copyright (c) 1998, 2025, 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
2112 "An implementation may support forcing a return from the current frame "
2113 "of a suspended virtual thread in other cases."
2114 "<p>"
2115 "No further instructions are executed in the called "
2116 "method. Specifically, finally blocks are not executed. Note: "
2117 "this can cause inconsistent states in the application. "
2118 "<p>"
2119 "A lock acquired by calling the called method (if it is a "
2120 "synchronized method) and locks acquired by entering "
2121 "synchronized blocks within the called method are "
2122 "released. Note: this does not apply to JNI locks or "
2123 "java.util.concurrent.locks locks. "
2124 "<p>"
2125 "Events, such as MethodExit, are generated as they would be in "
2126 "a normal return. "
2127 "<p>"
2128 "The called method must be a non-native Java programming "
2129 "language method. Forcing return on a thread with only one "
2130 "frame on the stack causes the thread to exit when resumed. "
2131 "<p>"
2132 "For void methods, the value must be a void value. "
2133 "For methods that return primitive values, the value's type must "
2134 "match the return type exactly. For object values, there must be a "
2135 "widening reference conversion from the value's type to the "
2136 "return type type and the return type must be loaded. "
2137 "<p>"
2138 "Since JDWP version 1.6. Requires canForceEarlyReturn capability - see "
2139 "<a href=\"#JDWP_VirtualMachine_CapabilitiesNew\">CapabilitiesNew</a>."
2140 (Out
2141 (threadObject thread "The thread object ID. ")
2142 (value value "The value to return. ")
2143 )
2144 (Reply "none"
2145 )
2146 (ErrorSet
2147 (Error INVALID_THREAD "The thread is null, not a valid thread, or "
2148 "the thread is not alive.")
2149 (Error INVALID_OBJECT "Thread or value is not a known ID.")
2150 (Error THREAD_NOT_SUSPENDED)
2151 (Error OPAQUE_FRAME "Unable to force the current frame to return "
2152 "(e.g. the current frame is executing a native method).")
2153 (Error NO_MORE_FRAMES)
2154 (Error NOT_IMPLEMENTED)
2155 (Error TYPE_MISMATCH "Value is not an appropriate type for the "
2156 "return value of the method.")
2157 (Error VM_DEAD)
2158 )
2159 )
2160 (Command IsVirtual=15
2161 "Determine if a thread is a "
2162 "<a href=../../api/java.base/java/lang/Thread.html#virtual-threads>virtual thread</a>."
2163 "<p>Since JDWP version 21."
2164 (Out
2165 (threadObject thread "The thread object ID.")
2166 )
2167 (Reply
2168 (boolean isVirtual "true if the thread is a virtual thread.")
2169 )
2170 (ErrorSet
2171 (Error INVALID_THREAD)
2172 (Error INVALID_OBJECT "thread is not a known ID.")
2490 "field access and field modification event kinds only. "
2491
2492 (referenceType declaring "Type in which field is declared.")
2493 (field fieldID "Required field")
2494 )
2495 (Alt Step=10
2496 "Restricts reported step events "
2497 "to those which satisfy "
2498 "depth and size constraints. "
2499 "This modifier can be used with "
2500 "step event kinds only. "
2501
2502 (threadObject thread "Thread in which to step")
2503 (int size "size of each step. "
2504 "See <a href=\"#JDWP_StepSize\">JDWP.StepSize</a>")
2505 (int depth "relative call stack limit. "
2506 "See <a href=\"#JDWP_StepDepth\">JDWP.StepDepth</a>")
2507 )
2508 (Alt InstanceOnly=11
2509 "Restricts reported events to those whose "
2510 "active 'this' object is the given object. "
2511 "Match value is the null object for static methods. "
2512 "This modifier can be used with any event kind "
2513 "except class prepare, class unload, thread start, "
2514 "and thread end. Introduced in JDWP version 1.4."
2515
2516 (object instance "Required 'this' object")
2517 )
2518 (Alt SourceNameMatch=12
2519 "Restricts reported class prepare events to those "
2520 "for reference types which have a source name "
2521 "which matches the given restricted regular expression. "
2522 "The source names are determined by the reference type's "
2523 "<a href=\"#JDWP_ReferenceType_SourceDebugExtension\"> "
2524 "SourceDebugExtension</a>. "
2525 "This modifier can only be used with class prepare "
2526 "events. "
2527 "Since JDWP version 1.6. Requires the canUseSourceNameFilters "
2528 "capability - see "
2529 "<a href=\"#JDWP_VirtualMachine_CapabilitiesNew\">CapabilitiesNew</a>."
2530
2582 (Command ClearAllBreakpoints=3
2583 "Removes all set breakpoints, a no-op if there are no breakpoints set."
2584 (Out "none"
2585 )
2586 (Reply "none"
2587 )
2588 (ErrorSet
2589 (Error VM_DEAD)
2590 )
2591 )
2592 )
2593 (CommandSet StackFrame=16
2594 (Command GetValues=1
2595 "Returns the value of one or more local variables in a "
2596 "given frame. Each variable must be visible at the frame's code index. "
2597 "Even if local variable information is not available, values can "
2598 "be retrieved if the front-end is able to "
2599 "determine the correct local variable index. (Typically, this "
2600 "index can be determined for method arguments from the method "
2601 "signature without access to the local variable table information.) "
2602 (Out
2603 (threadObject thread "The frame's thread. ")
2604 (frame frame "The frame ID. ")
2605 (Repeat slots "The number of values to get. "
2606 (Group SlotInfo
2607 (int slot "The local variable's index in the frame. ")
2608 (byte sigbyte "A <a href=\"#JDWP_Tag\">tag</a> "
2609 "identifying the type of the variable ")
2610 )
2611 )
2612 )
2613 (Reply
2614 (Repeat values "The number of values retrieved, always equal to slots, "
2615 "the number of values to get."
2616 (value slotValue "The value of the local variable. ")
2617 )
2618 )
2619 (ErrorSet
2620 (Error INVALID_THREAD)
2621 (Error INVALID_OBJECT)
2653 (value slotValue "The value to set. ")
2654 )
2655 )
2656 )
2657 (Reply "none"
2658 )
2659 (ErrorSet
2660 (Error INVALID_THREAD)
2661 (Error INVALID_OBJECT)
2662 (Error INVALID_FRAMEID)
2663 (Error INVALID_SLOT)
2664 (Error OPAQUE_FRAME "Unable to set the value of local variables in the frame "
2665 "(e.g. the frame is executing a native method).")
2666 (Error VM_DEAD)
2667 )
2668 )
2669 (Command ThisObject=3
2670 "Returns the value of the 'this' reference for this frame. "
2671 "If the frame's method is static or native, the reply "
2672 "will contain the null object reference. "
2673 (Out
2674 (threadObject thread "The frame's thread. ")
2675 (frame frame "The frame ID. ")
2676 )
2677 (Reply
2678 (tagged-object objectThis "The 'this' object for this frame. ")
2679 )
2680 (ErrorSet
2681 (Error INVALID_THREAD)
2682 (Error INVALID_OBJECT)
2683 (Error INVALID_FRAMEID)
2684 (Error VM_DEAD)
2685 )
2686 )
2687 (Command PopFrames=4
2688 "Pop the top-most stack frames of the thread stack, up to, and including 'frame'. "
2689 "The thread must be suspended to perform this command. "
2690 "The top-most stack frames are discarded and the stack frame previous to 'frame' "
2691 "becomes the current frame. The operand stack is restored -- the argument values "
2692 "are added back and if the invoke was not <code>invokestatic</code>, "
|
1 /*
2 * Copyright (c) 1998, 2026, 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
2112 "An implementation may support forcing a return from the current frame "
2113 "of a suspended virtual thread in other cases."
2114 "<p>"
2115 "No further instructions are executed in the called "
2116 "method. Specifically, finally blocks are not executed. Note: "
2117 "this can cause inconsistent states in the application. "
2118 "<p>"
2119 "A lock acquired by calling the called method (if it is a "
2120 "synchronized method) and locks acquired by entering "
2121 "synchronized blocks within the called method are "
2122 "released. Note: this does not apply to JNI locks or "
2123 "java.util.concurrent.locks locks. "
2124 "<p>"
2125 "Events, such as MethodExit, are generated as they would be in "
2126 "a normal return. "
2127 "<p>"
2128 "The called method must be a non-native Java programming "
2129 "language method. Forcing return on a thread with only one "
2130 "frame on the stack causes the thread to exit when resumed. "
2131 "<p>"
2132 "When preview features are enabled, the method can not be the "
2133 "constructor of a value class."
2134 "<p>"
2135 "For void methods, the value must be a void value. "
2136 "For methods that return primitive values, the value's type must "
2137 "match the return type exactly. For object values, there must be a "
2138 "widening reference conversion from the value's type to the "
2139 "return type type and the return type must be loaded. "
2140 "<p>"
2141 "Since JDWP version 1.6. Requires canForceEarlyReturn capability - see "
2142 "<a href=\"#JDWP_VirtualMachine_CapabilitiesNew\">CapabilitiesNew</a>."
2143 (Out
2144 (threadObject thread "The thread object ID. ")
2145 (value value "The value to return. ")
2146 )
2147 (Reply "none"
2148 )
2149 (ErrorSet
2150 (Error INVALID_THREAD "The thread is null, not a valid thread, or "
2151 "the thread is not alive.")
2152 (Error INVALID_OBJECT "Thread or value is not a known ID.")
2153 (Error THREAD_NOT_SUSPENDED)
2154 (Error OPAQUE_FRAME "Unable to force the current frame to return "
2155 "(e.g. the current frame is executing a native method or "
2156 "the current frame is the constructor for a value class).")
2157 (Error NO_MORE_FRAMES)
2158 (Error NOT_IMPLEMENTED)
2159 (Error TYPE_MISMATCH "Value is not an appropriate type for the "
2160 "return value of the method.")
2161 (Error VM_DEAD)
2162 )
2163 )
2164 (Command IsVirtual=15
2165 "Determine if a thread is a "
2166 "<a href=../../api/java.base/java/lang/Thread.html#virtual-threads>virtual thread</a>."
2167 "<p>Since JDWP version 21."
2168 (Out
2169 (threadObject thread "The thread object ID.")
2170 )
2171 (Reply
2172 (boolean isVirtual "true if the thread is a virtual thread.")
2173 )
2174 (ErrorSet
2175 (Error INVALID_THREAD)
2176 (Error INVALID_OBJECT "thread is not a known ID.")
2494 "field access and field modification event kinds only. "
2495
2496 (referenceType declaring "Type in which field is declared.")
2497 (field fieldID "Required field")
2498 )
2499 (Alt Step=10
2500 "Restricts reported step events "
2501 "to those which satisfy "
2502 "depth and size constraints. "
2503 "This modifier can be used with "
2504 "step event kinds only. "
2505
2506 (threadObject thread "Thread in which to step")
2507 (int size "size of each step. "
2508 "See <a href=\"#JDWP_StepSize\">JDWP.StepSize</a>")
2509 (int depth "relative call stack limit. "
2510 "See <a href=\"#JDWP_StepDepth\">JDWP.StepDepth</a>")
2511 )
2512 (Alt InstanceOnly=11
2513 "Restricts reported events to those whose "
2514 "active 'this' object is the given object "
2515 "as determined by applying the Java == operator. "
2516 "Match value is the null object for static methods. "
2517 "This modifier can be used with any event kind "
2518 "except class prepare, class unload, thread start, "
2519 "and thread end. Introduced in JDWP version 1.4."
2520
2521 (object instance "Required 'this' object")
2522 )
2523 (Alt SourceNameMatch=12
2524 "Restricts reported class prepare events to those "
2525 "for reference types which have a source name "
2526 "which matches the given restricted regular expression. "
2527 "The source names are determined by the reference type's "
2528 "<a href=\"#JDWP_ReferenceType_SourceDebugExtension\"> "
2529 "SourceDebugExtension</a>. "
2530 "This modifier can only be used with class prepare "
2531 "events. "
2532 "Since JDWP version 1.6. Requires the canUseSourceNameFilters "
2533 "capability - see "
2534 "<a href=\"#JDWP_VirtualMachine_CapabilitiesNew\">CapabilitiesNew</a>."
2535
2587 (Command ClearAllBreakpoints=3
2588 "Removes all set breakpoints, a no-op if there are no breakpoints set."
2589 (Out "none"
2590 )
2591 (Reply "none"
2592 )
2593 (ErrorSet
2594 (Error VM_DEAD)
2595 )
2596 )
2597 )
2598 (CommandSet StackFrame=16
2599 (Command GetValues=1
2600 "Returns the value of one or more local variables in a "
2601 "given frame. Each variable must be visible at the frame's code index. "
2602 "Even if local variable information is not available, values can "
2603 "be retrieved if the front-end is able to "
2604 "determine the correct local variable index. (Typically, this "
2605 "index can be determined for method arguments from the method "
2606 "signature without access to the local variable table information.) "
2607 "<p>"
2608 "When preview features are enabled, if the local variable is the 'this' "
2609 "object and represents a value object under construction, the value returned "
2610 "will be for a snapshot of the value object, not a reference to the actual "
2611 "value object under construction. Therefore the value returned will not reflect "
2612 "changes to the value object that happen later on during construction."
2613
2614 (Out
2615 (threadObject thread "The frame's thread. ")
2616 (frame frame "The frame ID. ")
2617 (Repeat slots "The number of values to get. "
2618 (Group SlotInfo
2619 (int slot "The local variable's index in the frame. ")
2620 (byte sigbyte "A <a href=\"#JDWP_Tag\">tag</a> "
2621 "identifying the type of the variable ")
2622 )
2623 )
2624 )
2625 (Reply
2626 (Repeat values "The number of values retrieved, always equal to slots, "
2627 "the number of values to get."
2628 (value slotValue "The value of the local variable. ")
2629 )
2630 )
2631 (ErrorSet
2632 (Error INVALID_THREAD)
2633 (Error INVALID_OBJECT)
2665 (value slotValue "The value to set. ")
2666 )
2667 )
2668 )
2669 (Reply "none"
2670 )
2671 (ErrorSet
2672 (Error INVALID_THREAD)
2673 (Error INVALID_OBJECT)
2674 (Error INVALID_FRAMEID)
2675 (Error INVALID_SLOT)
2676 (Error OPAQUE_FRAME "Unable to set the value of local variables in the frame "
2677 "(e.g. the frame is executing a native method).")
2678 (Error VM_DEAD)
2679 )
2680 )
2681 (Command ThisObject=3
2682 "Returns the value of the 'this' reference for this frame. "
2683 "If the frame's method is static or native, the reply "
2684 "will contain the null object reference. "
2685 "<p>"
2686 "When preview features are enabled and 'this' represents a value object
2687 "under construction, the value returned will be for a snapshot of the "
2688 "value object, not a reference to the actual value object under "
2689 "construction. Therefore the value returned will not reflect "
2690 "changes to the value object that happen later on during "
2691 "construction."
2692 (Out
2693 (threadObject thread "The frame's thread. ")
2694 (frame frame "The frame ID. ")
2695 )
2696 (Reply
2697 (tagged-object objectThis "The 'this' object for this frame. ")
2698 )
2699 (ErrorSet
2700 (Error INVALID_THREAD)
2701 (Error INVALID_OBJECT)
2702 (Error INVALID_FRAMEID)
2703 (Error VM_DEAD)
2704 )
2705 )
2706 (Command PopFrames=4
2707 "Pop the top-most stack frames of the thread stack, up to, and including 'frame'. "
2708 "The thread must be suspended to perform this command. "
2709 "The top-most stack frames are discarded and the stack frame previous to 'frame' "
2710 "becomes the current frame. The operand stack is restored -- the argument values "
2711 "are added back and if the invoke was not <code>invokestatic</code>, "
|