annotate agent/src/share/classes/sun/jvm/hotspot/debugger/ia64/IA64ThreadContext.java @ 1552:c18cbe5936b8

6941466: Oracle rebranding changes for Hotspot repositories Summary: Change all the Sun copyrights to Oracle copyright Reviewed-by: ohair
author trims
date Thu, 27 May 2010 19:08:38 -0700
parents a61af66fc99e
children a9fed06c01d2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
2 * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
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: 0
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 package sun.jvm.hotspot.debugger.ia64;
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 import sun.jvm.hotspot.debugger.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
28
a61af66fc99e Initial load
duke
parents:
diff changeset
29 /** Specifies the thread context on ia64 platform; only a sub-portion
a61af66fc99e Initial load
duke
parents:
diff changeset
30 of the context is guaranteed to be present on all operating
a61af66fc99e Initial load
duke
parents:
diff changeset
31 systems. */
a61af66fc99e Initial load
duke
parents:
diff changeset
32
a61af66fc99e Initial load
duke
parents:
diff changeset
33 public abstract class IA64ThreadContext implements ThreadContext {
a61af66fc99e Initial load
duke
parents:
diff changeset
34 // Refer to winnt.h CONTEXT structure - Nov 2001 edition Platform SDK
a61af66fc99e Initial load
duke
parents:
diff changeset
35 // only a relevant subset of CONTEXT structure is used here.
a61af66fc99e Initial load
duke
parents:
diff changeset
36 // For eg. floating point registers are ignored.
a61af66fc99e Initial load
duke
parents:
diff changeset
37
a61af66fc99e Initial load
duke
parents:
diff changeset
38 // NOTE: the indices for the various registers must be maintained as
a61af66fc99e Initial load
duke
parents:
diff changeset
39 // listed across various operating systems. However, only a
a61af66fc99e Initial load
duke
parents:
diff changeset
40 // subset of the registers' values are guaranteed to be present
a61af66fc99e Initial load
duke
parents:
diff changeset
41
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // global registers r0-r31
a61af66fc99e Initial load
duke
parents:
diff changeset
43 public static final int GR0 = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
44 public static final int GR1 = 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
45 public static final int GR2 = 2;
a61af66fc99e Initial load
duke
parents:
diff changeset
46 public static final int GR3 = 3;
a61af66fc99e Initial load
duke
parents:
diff changeset
47 public static final int GR4 = 4;
a61af66fc99e Initial load
duke
parents:
diff changeset
48 public static final int GR5 = 5;
a61af66fc99e Initial load
duke
parents:
diff changeset
49 public static final int GR6 = 6;
a61af66fc99e Initial load
duke
parents:
diff changeset
50 public static final int GR7 = 7;
a61af66fc99e Initial load
duke
parents:
diff changeset
51 public static final int GR8 = 8;
a61af66fc99e Initial load
duke
parents:
diff changeset
52 public static final int GR9 = 9;
a61af66fc99e Initial load
duke
parents:
diff changeset
53 public static final int GR10 = 10;
a61af66fc99e Initial load
duke
parents:
diff changeset
54 public static final int GR11 = 11;
a61af66fc99e Initial load
duke
parents:
diff changeset
55 public static final int GR12 = 12;
a61af66fc99e Initial load
duke
parents:
diff changeset
56 public static final int SP = GR12;
a61af66fc99e Initial load
duke
parents:
diff changeset
57 public static final int GR13 = 13;
a61af66fc99e Initial load
duke
parents:
diff changeset
58 public static final int GR14 = 14;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 public static final int GR15 = 15;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 public static final int GR16 = 16;
a61af66fc99e Initial load
duke
parents:
diff changeset
61 public static final int GR17 = 17;
a61af66fc99e Initial load
duke
parents:
diff changeset
62 public static final int GR18 = 18;
a61af66fc99e Initial load
duke
parents:
diff changeset
63 public static final int GR19 = 19;
a61af66fc99e Initial load
duke
parents:
diff changeset
64 public static final int GR20 = 20;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 public static final int GR21 = 21;
a61af66fc99e Initial load
duke
parents:
diff changeset
66 public static final int GR22 = 22;
a61af66fc99e Initial load
duke
parents:
diff changeset
67 public static final int GR23 = 23;
a61af66fc99e Initial load
duke
parents:
diff changeset
68 public static final int GR24 = 24;
a61af66fc99e Initial load
duke
parents:
diff changeset
69 public static final int GR25 = 25;
a61af66fc99e Initial load
duke
parents:
diff changeset
70 public static final int GR26 = 26;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 public static final int GR27 = 27;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 public static final int GR28 = 28;
a61af66fc99e Initial load
duke
parents:
diff changeset
73 public static final int GR29 = 29;
a61af66fc99e Initial load
duke
parents:
diff changeset
74 public static final int GR30 = 30;
a61af66fc99e Initial load
duke
parents:
diff changeset
75 public static final int GR31 = 31;
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 // Nat bits for r1-r31
a61af66fc99e Initial load
duke
parents:
diff changeset
78 public static final int INT_NATS = 32;
a61af66fc99e Initial load
duke
parents:
diff changeset
79
a61af66fc99e Initial load
duke
parents:
diff changeset
80 // predicates
a61af66fc99e Initial load
duke
parents:
diff changeset
81 public static final int PREDS = 33;
a61af66fc99e Initial load
duke
parents:
diff changeset
82
a61af66fc99e Initial load
duke
parents:
diff changeset
83 // branch registers
a61af66fc99e Initial load
duke
parents:
diff changeset
84 public static final int BR0 = 34;
a61af66fc99e Initial load
duke
parents:
diff changeset
85 public static final int BR_RP = BR0;
a61af66fc99e Initial load
duke
parents:
diff changeset
86 public static final int BR1 = 35;
a61af66fc99e Initial load
duke
parents:
diff changeset
87 public static final int BR2 = 36;
a61af66fc99e Initial load
duke
parents:
diff changeset
88 public static final int BR3 = 37;
a61af66fc99e Initial load
duke
parents:
diff changeset
89 public static final int BR4 = 38;
a61af66fc99e Initial load
duke
parents:
diff changeset
90 public static final int BR5 = 39;
a61af66fc99e Initial load
duke
parents:
diff changeset
91 public static final int BR6 = 40;
a61af66fc99e Initial load
duke
parents:
diff changeset
92 public static final int BR7 = 41;
a61af66fc99e Initial load
duke
parents:
diff changeset
93
a61af66fc99e Initial load
duke
parents:
diff changeset
94 // application registers
a61af66fc99e Initial load
duke
parents:
diff changeset
95 public static final int AP_UNAT = 42; // User Nat Collection register
a61af66fc99e Initial load
duke
parents:
diff changeset
96 public static final int AP_LC = 43; // Loop counter register
a61af66fc99e Initial load
duke
parents:
diff changeset
97 public static final int AP_EC = 43; // Epilog counter register
a61af66fc99e Initial load
duke
parents:
diff changeset
98 public static final int AP_CCV = 45; // CMPXCHG value register
a61af66fc99e Initial load
duke
parents:
diff changeset
99 public static final int AP_DCR = 46; // Default control register
a61af66fc99e Initial load
duke
parents:
diff changeset
100
a61af66fc99e Initial load
duke
parents:
diff changeset
101 // register stack info
a61af66fc99e Initial load
duke
parents:
diff changeset
102 public static final int RS_PFS = 47; // Previous function state
a61af66fc99e Initial load
duke
parents:
diff changeset
103 public static final int AP_PFS = RS_PFS;
a61af66fc99e Initial load
duke
parents:
diff changeset
104 public static final int RS_BSP = 48; // Backing store pointer
a61af66fc99e Initial load
duke
parents:
diff changeset
105 public static final int AR_BSP = RS_BSP;
a61af66fc99e Initial load
duke
parents:
diff changeset
106 public static final int RS_BSPSTORE = 49;
a61af66fc99e Initial load
duke
parents:
diff changeset
107 public static final int AP_BSPSTORE = RS_BSPSTORE;
a61af66fc99e Initial load
duke
parents:
diff changeset
108 public static final int RS_RSC = 50; // RSE configuration
a61af66fc99e Initial load
duke
parents:
diff changeset
109 public static final int AP_RSC = RS_RSC;
a61af66fc99e Initial load
duke
parents:
diff changeset
110 public static final int RS_RNAT = 51; // RSE Nat collection register
a61af66fc99e Initial load
duke
parents:
diff changeset
111 public static final int AP_RNAT = RS_RNAT;
a61af66fc99e Initial load
duke
parents:
diff changeset
112
a61af66fc99e Initial load
duke
parents:
diff changeset
113 // trap status register
a61af66fc99e Initial load
duke
parents:
diff changeset
114 public static final int ST_IPSR = 52; // Interuption Processor Status
a61af66fc99e Initial load
duke
parents:
diff changeset
115 public static final int ST_IIP = 53; // Interruption IP
a61af66fc99e Initial load
duke
parents:
diff changeset
116 public static final int ST_IFS = 54; // Interruption Function State
a61af66fc99e Initial load
duke
parents:
diff changeset
117
a61af66fc99e Initial load
duke
parents:
diff changeset
118 // debug registers
a61af66fc99e Initial load
duke
parents:
diff changeset
119 public static final int DB_I0 = 55;
a61af66fc99e Initial load
duke
parents:
diff changeset
120 public static final int DB_I1 = 56;
a61af66fc99e Initial load
duke
parents:
diff changeset
121 public static final int DB_I2 = 57;
a61af66fc99e Initial load
duke
parents:
diff changeset
122 public static final int DB_I3 = 58;
a61af66fc99e Initial load
duke
parents:
diff changeset
123 public static final int DB_I4 = 59;
a61af66fc99e Initial load
duke
parents:
diff changeset
124 public static final int DB_I5 = 60;
a61af66fc99e Initial load
duke
parents:
diff changeset
125 public static final int DB_I6 = 61;
a61af66fc99e Initial load
duke
parents:
diff changeset
126 public static final int DB_I7 = 62;
a61af66fc99e Initial load
duke
parents:
diff changeset
127
a61af66fc99e Initial load
duke
parents:
diff changeset
128 public static final int DB_D0 = 63;
a61af66fc99e Initial load
duke
parents:
diff changeset
129 public static final int DB_D1 = 64;
a61af66fc99e Initial load
duke
parents:
diff changeset
130 public static final int DB_D2 = 65;
a61af66fc99e Initial load
duke
parents:
diff changeset
131 public static final int DB_D3 = 66;
a61af66fc99e Initial load
duke
parents:
diff changeset
132 public static final int DB_D4 = 67;
a61af66fc99e Initial load
duke
parents:
diff changeset
133 public static final int DB_D5 = 68;
a61af66fc99e Initial load
duke
parents:
diff changeset
134 public static final int DB_D6 = 69;
a61af66fc99e Initial load
duke
parents:
diff changeset
135 public static final int DB_D7 = 70;
a61af66fc99e Initial load
duke
parents:
diff changeset
136
a61af66fc99e Initial load
duke
parents:
diff changeset
137 public static final int NPRGREG = 71;
a61af66fc99e Initial load
duke
parents:
diff changeset
138
a61af66fc99e Initial load
duke
parents:
diff changeset
139 private static final String[] regNames = {
a61af66fc99e Initial load
duke
parents:
diff changeset
140 "GR0", "GR1", "GR2", "GR3", "GR4", "GR5", "GR6", "GR7", "GR8",
a61af66fc99e Initial load
duke
parents:
diff changeset
141 "GR9", "GR10", "GR11", "GR12", "GR13", "GR14", "GR15", "GR16",
a61af66fc99e Initial load
duke
parents:
diff changeset
142 "GR17","GR18", "GR19", "GR20", "GR21", "GR22", "GR23", "GR24",
a61af66fc99e Initial load
duke
parents:
diff changeset
143 "GR25","GR26", "GR27", "GR28", "GR29", "GR30", "GR31",
a61af66fc99e Initial load
duke
parents:
diff changeset
144 "INT_NATS", "PREDS",
a61af66fc99e Initial load
duke
parents:
diff changeset
145 "BR0", "BR1", "BR2", "BR3", "BR4", "BR5", "BR6", "BR7",
a61af66fc99e Initial load
duke
parents:
diff changeset
146 "AP_UNAT", "AP_LC", "AP_EC", "AP_CCV", "AP_DCR",
a61af66fc99e Initial load
duke
parents:
diff changeset
147 "RS_FPS", "RS_BSP", "RS_BSPSTORE", "RS_RSC", "RS_RNAT",
a61af66fc99e Initial load
duke
parents:
diff changeset
148 "ST_IPSR", "ST_IIP", "ST_IFS",
a61af66fc99e Initial load
duke
parents:
diff changeset
149 "DB_I0", "DB_I1", "DB_I2", "DB_I3", "DB_I4", "DB_I5", "DB_I6", "DB_I7",
a61af66fc99e Initial load
duke
parents:
diff changeset
150 "DB_D0", "DB_D1", "DB_D2", "DB_D3", "DB_D4", "DB_D5", "DB_D6", "DB_D7"
a61af66fc99e Initial load
duke
parents:
diff changeset
151 };
a61af66fc99e Initial load
duke
parents:
diff changeset
152
a61af66fc99e Initial load
duke
parents:
diff changeset
153 private long[] data;
a61af66fc99e Initial load
duke
parents:
diff changeset
154
a61af66fc99e Initial load
duke
parents:
diff changeset
155 public IA64ThreadContext() {
a61af66fc99e Initial load
duke
parents:
diff changeset
156 data = new long[NPRGREG];
a61af66fc99e Initial load
duke
parents:
diff changeset
157 }
a61af66fc99e Initial load
duke
parents:
diff changeset
158
a61af66fc99e Initial load
duke
parents:
diff changeset
159 public int getNumRegisters() {
a61af66fc99e Initial load
duke
parents:
diff changeset
160 return NPRGREG;
a61af66fc99e Initial load
duke
parents:
diff changeset
161 }
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163 public String getRegisterName(int index) {
a61af66fc99e Initial load
duke
parents:
diff changeset
164 return regNames[index];
a61af66fc99e Initial load
duke
parents:
diff changeset
165 }
a61af66fc99e Initial load
duke
parents:
diff changeset
166
a61af66fc99e Initial load
duke
parents:
diff changeset
167 public void setRegister(int index, long value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
168 data[index] = value;
a61af66fc99e Initial load
duke
parents:
diff changeset
169 }
a61af66fc99e Initial load
duke
parents:
diff changeset
170
a61af66fc99e Initial load
duke
parents:
diff changeset
171 public long getRegister(int index) {
a61af66fc99e Initial load
duke
parents:
diff changeset
172 return data[index];
a61af66fc99e Initial load
duke
parents:
diff changeset
173 }
a61af66fc99e Initial load
duke
parents:
diff changeset
174
a61af66fc99e Initial load
duke
parents:
diff changeset
175 /** This can't be implemented in this class since we would have to
a61af66fc99e Initial load
duke
parents:
diff changeset
176 tie the implementation to, for example, the debugging system */
a61af66fc99e Initial load
duke
parents:
diff changeset
177 public abstract void setRegisterAsAddress(int index, Address value);
a61af66fc99e Initial load
duke
parents:
diff changeset
178
a61af66fc99e Initial load
duke
parents:
diff changeset
179 /** This can't be implemented in this class since we would have to
a61af66fc99e Initial load
duke
parents:
diff changeset
180 tie the implementation to, for example, the debugging system */
a61af66fc99e Initial load
duke
parents:
diff changeset
181 public abstract Address getRegisterAsAddress(int index);
a61af66fc99e Initial load
duke
parents:
diff changeset
182 }