annotate agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/ExportDirectoryTable.java @ 1913:3b2dea75431e

6984311: JSR 292 needs optional bootstrap method parameters Summary: Allow CONSTANT_InvokeDynamic nodes to have any number of extra operands. Reviewed-by: twisti
author jrose
date Sat, 30 Oct 2010 13:08:23 -0700
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, 2001, 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 /** Models the information stored in the export directory table.
a61af66fc99e Initial load
duke
parents:
diff changeset
28 Ostensibly this is supposed to lie in the .edata section.
a61af66fc99e Initial load
duke
parents:
diff changeset
29 However, experience has shown that this data does not appear to be
a61af66fc99e Initial load
duke
parents:
diff changeset
30 present there, instead (likely -- not yet tested) showing up in
a61af66fc99e Initial load
duke
parents:
diff changeset
31 the Export Table portion of the OptionalHeaderDataDirectories.
a61af66fc99e Initial load
duke
parents:
diff changeset
32 (Some of the descriptions are taken directly from Microsoft's
a61af66fc99e Initial load
duke
parents:
diff changeset
33 documentation and are copyrighted by Microsoft.) */
a61af66fc99e Initial load
duke
parents:
diff changeset
34
a61af66fc99e Initial load
duke
parents:
diff changeset
35 public interface ExportDirectoryTable {
a61af66fc99e Initial load
duke
parents:
diff changeset
36 /** A reserved field, set to zero for now. */
a61af66fc99e Initial load
duke
parents:
diff changeset
37 public int getExportFlags();
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 /** Time and date the export data was created. */
a61af66fc99e Initial load
duke
parents:
diff changeset
40 public int getTimeDateStamp();
a61af66fc99e Initial load
duke
parents:
diff changeset
41
a61af66fc99e Initial load
duke
parents:
diff changeset
42 /** Major version number. The major/minor version number can be set
a61af66fc99e Initial load
duke
parents:
diff changeset
43 by the user. */
a61af66fc99e Initial load
duke
parents:
diff changeset
44 public short getMajorVersion();
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 /** Minor version number. */
a61af66fc99e Initial load
duke
parents:
diff changeset
47 public short getMinorVersion();
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49 /** Address of the ASCII string containing the name of the
a61af66fc99e Initial load
duke
parents:
diff changeset
50 DLL. Relative to image base. See {@link #getDLLName}. */
a61af66fc99e Initial load
duke
parents:
diff changeset
51 public int getNameRVA();
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 /** Convenience routine which returns the name of the DLL containing
a61af66fc99e Initial load
duke
parents:
diff changeset
54 this export directory. */
a61af66fc99e Initial load
duke
parents:
diff changeset
55 public String getDLLName();
a61af66fc99e Initial load
duke
parents:
diff changeset
56
a61af66fc99e Initial load
duke
parents:
diff changeset
57 /** Starting ordinal number for exports in this image. This field
a61af66fc99e Initial load
duke
parents:
diff changeset
58 specifies the starting ordinal number for the Export Address
a61af66fc99e Initial load
duke
parents:
diff changeset
59 Table. Usually set to 1. */
a61af66fc99e Initial load
duke
parents:
diff changeset
60 public int getOrdinalBase();
a61af66fc99e Initial load
duke
parents:
diff changeset
61
a61af66fc99e Initial load
duke
parents:
diff changeset
62 /** Number of entries in the Export Address Table. */
a61af66fc99e Initial load
duke
parents:
diff changeset
63 public int getNumberOfAddressTableEntries();
a61af66fc99e Initial load
duke
parents:
diff changeset
64
a61af66fc99e Initial load
duke
parents:
diff changeset
65 /** Number of entries in the Name Pointer Table (also the number of
a61af66fc99e Initial load
duke
parents:
diff changeset
66 entries in the Ordinal Table). */
a61af66fc99e Initial load
duke
parents:
diff changeset
67 public int getNumberOfNamePointers();
a61af66fc99e Initial load
duke
parents:
diff changeset
68
a61af66fc99e Initial load
duke
parents:
diff changeset
69 /** Address of the Export Address Table, relative to the image
a61af66fc99e Initial load
duke
parents:
diff changeset
70 base. */
a61af66fc99e Initial load
duke
parents:
diff changeset
71 public int getExportAddressTableRVA();
a61af66fc99e Initial load
duke
parents:
diff changeset
72
a61af66fc99e Initial load
duke
parents:
diff changeset
73 /** Address of the Export Name Pointer Table, relative to the image
a61af66fc99e Initial load
duke
parents:
diff changeset
74 base. The table size is given by Number of Name Pointers. */
a61af66fc99e Initial load
duke
parents:
diff changeset
75 public int getNamePointerTableRVA();
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 /** Address of the Ordinal Table, relative to the image base. */
a61af66fc99e Initial load
duke
parents:
diff changeset
78 public int getOrdinalTableRVA();
a61af66fc99e Initial load
duke
parents:
diff changeset
79
a61af66fc99e Initial load
duke
parents:
diff changeset
80 /** Returns the <I>i</I>th exported symbol (from 0..{@link
a61af66fc99e Initial load
duke
parents:
diff changeset
81 #getNumberOfNamePointers} - 1). These are arranged in sorted
a61af66fc99e Initial load
duke
parents:
diff changeset
82 order to allow binary searches. */
a61af66fc99e Initial load
duke
parents:
diff changeset
83 public String getExportName(int i);
a61af66fc99e Initial load
duke
parents:
diff changeset
84
a61af66fc99e Initial load
duke
parents:
diff changeset
85 /** Returns the <I>i</I>th entry (0..{@link
a61af66fc99e Initial load
duke
parents:
diff changeset
86 #getNumberOfNamePointers} in the Export Ordinal Table. This is
a61af66fc99e Initial load
duke
parents:
diff changeset
87 used for looking up a given symbol's address in the Export
a61af66fc99e Initial load
duke
parents:
diff changeset
88 Address Table; see {@link #getExportAddress}. */
a61af66fc99e Initial load
duke
parents:
diff changeset
89 public short getExportOrdinal(int i);
a61af66fc99e Initial load
duke
parents:
diff changeset
90
a61af66fc99e Initial load
duke
parents:
diff changeset
91 /** Indicates whether the specified export address is really a
a61af66fc99e Initial load
duke
parents:
diff changeset
92 forwarder, in which case the value is not an address but a
a61af66fc99e Initial load
duke
parents:
diff changeset
93 string. */
a61af66fc99e Initial load
duke
parents:
diff changeset
94 public boolean isExportAddressForwarder(short ordinal);
a61af66fc99e Initial load
duke
parents:
diff changeset
95
a61af66fc99e Initial load
duke
parents:
diff changeset
96 /** Get the forwarder name for the given ordinal. Must be called
a61af66fc99e Initial load
duke
parents:
diff changeset
97 only if isExportAddressForwarder() returns true. */
a61af66fc99e Initial load
duke
parents:
diff changeset
98 public String getExportAddressForwarder(short ordinal);
a61af66fc99e Initial load
duke
parents:
diff changeset
99
a61af66fc99e Initial load
duke
parents:
diff changeset
100 /** <P> Takes in an ordinal from the Export Ordinal Table (see
a61af66fc99e Initial load
duke
parents:
diff changeset
101 {@link #getExportOrdinal}). This ordinal is biased by {@link
a61af66fc99e Initial load
duke
parents:
diff changeset
102 #getOrdinalBase}; however, the subtraction described in the
a61af66fc99e Initial load
duke
parents:
diff changeset
103 documentation is done internally for convenience. Returns an
a61af66fc99e Initial load
duke
parents:
diff changeset
104 address that is in one of two formats. If the address specified
a61af66fc99e Initial load
duke
parents:
diff changeset
105 is not within the export section (as defined by the address and
a61af66fc99e Initial load
duke
parents:
diff changeset
106 length indicated in the Optional Header), the field is an Export
a61af66fc99e Initial load
duke
parents:
diff changeset
107 RVA: an actual address in code or data. Otherwise, the field is
a61af66fc99e Initial load
duke
parents:
diff changeset
108 a Forwarder RVA, which names a symbol in another DLL. </P>
a61af66fc99e Initial load
duke
parents:
diff changeset
109
a61af66fc99e Initial load
duke
parents:
diff changeset
110 <P> An Export RVA is the address of the exported symbol when
a61af66fc99e Initial load
duke
parents:
diff changeset
111 loaded into memory, relative to the image base. For example, the
a61af66fc99e Initial load
duke
parents:
diff changeset
112 address of an exported function. </P>
a61af66fc99e Initial load
duke
parents:
diff changeset
113
a61af66fc99e Initial load
duke
parents:
diff changeset
114 <P> A Forwarder RVA is a pointer to a null-terminated ASCII
a61af66fc99e Initial load
duke
parents:
diff changeset
115 string in the export section, giving the DLL name and the name
a61af66fc99e Initial load
duke
parents:
diff changeset
116 of the export (for example, "MYDLL.expfunc") or the DLL
a61af66fc99e Initial load
duke
parents:
diff changeset
117 name and an export (for example, "MYDLL.#27"). </P>
a61af66fc99e Initial load
duke
parents:
diff changeset
118
a61af66fc99e Initial load
duke
parents:
diff changeset
119 <P> NOTE: the value returned has been transformed from an RVA to
a61af66fc99e Initial load
duke
parents:
diff changeset
120 a file pointer which can be added to the image base to find an
a61af66fc99e Initial load
duke
parents:
diff changeset
121 absolute address for the symbol. </P> */
a61af66fc99e Initial load
duke
parents:
diff changeset
122 public int getExportAddress(short ordinal);
a61af66fc99e Initial load
duke
parents:
diff changeset
123 }