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