mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 12:49:33 +02:00
+ added class for reading/writing LINNUM (line number debug info) records in the
OMF object format git-svn-id: trunk@38953 -
This commit is contained in:
parent
02fb59d3e5
commit
ba2c06a239
@ -481,6 +481,22 @@ interface
|
||||
property PhysOffset: DWord read FPhysOffset write FPhysOffset;
|
||||
end;
|
||||
|
||||
{ TOmfRecord_LINNUM }
|
||||
|
||||
TOmfRecord_LINNUM = class(TOmfParsedRecord)
|
||||
private
|
||||
FIs32Bit: Boolean;
|
||||
FBaseGroup: Integer;
|
||||
FBaseSegment: Integer;
|
||||
public
|
||||
procedure DecodeFrom(RawRecord: TOmfRawRecord);override;
|
||||
procedure EncodeTo(RawRecord: TOmfRawRecord);override;
|
||||
|
||||
property Is32Bit: Boolean read FIs32Bit write FIs32Bit;
|
||||
property BaseGroup: Integer read FBaseGroup write FBaseGroup;
|
||||
property BaseSegment: Integer read FBaseSegment write FBaseSegment;
|
||||
end;
|
||||
|
||||
{ TOmfSubRecord_FIXUP }
|
||||
|
||||
TOmfSubRecord_FIXUP = class
|
||||
@ -1929,6 +1945,40 @@ implementation
|
||||
RawRecord.CalculateChecksumByte;
|
||||
end;
|
||||
|
||||
{ TOmfRecord_LINNUM }
|
||||
|
||||
procedure TOmfRecord_LINNUM.DecodeFrom(RawRecord: TOmfRawRecord);
|
||||
var
|
||||
NextOfs: Integer;
|
||||
begin
|
||||
if not (RawRecord.RecordType in [RT_LINNUM,RT_LINNUM32]) then
|
||||
internalerror(2018050801);
|
||||
Is32Bit:=RawRecord.RecordType=RT_LINNUM32;
|
||||
|
||||
NextOfs:=RawRecord.ReadIndexedRef(0,FBaseGroup);
|
||||
NextOfs:=RawRecord.ReadIndexedRef(NextOfs,FBaseSegment);
|
||||
|
||||
{ todo: read debugger style-specific info here }
|
||||
end;
|
||||
|
||||
procedure TOmfRecord_LINNUM.EncodeTo(RawRecord: TOmfRawRecord);
|
||||
var
|
||||
NextOfs: Integer;
|
||||
begin
|
||||
if Is32Bit then
|
||||
RawRecord.RecordType:=RT_LINNUM32
|
||||
else
|
||||
RawRecord.RecordType:=RT_LINNUM;
|
||||
|
||||
NextOfs:=RawRecord.WriteIndexedRef(0,BaseGroup);
|
||||
NextOfs:=RawRecord.WriteIndexedRef(NextOfs,BaseSegment);
|
||||
|
||||
{ todo: write debugger style-specific info here }
|
||||
|
||||
RawRecord.RecordLength:=NextOfs+1;
|
||||
RawRecord.CalculateChecksumByte;
|
||||
end;
|
||||
|
||||
{ TOmfSubRecord_FIXUP }
|
||||
|
||||
function TOmfSubRecord_FIXUP.GetDataRecordOffset: Integer;
|
||||
|
Loading…
Reference in New Issue
Block a user