home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 12 / CD_ASCQ_12_0294.iso / news / 563 / tdinfo / oa.txt < prev    next >
Text File  |  1993-09-21  |  6KB  |  154 lines

  1. Errors and omissions
  2. Borland Open Architecture Handbook for Pascal
  3. Chapter 4 Symbol table format  (Turbo Debug Information)
  4.  
  5. Andy McFarland [71055,2743]
  6.  
  7. p 51  This chapter describes the format of the symbol table that
  8.       appears at the END of an .EXE file.
  9.  
  10. p 51  Observed VersionIDs for BP7 : $208 (real mode without objects),
  11.       $209 (real mode with objects), $300 (protected mode).
  12.  
  13. p 51  GlobalsCount is optional -- 0 for Pascal EXE's
  14.  
  15. p 52  TDebugHeader.ImageSize is 0 for Pascal EXE's  Need to calculate
  16.       this using information from EXE header (real mode), or CodeView
  17.       trailer (protected mode).
  18.  
  19. p 52  DataCount = length of DataPool.  DataPool contains untyped
  20.       constant strings and extended constants where Symbol.Offset =
  21.       offset in DataPool. Untyped constant sets do not appear in the
  22.       data pool.
  23.  
  24. p 52  If ExtensionSize = 16, CoverageOffsetCount and the first word
  25.       of NamePoolOffset are filler.
  26.  
  27. p 53  'memory map' is not a section in the debug information.
  28.  
  29. p 53  There are 16 bytes from the CodeView header to the start of Turbo
  30.       Debug information.  First two bytes are 'NB' (Protected mode)
  31.  
  32. p 53  Names are NOT stored uniquely. (Pascal)
  33.  
  34. p 54  Observed values for TSymbolRecord.Info :
  35.         0 : Assembler subroutines with no stack frame
  36.             Interrupt procedures
  37.             Global variables
  38.             Typed Constants
  39.             Absolute <identifier>
  40.         1 : Absolute segment:offset
  41.         2 : Local variables
  42.         3 : Function result returned on the stack -- string
  43.             Self
  44.         5 : Untyped constants
  45.         6 : Type
  46.        10 : Value parameter
  47.        11 : Var parameter
  48.        24 : Subroutines with a stack frame
  49.  
  50. p 54  Symbols are sorted, but the main criterion is not 'address order'.
  51.  
  52. p 56  Return_address_word_offset is not used by Pascal
  53.  
  54. p 56  Type ModuleHeader, reorder fields : Language then Flags
  55.  
  56. p 56  Memory_model := Flags and 7 ;
  57.  
  58. p 57  For Pascal only : Symbols_index is the first global symbol in
  59.       the implementation, Symbols_count is the number of symbols in
  60.       the implementation.
  61.  
  62.       For each unit, all symbols in the interface precede the symbols
  63.       in the implementation.
  64.  
  65. p 59  'Only unique offset have line numbers stored.'  If several lines
  66.       have the same offset, only the one which generates code is stored.
  67.  
  68. p 59  'When a statement spans several lines' ...  I have not found
  69.       any example of more than one line record for one source line.
  70.  
  71. p 59  Function_symbol = $FFFF (UnitScope) :
  72.          Autos_index is the first symbol in a unit.
  73.          Autos_count is the number of symbols in the interface.
  74.          Parent_Scope is ScopeIndex of the first UsesScope.
  75.          Scope_Offset, Scope_Length is of unit initialization, if any.
  76.  
  77.       Function_Symbol = $FFFE (UsesScope) :
  78.          Autos_Index is the index to the UnitScope.
  79.          Parent_Scope is the index to the next UsesScope.
  80.  
  81. p 59  Function_parent should be Function_symbol
  82.  
  83. p 60  Scope_parent should be Parent_scope.
  84.  
  85. p 61  Typedef makes no sense here, Correlation would be better.
  86.  
  87. p 61  TypeIndex = 0 for Protected mode System.RealModeRegisters.
  88.       TDX can not access RealModeRegisters.
  89.  
  90. p 61  Interrupt Procedures generate Type 30 (near Pascal procedure)
  91.       not Type 32 (Interrupt Procedure)
  92.  
  93. p 62  tid_sQuad tid_uQuad  are not ranges.
  94. p 66  tid_Bool, tid_Tbyte are not ranges.
  95. p 68  tid_WordBool, tid_LongBool
  96.       The type record is 8 bytes : Type_id, Type_name, Type_size,
  97.       3 bytes filler
  98.  
  99. p 63  Pointers Extra_Info is not documented. Extra_Info = 2 for PChar
  100.  
  101. p 65  Functions, Language see table on p 66.  Language and $40 <> 0
  102.       means nested subroutine -- see TDUMP -v.
  103.  
  104. p 65  Functions, Accepts var.args.  At least one parameter is passed
  105.       by reference, a 'var' parameter.
  106.  
  107. p 65  'Accepts var.args' works for Pascal functions but not procedures
  108.  
  109. p 65  For 'small' sets  offset 5 is 1.
  110.  
  111. p 67  Special functions Byte_15 = $90 for dymanic methods, $10 all
  112.       other methods.  Byte_14 = 0 in all observations.
  113.  
  114. p 71  New_Offset : Word ;  last two bytes in Struct_Offset_Rec not used
  115.  
  116. p 71  Offset_rec := (Info = $40)  see p 72 last paragraph.
  117.  
  118. p 72  Member_rec is a variant record (union).  SizeOf(Member_rec)
  119.       = 5.  see p 73 last paragraph, p 74 for the Info field.
  120.  
  121. p 73  End_of_structure  (Info and $80) <> 0
  122.  
  123. p 73  TParentTable is the identifier used for parents p 74
  124.  
  125. p 73  If object does not have a VMT, Virtual_ptr = $FFFF.
  126.  
  127. p 73  Info = $10 in all observations
  128.  
  129. p 74  Special cases : 'Member_record' refers to the Info field in the
  130.       member_record.
  131.  
  132. p 74  If a Record type is smart linked, the record's fields do show as
  133.       members.
  134.  
  135. p 75  'If any scope class records are needed, there must be one record
  136.       for each scope record'.  BP7 has one scope class record for each
  137.       module record.
  138.  
  139.       ScopeExtension Class_Index, Class_Count are for objects in
  140.       Interface.
  141.  
  142. p 75  Class_Index is NOT the first Object in the Implementation.
  143.  
  144.       Module class table
  145.       Type
  146.          LocalClass =
  147.          Record
  148.             Overload_index,           { 0 for BP7 }
  149.             Overload_count : Word ;   { 0 for BP7 }
  150.             Class_index,          { ??? }
  151.             Class_count : Word ;  { number of objects in Implementation }
  152.          End ;
  153.  
  154. p 76  Coverage is not used in BP7 or when DebugHeader.ExtensionSize = 16