1 | /* $Id: hll.h,v 1.6 2000-05-27 02:15:41 bird Exp $
|
---|
2 | *
|
---|
3 | * HLL definitions.
|
---|
4 | *
|
---|
5 | * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
|
---|
6 | *
|
---|
7 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
8 | *
|
---|
9 | */
|
---|
10 | #ifndef _HLL_h_
|
---|
11 | #define _HLL_h_
|
---|
12 |
|
---|
13 | #pragma pack(1)
|
---|
14 |
|
---|
15 |
|
---|
16 | /*******************************************************************************
|
---|
17 | * Defined Constants And Macros *
|
---|
18 | *******************************************************************************/
|
---|
19 | /*
|
---|
20 | * HLL version macros
|
---|
21 | */
|
---|
22 | #define HLLVERSION100 0x0100
|
---|
23 | #define HLLVERSION300 0x0300
|
---|
24 | #define HLLVERSION400 0x0400
|
---|
25 | #define HLLVERSION500 0x0500
|
---|
26 | #define HLLMAKEVER(major, minor) (int)( ((int)(char)(major) << 8) | (int)(char)(minor) )
|
---|
27 |
|
---|
28 | /*
|
---|
29 | * HLL Directory entry types.
|
---|
30 | */
|
---|
31 | #define HLL_DE_MODULES 0x0101 /* Filename */
|
---|
32 | #define HLL_DE_PUBLICS 0x0102 /* Public symbols */
|
---|
33 | #define HLL_DE_TYPES 0x0103 /* Types */
|
---|
34 | #define HLL_DE_SYMBOLS 0x0104 /* Symbols */
|
---|
35 | #define HLL_DE_LIBRARIES 0x0106 /* Libraries */
|
---|
36 | #define HLL_DE_SRCLINES 0x0105 /* Line numbers - (IBM C/2 1.1) */
|
---|
37 | #define HLL_DE_SRCLNSEG 0x0109 /* Line numbers - (MSC 6.00) */
|
---|
38 | #define HLL_DE_IBMSRC 0x010B /* Line numbers - (IBM HLL) */
|
---|
39 |
|
---|
40 |
|
---|
41 | /*
|
---|
42 | * HLL Module debug style
|
---|
43 | */
|
---|
44 | #define HLL_MOD_STYLE 0x4C48 /* 'HL' */
|
---|
45 |
|
---|
46 |
|
---|
47 | /*
|
---|
48 | * HLL Public symbol wide flag.
|
---|
49 | */
|
---|
50 | #define HLL_PFS_WIDE 0x6e /* Wide flag. */
|
---|
51 |
|
---|
52 |
|
---|
53 |
|
---|
54 | /*******************************************************************************
|
---|
55 | * Structures and Typedefs *
|
---|
56 | *******************************************************************************/
|
---|
57 |
|
---|
58 | /*
|
---|
59 | * HLL Header
|
---|
60 | */
|
---|
61 | typedef struct _HLLHdr
|
---|
62 | {
|
---|
63 | unsigned char achSignature[4]; /* LX Debug Info Signature, 'NB04' */
|
---|
64 | unsigned long offDirectory; /* Offset to the HLL Directory.
|
---|
65 | * (Relative to start of this header.) */
|
---|
66 | } HLLHDR, *PHLLHDR;
|
---|
67 |
|
---|
68 |
|
---|
69 | /*
|
---|
70 | * HLL Directory Entry.
|
---|
71 | */
|
---|
72 | typedef struct _HLLDirEntry
|
---|
73 | {
|
---|
74 | unsigned short usType; /* Entry type. HLL_DE_* flag. */
|
---|
75 | unsigned short iMod; /* Module number data applies to. */
|
---|
76 | unsigned long off; /* Offset to data. This is based at
|
---|
77 | * the start of the start of the debug
|
---|
78 | * info. */
|
---|
79 | unsigned long cb; /* Size of data. */
|
---|
80 | } HLLDIRENTRY, *PHLLDIRENTRY;
|
---|
81 |
|
---|
82 |
|
---|
83 |
|
---|
84 | /*
|
---|
85 | * HLL Directory.
|
---|
86 | */
|
---|
87 | typedef struct _HLLDirectory
|
---|
88 | {
|
---|
89 | unsigned short cb; /* Size of this struct (minus aEntries)
|
---|
90 | * / offset of aEntries relative to start of this structure. */
|
---|
91 | unsigned short cbEntry; /* Size of the directory entries (HLLDIRENTRY). */
|
---|
92 | unsigned long cEntries; /* Count of directory entires. */
|
---|
93 | HLLDIRENTRY aEntries[1]; /* Directory. */
|
---|
94 | } HLLDIR, *PHLLDIR;
|
---|
95 |
|
---|
96 |
|
---|
97 | /*
|
---|
98 | * HLL Segment
|
---|
99 | */
|
---|
100 | typedef struct _HLLSegInfo
|
---|
101 | {
|
---|
102 | unsigned short iObject; /* LX Object number. */
|
---|
103 | unsigned long off; /* Offset into the load image. */
|
---|
104 | unsigned long cb; /* Object length. */
|
---|
105 | } HLLSEGINFO, *PHLLSEGINFO;
|
---|
106 |
|
---|
107 |
|
---|
108 | /*
|
---|
109 | * HLL Module (file)
|
---|
110 | */
|
---|
111 | typedef struct _HLLModule
|
---|
112 | {
|
---|
113 | HLLSEGINFO SegInfo0; /* Segment info entry 0. */
|
---|
114 | unsigned short overlay; /* unused. */
|
---|
115 | unsigned short iLib; /* Library number it came from. */
|
---|
116 | unsigned char cSegInfo; /* Number of segment info entries. */
|
---|
117 | unsigned char pad; /* 1 byte padding. */
|
---|
118 | unsigned short usDebugStyle; /* Debug style -'HL' */
|
---|
119 | unsigned char chVerMinor; /* HLL version - minor number. */
|
---|
120 | unsigned char chVerMajor; /* HLL version - major number. */
|
---|
121 | unsigned char cchName; /* Filename length. */
|
---|
122 | unsigned char achName[1]; /* Filename. (*) */
|
---|
123 | /* HLLSEGINFO aSegInfo[] */ /* Array of segment info, starting with entry 1. (Starts at achName[cchName]) */
|
---|
124 | } HLLMODULE, *PHLLMODULE;
|
---|
125 |
|
---|
126 |
|
---|
127 | /*
|
---|
128 | * HLL Public Symbols
|
---|
129 | */
|
---|
130 | typedef struct _HLLPublicSymbol
|
---|
131 | {
|
---|
132 | unsigned long off; /* 32-bit offset (into the LX object) of the symbol location. */
|
---|
133 | unsigned short iObject; /* LX Object number. */
|
---|
134 | unsigned short iType; /* Symbol type index (into the type info data). */
|
---|
135 | unsigned char cchName; /* Size of name. */
|
---|
136 | unsigned char achName[1]; /* Name (*) */
|
---|
137 | } HLLPUBLICSYM, *PHLLPUBLICSYM;
|
---|
138 |
|
---|
139 |
|
---|
140 | /*
|
---|
141 | * HLL First entry of the IBMSRC data.
|
---|
142 | */
|
---|
143 | typedef union _HLLFirstEntry
|
---|
144 | {
|
---|
145 | struct
|
---|
146 | {
|
---|
147 | unsigned short usLine;
|
---|
148 | unsigned char uchType;
|
---|
149 | unsigned char uchReserved;
|
---|
150 | unsigned short cEntries;
|
---|
151 | union
|
---|
152 | {
|
---|
153 | unsigned short cbFileNameTable;
|
---|
154 | unsigned short cPathTableEntries;
|
---|
155 | unsigned short offBase;
|
---|
156 | } u1;
|
---|
157 | } hll01;
|
---|
158 | struct
|
---|
159 | {
|
---|
160 | unsigned short usLine;
|
---|
161 | unsigned char uchType;
|
---|
162 | unsigned char uchReserved;
|
---|
163 | unsigned short cEntries;
|
---|
164 | unsigned short iSeg;
|
---|
165 | union
|
---|
166 | {
|
---|
167 | unsigned long cbFileNameTable;
|
---|
168 | unsigned long cPathTableEntries;
|
---|
169 | unsigned long offBase;
|
---|
170 | } u1;
|
---|
171 | } hll03, hll04;
|
---|
172 | } HLLFIRSTENTRY, *PHLLFIRSTENTRY;
|
---|
173 |
|
---|
174 |
|
---|
175 | /*
|
---|
176 | * HLL Source filename entry.
|
---|
177 | */
|
---|
178 | typedef struct _HLLFilenameEntry
|
---|
179 | {
|
---|
180 | unsigned long offSource;
|
---|
181 | unsigned long cSourceRecords;
|
---|
182 | unsigned long cSourceFiles;
|
---|
183 | unsigned char cchName;
|
---|
184 | unsigned char achName[1];
|
---|
185 | } HLLFILENAMEENTRY, *PHLLFILENAMEENTRY;
|
---|
186 |
|
---|
187 |
|
---|
188 | /*
|
---|
189 | * HLL Linenumber entry.
|
---|
190 | */
|
---|
191 | typedef union _HLLLinenumberEntry
|
---|
192 | {
|
---|
193 | struct
|
---|
194 | {
|
---|
195 | unsigned short usLine;
|
---|
196 | unsigned char ichSourceFile;
|
---|
197 | unsigned char chFlags;
|
---|
198 | unsigned long off;
|
---|
199 | } hll01;
|
---|
200 | struct
|
---|
201 | {
|
---|
202 | unsigned short usLine;
|
---|
203 | unsigned short iusSourceFile;
|
---|
204 | unsigned long off;
|
---|
205 | } hll03, hll04;
|
---|
206 | } HLLLINENUMBERENTRY, *PHLLLINENUMBERENTRY;
|
---|
207 |
|
---|
208 |
|
---|
209 | /*
|
---|
210 | * HLL Path entry (HLL 01)
|
---|
211 | */
|
---|
212 | typedef struct _HLLPathEntry_HL01
|
---|
213 | {
|
---|
214 | unsigned long off;
|
---|
215 | unsigned short usPathcode;
|
---|
216 | } HLLPATHENTRY_HL01, *PHLLPATHENTRY_HL01;
|
---|
217 |
|
---|
218 |
|
---|
219 | #pragma pack()
|
---|
220 |
|
---|
221 | #endif
|
---|