home *** CD-ROM | disk | FTP | other *** search
- This is an outline of the structure of the Turbo Pascal 6.0 and Turbo
- Pascal for Windows 1.0 TPU file format. Both use the same format of TPU
- file, with signature TPU9.
-
- There are five sections; the first one has ten subsections. Each
- section is limited to 64K in size.
-
- I. SYMBOL SECTION
-
- This section contains all the symbolic information, and has several
- subsections.
-
- The size is given in header.symsize. Actual size in file is rounded up
- to next even paragraph, as are all the sections.
-
- A. Header subsection (/H turns display on)
-
- Contains sizes, pointers, flags, and signature TPU9. Structure given in
- HEAD.PAS. About $40 bytes, but it's not clear where it ends - the last
- part is always zeroed.
-
- B. Object subsection (/N turns display off, or /I turns full display on)
-
- An unfortunate choice of a name: this section contains all the symbolic
- information, not just for Objects. It contains one or two hash tables
- to get access to the various objects: the interfaced objects are
- available from the one at ofs_hashtable, all debuggable ones are
- available from the one at ofs_full_hash. There are also other smaller
- hash tables: members of records, locals to functions/procedures, etc.
- HASH.PAS decodes the hash table.
-
- There are basically two types of records: obj_rec's and type_def_rec's.
- Obj_rec's give the name and "type", and are followed by specialized
- information describing the object. Type_def_rec's give constructions
- for type definitions. Both are given in NAMELIST.PAS and NAMETYPE.PAS,
- though the type_def_rec's should be handled by their own unit.
-
- C. Entry point subsection (/E turns display on)
-
- This is an array of fixed length records, one per
- function/procedure/method in the unit. It gives the code block of the
- routine, and the entry point within that code block. The first entry is
- for the initialization section of the unit.
-
- D. Code block subsection (/D turns display on)
-
- This is an array of fixed length records, one per block of code
- (usually, one per routine, but .OBJ files get just one block).
-
- E. Const block subsection (/C turns display on)
-
- Another array of fixed length records, one per block of initialized
- data. (This will be a typed Const declaration, or the VMT of an object.
-
- F. Var block subsection (/V turns display on)
-
- The same sort of thing for uninitialized static data.
-
- G. Window DLL subsection (/W turns display on)
-
- This section never appears in TP6 files, only in TPW. It gives a table
- of external names which TPW for links to Dynamic Link Libraries.
-
- H. Unit list subsection (/U turns display on)
-
- All units on which this one depends are listed, in variable length
- records.
-
- I. Source names subsection (/S turns display on)
-
- This section lists the source files, and .OBJ files that were linked
- into this unit.
-
- J. Line lengths subsection (/M turns display on)
-
- If debugging is turned on, the records here give the correspondence
- between source code lines and bytes in the code blocks.
-
- II. CODE SECTION (/B turns display on)
-
- This section contains the compiled object code, in the order listed in
- the code block subsection above. I don't know if there is any
- separation between blocks.
-
- III. CONST SECTION (/G turns display on)
-
- The initialized data, in the order of the const blocks.
-
- IV. CODE RELOCATION RECORDS (/R turns display on)
-
- A big array of fixed length records, giving the relocation fixups for
- the code blocks.
-
- V. CONST RELOCATION RECORDS (/O turns display on)
-
- An array in the same format as IV, giving the relocation fixups for the
- const blocks. Used for fixups for the VMT tables of objects, and
- initialized pointer constants.