Mercurial > hg > truffle
annotate agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java @ 10343:6bd680e9ea35
8003421: NPG: Move oops out of InstanceKlass into mirror
Summary: Inject protection_domain, signers, init_lock into java_lang_Class
Reviewed-by: stefank, dholmes, sla
author | coleenp |
---|---|
date | Wed, 22 May 2013 14:37:49 -0400 |
parents | 8e47bac5643a |
children |
rev | line source |
---|---|
0 | 1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
844
diff
changeset
|
2 * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. |
0 | 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. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
844
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
844
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
844
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 package sun.jvm.hotspot.debugger.remote; | |
26 | |
27 import java.rmi.*; | |
28 import java.rmi.server.*; | |
29 | |
30 import sun.jvm.hotspot.debugger.*; | |
31 | |
32 /** The implementation of the RemoteDebugger interface. This | |
33 delegates to a local debugger */ | |
34 | |
35 public class RemoteDebuggerServer extends UnicastRemoteObject | |
36 implements RemoteDebugger { | |
37 | |
38 private transient Debugger debugger; | |
39 | |
40 /** This is the required no-arg constructor */ | |
41 public RemoteDebuggerServer() throws RemoteException { | |
42 super(); | |
43 } | |
44 | |
45 /** This is the constructor used on the machine where the debuggee | |
46 process lies */ | |
47 public RemoteDebuggerServer(Debugger debugger) throws RemoteException { | |
48 super(); | |
49 this.debugger = debugger; | |
50 } | |
51 | |
52 public String getOS() throws RemoteException { | |
53 return debugger.getOS(); | |
54 } | |
55 | |
56 public String getCPU() throws RemoteException { | |
57 return debugger.getCPU(); | |
58 } | |
59 | |
60 public MachineDescription getMachineDescription() throws RemoteException { | |
61 return debugger.getMachineDescription(); | |
62 } | |
63 | |
64 public long lookupInProcess(String objectName, String symbol) throws RemoteException { | |
65 Address addr = debugger.lookup(objectName, symbol); | |
66 return addr == null? 0L : debugger.getAddressValue(addr); | |
67 } | |
68 | |
69 public ReadResult readBytesFromProcess(long address, long numBytes) throws RemoteException { | |
70 return debugger.readBytesFromProcess(address, numBytes); | |
71 } | |
72 | |
73 public boolean hasConsole() throws RemoteException { | |
74 return debugger.hasConsole(); | |
75 } | |
76 | |
77 public String getConsolePrompt() throws RemoteException { | |
78 return debugger.getConsolePrompt(); | |
79 } | |
80 | |
81 public String consoleExecuteCommand(String cmd) throws RemoteException { | |
82 return debugger.consoleExecuteCommand(cmd); | |
83 } | |
84 | |
85 public long getJBooleanSize() throws RemoteException { | |
86 return debugger.getJBooleanSize(); | |
87 } | |
88 | |
89 public long getJByteSize() throws RemoteException { | |
90 return debugger.getJByteSize(); | |
91 } | |
92 | |
93 public long getJCharSize() throws RemoteException { | |
94 return debugger.getJCharSize(); | |
95 } | |
96 | |
97 public long getJDoubleSize() throws RemoteException { | |
98 return debugger.getJDoubleSize(); | |
99 } | |
100 | |
101 public long getJFloatSize() throws RemoteException { | |
102 return debugger.getJFloatSize(); | |
103 } | |
104 | |
105 public long getJIntSize() throws RemoteException { | |
106 return debugger.getJIntSize(); | |
107 } | |
108 | |
109 public long getJLongSize() throws RemoteException { | |
110 return debugger.getJLongSize(); | |
111 } | |
112 | |
113 public long getJShortSize() throws RemoteException { | |
114 return debugger.getJShortSize(); | |
115 } | |
116 | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
117 public long getHeapOopSize() throws RemoteException { |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
118 return debugger.getHeapOopSize(); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
119 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
120 |
642
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
196
diff
changeset
|
121 public long getNarrowOopBase() throws RemoteException { |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
196
diff
changeset
|
122 return debugger.getNarrowOopBase(); |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
123 } |
642
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
196
diff
changeset
|
124 |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
196
diff
changeset
|
125 public int getNarrowOopShift() throws RemoteException { |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
196
diff
changeset
|
126 return debugger.getNarrowOopShift(); |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
196
diff
changeset
|
127 } |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
196
diff
changeset
|
128 |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
1552
diff
changeset
|
129 public long getKlassPtrSize() throws RemoteException { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
1552
diff
changeset
|
130 return debugger.getHeapOopSize(); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
1552
diff
changeset
|
131 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
1552
diff
changeset
|
132 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
1552
diff
changeset
|
133 public long getNarrowKlassBase() throws RemoteException { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
1552
diff
changeset
|
134 return debugger.getNarrowKlassBase(); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
1552
diff
changeset
|
135 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
1552
diff
changeset
|
136 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
1552
diff
changeset
|
137 public int getNarrowKlassShift() throws RemoteException { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
1552
diff
changeset
|
138 return debugger.getNarrowKlassShift(); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
1552
diff
changeset
|
139 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
1552
diff
changeset
|
140 |
0 | 141 public boolean areThreadsEqual(long addrOrId1, boolean isAddress1, |
142 long addrOrId2, boolean isAddress2) throws RemoteException { | |
143 ThreadProxy t1 = getThreadProxy(addrOrId1, isAddress1); | |
144 ThreadProxy t2 = getThreadProxy(addrOrId2, isAddress2); | |
145 return t1.equals(t2); | |
146 } | |
147 | |
148 | |
149 public int getThreadHashCode(long addrOrId, boolean isAddress) throws RemoteException { | |
150 ThreadProxy t = getThreadProxy(addrOrId, isAddress); | |
151 return t.hashCode(); | |
152 } | |
153 | |
154 public long[] getThreadIntegerRegisterSet(long addrOrId, boolean isAddress) throws RemoteException { | |
155 ThreadProxy t = getThreadProxy(addrOrId, isAddress); | |
156 ThreadContext tc = t.getContext(); | |
157 long[] regs = new long[tc.getNumRegisters()]; | |
158 for (int r = 0; r < regs.length; r++) { | |
159 regs[r] = tc.getRegister(r); | |
160 } | |
161 return regs; | |
162 } | |
163 | |
164 private ThreadProxy getThreadProxy(long addrOrId, boolean isAddress) throws DebuggerException { | |
165 if (isAddress) { | |
166 Address addr = debugger.parseAddress("0x" + Long.toHexString(addrOrId)); | |
167 return debugger.getThreadForIdentifierAddress(addr); | |
168 } else { | |
169 return debugger.getThreadForThreadId(addrOrId); | |
170 } | |
171 } | |
172 } |