Press enter to see results or esc to cancel.

Importing COMENT Object File Record

If local debug information is in enabled and comment class equals to ccSourceFile ($E8) this procedure processes object file COMENT record ($88). If source file number is 1, file name is copied to FileBuffer.

Procedure OMF_COMENT; Far;
Var TempSourceFileNumber: Byte;
begin
  If (DebugInformation in ModuleCompilerSwitches) and (ObjectFilePtr^.Comment.Class = ccSourceFile) then
    begin
      TempSourceFileNumber := ObjectFilePtr^.Comment.SourceFileNumber;
      If TempSourceFileNumber = 0 then
        begin
          Inc (LastSourceFileNumber);
          TempSourceFileNumber := LastSourceFileNumber;
        end;
      If (Ofs (ObjectFilePtr^.Comment.SourceFileName) <> ObjectRecordChecksumOffset) and (TempSourceFileNumber = 1) then
        begin
          StrUpper (StrPCopy (FileBuffer, ObjectFilePtr^.Comment.SourceFileName));
          OMF_SourceFileDateTime := LongInt (Pointer (
            PChar (@ObjectFilePtr^.Comment.SourceFileName) + Length (ObjectFilePtr^.Comment.SourceFileName) + 1)^);
          TempSourceFileNumber := 1;
        end;
      SourceFileNumber := TempSourceFileNumber;

{$IFDEF DEBUGOMF}
      Writeln ('        COMENT, Class: ', HexByte (ObjectFilePtr^.Comment.Class), ', Source file name ',
                                          SourceFileNumber, ': ', PChar (@FileBuffer));
{$ENDIF}

    end;
end;