annotate agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbol.java @ 2072:d6cd0d55d0b5

6987812: 2/3 SAJDI: "gHotSpotVMTypes was not initialized properly in the remote process" Summary: Change ExportDirectoryTableImpl to return the 'Export RVA' field without modification. Read 'Base Of Data' field in optional header when PE32 format COFF file is read. Refine search for dbgeng.dll and dbghelp.dll. Other cleanups. Reviewed-by: swamyv, poonam
author dcubed
date Thu, 23 Dec 2010 07:58:35 -0800
parents c18cbe5936b8
children
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) 2000, 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.win32.coff;
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 /** Describes a COFF symbol. (Some of the descriptions are taken
a61af66fc99e Initial load
duke
parents:
diff changeset
28 directly from Microsoft's documentation and are copyrighted by
a61af66fc99e Initial load
duke
parents:
diff changeset
29 Microsoft.) */
a61af66fc99e Initial load
duke
parents:
diff changeset
30
a61af66fc99e Initial load
duke
parents:
diff changeset
31 public interface COFFSymbol {
a61af66fc99e Initial load
duke
parents:
diff changeset
32 /** Offset within the file of this record. (FIXME: Now that we have
a61af66fc99e Initial load
duke
parents:
diff changeset
33 the auxiliary records exposed, it may not be necessary to expose
a61af66fc99e Initial load
duke
parents:
diff changeset
34 this.) */
a61af66fc99e Initial load
duke
parents:
diff changeset
35 public int getOffset();
a61af66fc99e Initial load
duke
parents:
diff changeset
36
a61af66fc99e Initial load
duke
parents:
diff changeset
37 public String getName();
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 /** Value associated with the symbol. The interpretation of this
a61af66fc99e Initial load
duke
parents:
diff changeset
40 field depends on Section Number and Storage Class. A typical
a61af66fc99e Initial load
duke
parents:
diff changeset
41 meaning is the relocatable address. */
a61af66fc99e Initial load
duke
parents:
diff changeset
42 public int getValue();
a61af66fc99e Initial load
duke
parents:
diff changeset
43
a61af66fc99e Initial load
duke
parents:
diff changeset
44 /** Signed integer identifying the section, using a one-based index
a61af66fc99e Initial load
duke
parents:
diff changeset
45 into the Section Table. Some values have special meaning defined
a61af66fc99e Initial load
duke
parents:
diff changeset
46 in {@link sun.jvm.hotspot.debugger.win32.coff.COFFSymbolConstants}. */
a61af66fc99e Initial load
duke
parents:
diff changeset
47 public short getSectionNumber();
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49 /** <P> The Type field of a symbol table entry contains two bytes,
a61af66fc99e Initial load
duke
parents:
diff changeset
50 each byte representing type information. The least-significant
a61af66fc99e Initial load
duke
parents:
diff changeset
51 byte represents simple (base) data type, and the
a61af66fc99e Initial load
duke
parents:
diff changeset
52 most-significant byte represents complex type, if any: </P>
a61af66fc99e Initial load
duke
parents:
diff changeset
53
a61af66fc99e Initial load
duke
parents:
diff changeset
54 <P> MSB: Complex type: none, pointer, function, array. </P>
a61af66fc99e Initial load
duke
parents:
diff changeset
55
a61af66fc99e Initial load
duke
parents:
diff changeset
56 <P> LSB: Base type: integer, floating-point, etc. </P>
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58 <P> The possible base type values are listed in {@link
a61af66fc99e Initial load
duke
parents:
diff changeset
59 sun.jvm.hotspot.debugger.win32.coff.COFFSymbolConstants} under the
a61af66fc99e Initial load
duke
parents:
diff changeset
60 IMAGE_SYM_TYPE constants. </P>
a61af66fc99e Initial load
duke
parents:
diff changeset
61
a61af66fc99e Initial load
duke
parents:
diff changeset
62 <P> The most significant byte specifies whether the symbol is a
a61af66fc99e Initial load
duke
parents:
diff changeset
63 pointer to, function returning, or array of the base type
a61af66fc99e Initial load
duke
parents:
diff changeset
64 specified in the least significant byte. Microsoft tools use
a61af66fc99e Initial load
duke
parents:
diff changeset
65 this field only to indicate whether or not the symbol is a
a61af66fc99e Initial load
duke
parents:
diff changeset
66 function, so that the only two resulting values are 0x0 and 0x20
a61af66fc99e Initial load
duke
parents:
diff changeset
67 for the Type field. However, other tools can use this field to
a61af66fc99e Initial load
duke
parents:
diff changeset
68 communicate more information. </P>
a61af66fc99e Initial load
duke
parents:
diff changeset
69
a61af66fc99e Initial load
duke
parents:
diff changeset
70 <P> It is very important to specify the function attribute
a61af66fc99e Initial load
duke
parents:
diff changeset
71 correctly. This information is required for incremental linking
a61af66fc99e Initial load
duke
parents:
diff changeset
72 to work correctly. For some architectures the information may be
a61af66fc99e Initial load
duke
parents:
diff changeset
73 required for other purposes. </P>
a61af66fc99e Initial load
duke
parents:
diff changeset
74
a61af66fc99e Initial load
duke
parents:
diff changeset
75 <P> The possible function types are listed in {@link
a61af66fc99e Initial load
duke
parents:
diff changeset
76 sun.jvm.hotspot.debugger.win32.coff.COFFSymbolConstants} under the
a61af66fc99e Initial load
duke
parents:
diff changeset
77 IMAGE_SYM_DTYPE constants. </P> */
a61af66fc99e Initial load
duke
parents:
diff changeset
78 public short getType();
a61af66fc99e Initial load
duke
parents:
diff changeset
79
a61af66fc99e Initial load
duke
parents:
diff changeset
80 /** Enumerated value representing storage class. See {@link
a61af66fc99e Initial load
duke
parents:
diff changeset
81 sun.jvm.hotspot.debugger.win32.coff.COFFSymbolConstants} under the
a61af66fc99e Initial load
duke
parents:
diff changeset
82 IMAGE_SYM_CLASS constants. */
a61af66fc99e Initial load
duke
parents:
diff changeset
83 public byte getStorageClass();
a61af66fc99e Initial load
duke
parents:
diff changeset
84
a61af66fc99e Initial load
duke
parents:
diff changeset
85 /** Number of auxiliary symbol table entries that follow this
a61af66fc99e Initial load
duke
parents:
diff changeset
86 record. (FIXME: the APIs below which fetch such an auxiliary
a61af66fc99e Initial load
duke
parents:
diff changeset
87 symbol are only currently capable of fetching the first one.) */
a61af66fc99e Initial load
duke
parents:
diff changeset
88 public byte getNumberOfAuxSymbols();
a61af66fc99e Initial load
duke
parents:
diff changeset
89
a61af66fc99e Initial load
duke
parents:
diff changeset
90 /** Indicates whether this symbol is a function definition: storage
a61af66fc99e Initial load
duke
parents:
diff changeset
91 class EXTERNAL (2), a Type value indicating it is a function
a61af66fc99e Initial load
duke
parents:
diff changeset
92 (0x20), and a section number greater than zero. This indicates
a61af66fc99e Initial load
duke
parents:
diff changeset
93 that the function is followed by an {@link
a61af66fc99e Initial load
duke
parents:
diff changeset
94 sun.jvm.hotspot.debugger.win32.coff.AuxFunctionDefinitionRecord}.
a61af66fc99e Initial load
duke
parents:
diff changeset
95 Note that a symbol table record that has a section number of
a61af66fc99e Initial load
duke
parents:
diff changeset
96 UNDEFINED (0) does not define the function and does not have an
a61af66fc99e Initial load
duke
parents:
diff changeset
97 auxiliary record. */
a61af66fc99e Initial load
duke
parents:
diff changeset
98 public boolean isFunctionDefinition();
a61af66fc99e Initial load
duke
parents:
diff changeset
99
a61af66fc99e Initial load
duke
parents:
diff changeset
100 /** This should only be called if {@link #isFunctionDefinition}
a61af66fc99e Initial load
duke
parents:
diff changeset
101 returns true. */
a61af66fc99e Initial load
duke
parents:
diff changeset
102 public AuxFunctionDefinitionRecord getAuxFunctionDefinitionRecord();
a61af66fc99e Initial load
duke
parents:
diff changeset
103
a61af66fc99e Initial load
duke
parents:
diff changeset
104 /** Indicates whether this symbol is a .bf or .ef symbol record and
a61af66fc99e Initial load
duke
parents:
diff changeset
105 is therefore followed by an {@link
a61af66fc99e Initial load
duke
parents:
diff changeset
106 sun.jvm.hotspot.debugger.win32.coff.AuxBfEfRecord}. */
a61af66fc99e Initial load
duke
parents:
diff changeset
107 public boolean isBfOrEfSymbol();
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109 /** This should only be called if {@link #isBfOrEfSymbol} returns
a61af66fc99e Initial load
duke
parents:
diff changeset
110 true. */
a61af66fc99e Initial load
duke
parents:
diff changeset
111 public AuxBfEfRecord getAuxBfEfRecord();
a61af66fc99e Initial load
duke
parents:
diff changeset
112
a61af66fc99e Initial load
duke
parents:
diff changeset
113 /** Indicates whether this symbol is a weak external and is
a61af66fc99e Initial load
duke
parents:
diff changeset
114 therefore followed by an {@link
a61af66fc99e Initial load
duke
parents:
diff changeset
115 sun.jvm.hotspot.debugger.win32.coff.AuxWeakExternalRecord}. */
a61af66fc99e Initial load
duke
parents:
diff changeset
116 public boolean isWeakExternal();
a61af66fc99e Initial load
duke
parents:
diff changeset
117
a61af66fc99e Initial load
duke
parents:
diff changeset
118 /** This should only be called if {@link #isWeakExternal} returns
a61af66fc99e Initial load
duke
parents:
diff changeset
119 true. */
a61af66fc99e Initial load
duke
parents:
diff changeset
120 public AuxWeakExternalRecord getAuxWeakExternalRecord();
a61af66fc99e Initial load
duke
parents:
diff changeset
121
a61af66fc99e Initial load
duke
parents:
diff changeset
122 /** Indicates whether this symbol has storage class FILE and is
a61af66fc99e Initial load
duke
parents:
diff changeset
123 therefore followed by a {@link
a61af66fc99e Initial load
duke
parents:
diff changeset
124 sun.jvm.hotspot.debugger.win32.coff.AuxFileRecord}. */
a61af66fc99e Initial load
duke
parents:
diff changeset
125 public boolean isFile();
a61af66fc99e Initial load
duke
parents:
diff changeset
126
a61af66fc99e Initial load
duke
parents:
diff changeset
127 /** This should only be called if {@link #isFile} returns
a61af66fc99e Initial load
duke
parents:
diff changeset
128 true. */
a61af66fc99e Initial load
duke
parents:
diff changeset
129 public AuxFileRecord getAuxFileRecord();
a61af66fc99e Initial load
duke
parents:
diff changeset
130
a61af66fc99e Initial load
duke
parents:
diff changeset
131 /** Indicates whether this symbol defines a section and is therefore
a61af66fc99e Initial load
duke
parents:
diff changeset
132 followed by an {@link
a61af66fc99e Initial load
duke
parents:
diff changeset
133 sun.jvm.hotspot.debugger.win32.coff.AuxSectionDefinitionsRecord}. */
a61af66fc99e Initial load
duke
parents:
diff changeset
134 public boolean isSectionDefinition();
a61af66fc99e Initial load
duke
parents:
diff changeset
135
a61af66fc99e Initial load
duke
parents:
diff changeset
136 /** This should only be called if {@link #isSectionDefinition} returns
a61af66fc99e Initial load
duke
parents:
diff changeset
137 true. */
a61af66fc99e Initial load
duke
parents:
diff changeset
138 public AuxSectionDefinitionsRecord getAuxSectionDefinitionsRecord();
a61af66fc99e Initial load
duke
parents:
diff changeset
139 }