1 /*
2 * Copyright 2002 Sun Microsystems, Inc. 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.
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 *
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
54 public int hashCode() {
55 // FIXME: suggestions on a better hash code?
56 return (int) addr;
57 }
58
59 public String toString() {
60 return debugger.addressValueToString(addr);
61 }
62
63 //
64 // C/C++-related routines
65 //
66
67 public long getCIntegerAt(long offset, long numBytes, boolean isUnsigned) throws UnalignedAddressException, UnmappedAddressException {
68 return debugger.readCInteger(addr + offset, numBytes, isUnsigned);
69 }
70
71 public Address getAddressAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
72 return debugger.readAddress(addr + offset);
73 }
74
75 //
76 // Java-related routines
77 //
78
79 public boolean getJBooleanAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
80 return debugger.readJBoolean(addr + offset);
81 }
82
83 public byte getJByteAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
84 return debugger.readJByte(addr + offset);
85 }
86
87 public char getJCharAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
88 return debugger.readJChar(addr + offset);
89 }
90
91 public double getJDoubleAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
92 return debugger.readJDouble(addr + offset);
93 }
95 public float getJFloatAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
96 return debugger.readJFloat(addr + offset);
97 }
98
99 public int getJIntAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
100 return debugger.readJInt(addr + offset);
101 }
102
103 public long getJLongAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
104 return debugger.readJLong(addr + offset);
105 }
106
107 public short getJShortAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
108 return debugger.readJShort(addr + offset);
109 }
110
111 public OopHandle getOopHandleAt(long offset)
112 throws UnalignedAddressException, UnmappedAddressException, NotInHeapException {
113 return debugger.readOopHandle(addr + offset);
114 }
115
116 // Mutators -- not implemented for now (FIXME)
117 public void setCIntegerAt(long offset, long numBytes, long value) {
118 throw new DebuggerException("Unimplemented");
119 }
120 public void setAddressAt(long offset, Address value) {
121 throw new DebuggerException("Unimplemented");
122 }
123 public void setJBooleanAt (long offset, boolean value)
124 throws UnmappedAddressException, UnalignedAddressException {
125 throw new DebuggerException("Unimplemented");
126 }
127 public void setJByteAt (long offset, byte value)
128 throws UnmappedAddressException, UnalignedAddressException {
129 throw new DebuggerException("Unimplemented");
130 }
131 public void setJCharAt (long offset, char value)
132 throws UnmappedAddressException, UnalignedAddressException {
133 throw new DebuggerException("Unimplemented");
134 }
|
1 /*
2 * Copyright 2002-2008 Sun Microsystems, Inc. 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.
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 *
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
54 public int hashCode() {
55 // FIXME: suggestions on a better hash code?
56 return (int) addr;
57 }
58
59 public String toString() {
60 return debugger.addressValueToString(addr);
61 }
62
63 //
64 // C/C++-related routines
65 //
66
67 public long getCIntegerAt(long offset, long numBytes, boolean isUnsigned) throws UnalignedAddressException, UnmappedAddressException {
68 return debugger.readCInteger(addr + offset, numBytes, isUnsigned);
69 }
70
71 public Address getAddressAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
72 return debugger.readAddress(addr + offset);
73 }
74 public Address getCompOopAddressAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
75 return debugger.readCompOopAddress(addr + offset);
76 }
77
78 //
79 // Java-related routines
80 //
81
82 public boolean getJBooleanAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
83 return debugger.readJBoolean(addr + offset);
84 }
85
86 public byte getJByteAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
87 return debugger.readJByte(addr + offset);
88 }
89
90 public char getJCharAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
91 return debugger.readJChar(addr + offset);
92 }
93
94 public double getJDoubleAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
95 return debugger.readJDouble(addr + offset);
96 }
98 public float getJFloatAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
99 return debugger.readJFloat(addr + offset);
100 }
101
102 public int getJIntAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
103 return debugger.readJInt(addr + offset);
104 }
105
106 public long getJLongAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
107 return debugger.readJLong(addr + offset);
108 }
109
110 public short getJShortAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
111 return debugger.readJShort(addr + offset);
112 }
113
114 public OopHandle getOopHandleAt(long offset)
115 throws UnalignedAddressException, UnmappedAddressException, NotInHeapException {
116 return debugger.readOopHandle(addr + offset);
117 }
118 public OopHandle getCompOopHandleAt(long offset)
119 throws UnalignedAddressException, UnmappedAddressException, NotInHeapException {
120 return debugger.readCompOopHandle(addr + offset);
121 }
122
123 // Mutators -- not implemented for now (FIXME)
124 public void setCIntegerAt(long offset, long numBytes, long value) {
125 throw new DebuggerException("Unimplemented");
126 }
127 public void setAddressAt(long offset, Address value) {
128 throw new DebuggerException("Unimplemented");
129 }
130 public void setJBooleanAt (long offset, boolean value)
131 throws UnmappedAddressException, UnalignedAddressException {
132 throw new DebuggerException("Unimplemented");
133 }
134 public void setJByteAt (long offset, byte value)
135 throws UnmappedAddressException, UnalignedAddressException {
136 throw new DebuggerException("Unimplemented");
137 }
138 public void setJCharAt (long offset, char value)
139 throws UnmappedAddressException, UnalignedAddressException {
140 throw new DebuggerException("Unimplemented");
141 }
|