1 /*
2 * Copyright (c) 1998, 2013, 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
23 * questions.
24 */
25
26 package com.sun.jdi;
27
28 import com.sun.jdi.event.EventQueue;
29 import com.sun.jdi.request.EventRequestManager;
30
31 import java.util.List;
32 import java.util.Map;
33
34 /**
35 * A virtual machine targeted for debugging.
36 * More precisely, a {@link Mirror mirror} representing the
37 * composite state of the target VM.
38 * All other mirrors are associated with an instance of this
39 * interface. Access to all other mirrors is achieved
40 * directly or indirectly through an instance of this
41 * interface.
42 * Access to global VM properties and control of VM execution
43 * are supported directly by this interface.
44 * <P>
45 * Instances of this interface are created by instances of
46 * {@link com.sun.jdi.connect.Connector}. For example,
47 * an {@link com.sun.jdi.connect.AttachingConnector AttachingConnector}
48 * attaches to a target VM and returns its virtual machine mirror.
57 * <p>
58 * Any method on <code>VirtualMachine</code> which
59 * takes <code>VirtualMachine</code> as an parameter may throw
60 * {@link com.sun.jdi.VMDisconnectedException} if the target VM is
61 * disconnected and the {@link com.sun.jdi.event.VMDisconnectEvent} has been or is
62 * available to be read from the {@link com.sun.jdi.event.EventQueue}.
63 * <p>
64 * Any method on <code>VirtualMachine</code> which
65 * takes <code>VirtualMachine</code> as an parameter may throw
66 * {@link com.sun.jdi.VMOutOfMemoryException} if the target VM has run out of memory.
67 *
68 * @author Robert Field
69 * @author Gordon Hirsch
70 * @author James McIlree
71 * @since 1.3
72 */
73 @jdk.Exported
74 public interface VirtualMachine extends Mirror {
75
76 /**
77 * Returns the loaded reference types that
78 * match a given name. The name must be fully qualified
79 * (for example, java.lang.String). The returned list
80 * will contain a {@link ReferenceType} for each class
81 * or interface found with the given name. The search
82 * is confined to loaded classes only; no attempt is made
83 * to load a class of the given name.
84 * <P>
85 * The returned list will include reference types
86 * loaded at least to the point of preparation and
87 * types (like array) for which preparation is
88 * not defined.
89 *
90 * @param className the class/interface name to search for
91 * @return a list of {@link ReferenceType} objects, each
92 * mirroring a type in the target VM with the given name.
93 */
94 List<ReferenceType> classesByName(String className);
95
96 /**
828 /**
829 * Returns the name of the target VM as reported by the
830 * property <code>java.vm.name</code>.
831 *
832 * @return the target VM name.
833 */
834 String name();
835
836 /** All tracing is disabled. */
837 int TRACE_NONE = 0x00000000;
838 /** Tracing enabled for JDWP packets sent to target VM. */
839 int TRACE_SENDS = 0x00000001;
840 /** Tracing enabled for JDWP packets received from target VM. */
841 int TRACE_RECEIVES = 0x00000002;
842 /** Tracing enabled for internal event handling. */
843 int TRACE_EVENTS = 0x00000004;
844 /** Tracing enabled for internal managment of reference types. */
845 int TRACE_REFTYPES = 0x00000008;
846 /** Tracing enabled for internal management of object references. */
847 int TRACE_OBJREFS = 0x00000010;
848 /** All tracing is enabled. */
849 int TRACE_ALL = 0x00ffffff;
850
851 /**
852 * Traces the activities performed by the com.sun.jdi implementation.
853 * All trace information is output to System.err. The given trace
854 * flags are used to limit the output to only the information
855 * desired. The given flags are in effect and the corresponding
856 * trace will continue until the next call to
857 * this method.
858 * <p>
859 * Output is implementation dependent and trace mode may be ignored.
860 *
861 * @param traceFlags identifies which kinds of tracing to enable.
862 */
863 void setDebugTraceMode(int traceFlags);
864 }
|
1 /*
2 * Copyright (c) 1998, 2015, 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
23 * questions.
24 */
25
26 package com.sun.jdi;
27
28 import com.sun.jdi.event.EventQueue;
29 import com.sun.jdi.Module;
30 import com.sun.jdi.request.EventRequestManager;
31
32 import java.util.List;
33 import java.util.Map;
34
35 /**
36 * A virtual machine targeted for debugging.
37 * More precisely, a {@link Mirror mirror} representing the
38 * composite state of the target VM.
39 * All other mirrors are associated with an instance of this
40 * interface. Access to all other mirrors is achieved
41 * directly or indirectly through an instance of this
42 * interface.
43 * Access to global VM properties and control of VM execution
44 * are supported directly by this interface.
45 * <P>
46 * Instances of this interface are created by instances of
47 * {@link com.sun.jdi.connect.Connector}. For example,
48 * an {@link com.sun.jdi.connect.AttachingConnector AttachingConnector}
49 * attaches to a target VM and returns its virtual machine mirror.
58 * <p>
59 * Any method on <code>VirtualMachine</code> which
60 * takes <code>VirtualMachine</code> as an parameter may throw
61 * {@link com.sun.jdi.VMDisconnectedException} if the target VM is
62 * disconnected and the {@link com.sun.jdi.event.VMDisconnectEvent} has been or is
63 * available to be read from the {@link com.sun.jdi.event.EventQueue}.
64 * <p>
65 * Any method on <code>VirtualMachine</code> which
66 * takes <code>VirtualMachine</code> as an parameter may throw
67 * {@link com.sun.jdi.VMOutOfMemoryException} if the target VM has run out of memory.
68 *
69 * @author Robert Field
70 * @author Gordon Hirsch
71 * @author James McIlree
72 * @since 1.3
73 */
74 @jdk.Exported
75 public interface VirtualMachine extends Mirror {
76
77 /**
78 * Returns all modules. For each module in the target
79 * VM a {@link Module} will be placed in the returned list.
80 * <P>
81 *
82 * @return a list of {@link Module} objects, each mirroring
83 * a module in the target VM.
84 *
85 * @throws java.lang.UnsupportedOperationException if
86 * the target virtual machine does not support this
87 * operation.
88 * <UL>
89 *
90 * @since 1.9
91 */
92 List<Module> allModules();
93
94 /**
95 * Returns the loaded reference types that
96 * match a given name. The name must be fully qualified
97 * (for example, java.lang.String). The returned list
98 * will contain a {@link ReferenceType} for each class
99 * or interface found with the given name. The search
100 * is confined to loaded classes only; no attempt is made
101 * to load a class of the given name.
102 * <P>
103 * The returned list will include reference types
104 * loaded at least to the point of preparation and
105 * types (like array) for which preparation is
106 * not defined.
107 *
108 * @param className the class/interface name to search for
109 * @return a list of {@link ReferenceType} objects, each
110 * mirroring a type in the target VM with the given name.
111 */
112 List<ReferenceType> classesByName(String className);
113
114 /**
846 /**
847 * Returns the name of the target VM as reported by the
848 * property <code>java.vm.name</code>.
849 *
850 * @return the target VM name.
851 */
852 String name();
853
854 /** All tracing is disabled. */
855 int TRACE_NONE = 0x00000000;
856 /** Tracing enabled for JDWP packets sent to target VM. */
857 int TRACE_SENDS = 0x00000001;
858 /** Tracing enabled for JDWP packets received from target VM. */
859 int TRACE_RECEIVES = 0x00000002;
860 /** Tracing enabled for internal event handling. */
861 int TRACE_EVENTS = 0x00000004;
862 /** Tracing enabled for internal managment of reference types. */
863 int TRACE_REFTYPES = 0x00000008;
864 /** Tracing enabled for internal management of object references. */
865 int TRACE_OBJREFS = 0x00000010;
866 /** Tracing enabled for internal management of modules. */
867 int TRACE_MODULES = 0x00000020;
868 /** All tracing is enabled. */
869 int TRACE_ALL = 0x00ffffff;
870
871 /**
872 * Traces the activities performed by the com.sun.jdi implementation.
873 * All trace information is output to System.err. The given trace
874 * flags are used to limit the output to only the information
875 * desired. The given flags are in effect and the corresponding
876 * trace will continue until the next call to
877 * this method.
878 * <p>
879 * Output is implementation dependent and trace mode may be ignored.
880 *
881 * @param traceFlags identifies which kinds of tracing to enable.
882 */
883 void setDebugTraceMode(int traceFlags);
884 }
|