agent/src/share/classes/sun/jvm/hotspot/debugger/sparc/SPARCThreadContext.java

Wed, 19 Sep 2012 17:22:49 -0400

author
bpittore
date
Wed, 19 Sep 2012 17:22:49 -0400
changeset 4074
fac3dd92ebaf
parent 4028
a9fed06c01d2
child 6876
710a3c8b516e
permissions
-rw-r--r--

7195372: Wrong copyright in new files
Summary: Fixed copyrights
Reviewed-by: dholmes
Contributed-by: Bill Pittore <bill.pittore@oracle.com>

duke@435 1 /*
bpittore@4074 2 * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
trims@1907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 * or visit www.oracle.com if you need additional information or have any
trims@1907 21 * questions.
duke@435 22 *
duke@435 23 */
duke@435 24
duke@435 25 package sun.jvm.hotspot.debugger.sparc;
duke@435 26
duke@435 27 import sun.jvm.hotspot.debugger.*;
bpittore@4028 28 import sun.jvm.hotspot.debugger.cdbg.*;
duke@435 29
duke@435 30 /** Currently provides just the minimal information necessary to get
duke@435 31 stack traces working. FIXME: currently hardwired for v9 -- will
duke@435 32 have to factor out v8/v9 specific code. FIXME: may want to try to
duke@435 33 share code between this class and asm/sparc. */
duke@435 34
duke@435 35 public abstract class SPARCThreadContext implements ThreadContext {
duke@435 36 // Taken from /usr/include/sys/procfs_isa.h
duke@435 37 public static final int R_G0 = 0;
duke@435 38 public static final int R_G1 = 1;
duke@435 39 public static final int R_G2 = 2;
duke@435 40 public static final int R_G3 = 3;
duke@435 41 public static final int R_G4 = 4;
duke@435 42 public static final int R_G5 = 5;
duke@435 43 public static final int R_G6 = 6;
duke@435 44 public static final int R_G7 = 7;
duke@435 45 public static final int R_O0 = 8;
duke@435 46 public static final int R_O1 = 9;
duke@435 47 public static final int R_O2 = 10;
duke@435 48 public static final int R_O3 = 11;
duke@435 49 public static final int R_O4 = 12;
duke@435 50 public static final int R_O5 = 13;
duke@435 51 public static final int R_O6 = 14;
duke@435 52 public static final int R_O7 = 15;
duke@435 53 public static final int R_L0 = 16;
duke@435 54 public static final int R_L1 = 17;
duke@435 55 public static final int R_L2 = 18;
duke@435 56 public static final int R_L3 = 19;
duke@435 57 public static final int R_L4 = 20;
duke@435 58 public static final int R_L5 = 21;
duke@435 59 public static final int R_L6 = 22;
duke@435 60 public static final int R_L7 = 23;
duke@435 61 public static final int R_I0 = 24;
duke@435 62 public static final int R_I1 = 25;
duke@435 63 public static final int R_I2 = 26;
duke@435 64 public static final int R_I3 = 27;
duke@435 65 public static final int R_I4 = 28;
duke@435 66 public static final int R_I5 = 29;
duke@435 67 public static final int R_I6 = 30;
duke@435 68 public static final int R_I7 = 31;
duke@435 69
duke@435 70 // sparc-v9
duke@435 71 public static final int R_CCR = 32;
duke@435 72 // sparc-v8
duke@435 73 public static final int R_PSR = 32;
duke@435 74
duke@435 75 public static final int R_PC = 33;
duke@435 76 public static final int R_nPC = 34;
duke@435 77
duke@435 78 public static final int R_SP = R_O6;
duke@435 79 public static final int R_FP = R_I6;
duke@435 80
duke@435 81 public static final int R_Y = 35;
duke@435 82
duke@435 83 // sparc-v9
duke@435 84 public static final int R_ASI = 36;
duke@435 85 public static final int R_FPRS = 37;
duke@435 86
duke@435 87 // sparc-v8
duke@435 88 public static final int R_WIM = 36;
duke@435 89 public static final int R_TBR = 37;
duke@435 90
duke@435 91 public static final int NPRGREG = 38;
duke@435 92
duke@435 93 private static final String[] regNames = {
duke@435 94 "G0", "G1", "G2", "G3",
duke@435 95 "G4", "G5", "G6", "G7",
duke@435 96 "O0", "O1", "O2", "O3",
duke@435 97 "O4", "O5", "O6/SP", "O7",
duke@435 98 "L0", "L1", "L2", "L3",
duke@435 99 "L4", "L5", "L6", "L7",
duke@435 100 "I0", "I1", "I2", "I3",
duke@435 101 "I4", "I5", "I6/FP", "I7",
duke@435 102 "CCR/PSR", "PC", "nPC", "Y",
duke@435 103 "ASI/WIM", "FPRS/TBR"
duke@435 104 };
duke@435 105
duke@435 106 private long[] data;
duke@435 107
duke@435 108 public SPARCThreadContext() {
duke@435 109 data = new long[NPRGREG];
duke@435 110 }
duke@435 111
duke@435 112 public int getNumRegisters() {
duke@435 113 return NPRGREG;
duke@435 114 }
duke@435 115
duke@435 116 public String getRegisterName(int index) {
duke@435 117 return regNames[index];
duke@435 118 }
duke@435 119
duke@435 120 public void setRegister(int index, long value) {
duke@435 121 data[index] = value;
duke@435 122 }
duke@435 123
duke@435 124 public long getRegister(int index) {
duke@435 125 return data[index];
duke@435 126 }
duke@435 127
bpittore@4028 128 public CFrame getTopFrame(Debugger dbg) {
bpittore@4028 129 return null;
bpittore@4028 130 }
bpittore@4028 131
duke@435 132 /** This can't be implemented in this class since we would have to
duke@435 133 tie the implementation to, for example, the debugging system */
duke@435 134 public abstract void setRegisterAsAddress(int index, Address value);
duke@435 135
duke@435 136 /** This can't be implemented in this class since we would have to
duke@435 137 tie the implementation to, for example, the debugging system */
duke@435 138 public abstract Address getRegisterAsAddress(int index);
duke@435 139 }

mercurial