mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 13:49:15 +02:00
* extracted the parts of the TOmfRecord_LINNUM_MsLink class, which implement a
container of TOmfSubRecord_LINNUM_MsLink_Entry objects to a separate class TOmfSubRecord_LINNUM_MsLink_LineNumberList git-svn-id: trunk@38968 -
This commit is contained in:
parent
718e83954f
commit
0b296ac828
@ -517,27 +517,36 @@ interface
|
|||||||
property Offset: DWord read FOffset write FOffset;
|
property Offset: DWord read FOffset write FOffset;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TOmfRecord_LINNUM_MsLink }
|
{ TOmfSubRecord_LINNUM_MsLink_LineNumberList }
|
||||||
|
|
||||||
TOmfRecord_LINNUM_MsLink = class(TOmfRecord_LINNUM)
|
TOmfSubRecord_LINNUM_MsLink_LineNumberList = class
|
||||||
private
|
private
|
||||||
FLineNumbers: TFPObjectList;
|
FLineNumbers: TFPObjectList;
|
||||||
function GetCount: Integer;
|
function GetCount: Integer;
|
||||||
function GetItem(Index: Integer): TOmfSubRecord_LINNUM_MsLink_Entry;
|
function GetItem(Index: Integer): TOmfSubRecord_LINNUM_MsLink_Entry;
|
||||||
procedure SetCount(AValue: Integer);
|
procedure SetCount(AValue: Integer);
|
||||||
procedure SetItem(Index: Integer; AValue: TOmfSubRecord_LINNUM_MsLink_Entry);
|
procedure SetItem(Index: Integer; AValue: TOmfSubRecord_LINNUM_MsLink_Entry);
|
||||||
protected
|
|
||||||
procedure DebugFormatSpecific_DecodeFrom(RawRecord:TOmfRawRecord;NextOfs:Integer);override;
|
|
||||||
procedure DebugFormatSpecific_EncodeTo(RawRecord:TOmfRawRecord;var NextOfs:Integer);override;
|
|
||||||
public
|
public
|
||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy;override;
|
destructor Destroy;override;
|
||||||
|
|
||||||
property Count: Integer read GetCount write SetCount;
|
|
||||||
function Add(AObject: TOmfSubRecord_LINNUM_MsLink_Entry): Integer;
|
function Add(AObject: TOmfSubRecord_LINNUM_MsLink_Entry): Integer;
|
||||||
|
property Count: Integer read GetCount write SetCount;
|
||||||
property Items[Index: Integer]: TOmfSubRecord_LINNUM_MsLink_Entry read GetItem write SetItem; default;
|
property Items[Index: Integer]: TOmfSubRecord_LINNUM_MsLink_Entry read GetItem write SetItem; default;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TOmfRecord_LINNUM_MsLink }
|
||||||
|
|
||||||
|
TOmfRecord_LINNUM_MsLink = class(TOmfRecord_LINNUM)
|
||||||
|
private
|
||||||
|
FLineNumberList: TOmfSubRecord_LINNUM_MsLink_LineNumberList;
|
||||||
|
protected
|
||||||
|
procedure DebugFormatSpecific_DecodeFrom(RawRecord:TOmfRawRecord;NextOfs:Integer);override;
|
||||||
|
procedure DebugFormatSpecific_EncodeTo(RawRecord:TOmfRawRecord;var NextOfs:Integer);override;
|
||||||
|
|
||||||
|
property LineNumberList: TOmfSubRecord_LINNUM_MsLink_LineNumberList read FLineNumberList write FLineNumberList;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TOmfSubRecord_FIXUP }
|
{ TOmfSubRecord_FIXUP }
|
||||||
|
|
||||||
TOmfSubRecord_FIXUP = class
|
TOmfSubRecord_FIXUP = class
|
||||||
@ -2041,28 +2050,50 @@ implementation
|
|||||||
Offset:=AOffset;
|
Offset:=AOffset;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TOmfRecord_LINNUM_MsLink }
|
{ TOmfSubRecord_LINNUM_MsLink_LineNumberList }
|
||||||
|
|
||||||
function TOmfRecord_LINNUM_MsLink.GetItem(Index: Integer): TOmfSubRecord_LINNUM_MsLink_Entry;
|
function TOmfSubRecord_LINNUM_MsLink_LineNumberList.GetCount: Integer;
|
||||||
begin
|
|
||||||
result:=TOmfSubRecord_LINNUM_MsLink_Entry(FLineNumbers[Index]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TOmfRecord_LINNUM_MsLink.GetCount: Integer;
|
|
||||||
begin
|
begin
|
||||||
result:=FLineNumbers.Count;
|
result:=FLineNumbers.Count;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TOmfRecord_LINNUM_MsLink.SetCount(AValue: Integer);
|
function TOmfSubRecord_LINNUM_MsLink_LineNumberList.GetItem(Index: Integer
|
||||||
|
): TOmfSubRecord_LINNUM_MsLink_Entry;
|
||||||
|
begin
|
||||||
|
result:=TOmfSubRecord_LINNUM_MsLink_Entry(FLineNumbers[Index]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TOmfSubRecord_LINNUM_MsLink_LineNumberList.SetCount(AValue: Integer
|
||||||
|
);
|
||||||
begin
|
begin
|
||||||
FLineNumbers.Count:=AValue;
|
FLineNumbers.Count:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TOmfRecord_LINNUM_MsLink.SetItem(Index: Integer; AValue: TOmfSubRecord_LINNUM_MsLink_Entry);
|
procedure TOmfSubRecord_LINNUM_MsLink_LineNumberList.SetItem(Index: Integer;
|
||||||
|
AValue: TOmfSubRecord_LINNUM_MsLink_Entry);
|
||||||
begin
|
begin
|
||||||
FLineNumbers[Index]:=AValue;
|
FLineNumbers[Index]:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
constructor TOmfSubRecord_LINNUM_MsLink_LineNumberList.Create;
|
||||||
|
begin
|
||||||
|
FLineNumbers:=TFPObjectList.Create(true);
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TOmfSubRecord_LINNUM_MsLink_LineNumberList.Destroy;
|
||||||
|
begin
|
||||||
|
FLineNumbers.Free;
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TOmfSubRecord_LINNUM_MsLink_LineNumberList.Add(
|
||||||
|
AObject: TOmfSubRecord_LINNUM_MsLink_Entry): Integer;
|
||||||
|
begin
|
||||||
|
Result:=FLineNumbers.Add(AObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TOmfRecord_LINNUM_MsLink }
|
||||||
|
|
||||||
procedure TOmfRecord_LINNUM_MsLink.DebugFormatSpecific_DecodeFrom(
|
procedure TOmfRecord_LINNUM_MsLink.DebugFormatSpecific_DecodeFrom(
|
||||||
RawRecord: TOmfRawRecord; NextOfs: Integer);
|
RawRecord: TOmfRawRecord; NextOfs: Integer);
|
||||||
var
|
var
|
||||||
@ -2070,7 +2101,6 @@ implementation
|
|||||||
LineNumber: Word;
|
LineNumber: Word;
|
||||||
Offset: DWord;
|
Offset: DWord;
|
||||||
begin
|
begin
|
||||||
FLineNumbers.Clear;
|
|
||||||
if Is32Bit then
|
if Is32Bit then
|
||||||
RecordSize:=6
|
RecordSize:=6
|
||||||
else
|
else
|
||||||
@ -2087,7 +2117,7 @@ implementation
|
|||||||
else
|
else
|
||||||
Offset:=RawRecord.RawData[NextOfs+2]+
|
Offset:=RawRecord.RawData[NextOfs+2]+
|
||||||
(RawRecord.RawData[NextOfs+3] shl 8);
|
(RawRecord.RawData[NextOfs+3] shl 8);
|
||||||
Add(TOmfSubRecord_LINNUM_MsLink_Entry.Create(LineNumber,Offset));
|
LineNumberList.Add(TOmfSubRecord_LINNUM_MsLink_Entry.Create(LineNumber,Offset));
|
||||||
Inc(NextOfs,RecordSize);
|
Inc(NextOfs,RecordSize);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -2097,8 +2127,8 @@ implementation
|
|||||||
var
|
var
|
||||||
I: Integer;
|
I: Integer;
|
||||||
begin
|
begin
|
||||||
for I:=0 to Count-1 do
|
for I:=0 to LineNumberList.Count-1 do
|
||||||
with Items[I] do
|
with LineNumberList.Items[I] do
|
||||||
begin
|
begin
|
||||||
RawRecord.RawData[NextOfs]:=byte(LineNumber);
|
RawRecord.RawData[NextOfs]:=byte(LineNumber);
|
||||||
RawRecord.RawData[NextOfs+1]:=byte(LineNumber shr 8);
|
RawRecord.RawData[NextOfs+1]:=byte(LineNumber shr 8);
|
||||||
@ -2122,24 +2152,6 @@ implementation
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TOmfRecord_LINNUM_MsLink.Create;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
FLineNumbers:=TFPObjectList.Create(true);
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TOmfRecord_LINNUM_MsLink.Destroy;
|
|
||||||
begin
|
|
||||||
FLineNumbers.Free;
|
|
||||||
inherited Destroy;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TOmfRecord_LINNUM_MsLink.Add(
|
|
||||||
AObject: TOmfSubRecord_LINNUM_MsLink_Entry): Integer;
|
|
||||||
begin
|
|
||||||
Result:=FLineNumbers.Add(AObject);
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TOmfSubRecord_FIXUP }
|
{ TOmfSubRecord_FIXUP }
|
||||||
|
|
||||||
function TOmfSubRecord_FIXUP.GetDataRecordOffset: Integer;
|
function TOmfSubRecord_FIXUP.GetDataRecordOffset: Integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user