mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 18:49:16 +02:00
+ implemented the actual writing of LINNUM OMF records
git-svn-id: trunk@39008 -
This commit is contained in:
parent
61e6d2afec
commit
3d6d020fca
@ -250,6 +250,10 @@ Implementation
|
|||||||
{$ifdef memdebug}
|
{$ifdef memdebug}
|
||||||
cclasses,
|
cclasses,
|
||||||
{$endif memdebug}
|
{$endif memdebug}
|
||||||
|
{$ifdef OMFOBJSUPPORT}
|
||||||
|
omfbase,
|
||||||
|
ogomf,
|
||||||
|
{$endif OMFOBJSUPPORT}
|
||||||
{$if defined(cpuextended) and defined(FPC_HAS_TYPE_EXTENDED)}
|
{$if defined(cpuextended) and defined(FPC_HAS_TYPE_EXTENDED)}
|
||||||
{$else}
|
{$else}
|
||||||
{$ifdef FPC_SOFT_FPUX80}
|
{$ifdef FPC_SOFT_FPUX80}
|
||||||
@ -2063,6 +2067,16 @@ Implementation
|
|||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{$ifdef OMFOBJSUPPORT}
|
||||||
|
asd_omf_linnum_line:
|
||||||
|
begin
|
||||||
|
TOmfObjSection(ObjData.CurrObjSec).LinNumEntries.Add(
|
||||||
|
TOmfSubRecord_LINNUM_MsLink_Entry.Create(
|
||||||
|
strtoint(tai_directive(hp).name),
|
||||||
|
ObjData.CurrObjSec.Size
|
||||||
|
));
|
||||||
|
end;
|
||||||
|
{$endif OMFOBJSUPPORT}
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
ait_symbolpair:
|
ait_symbolpair:
|
||||||
|
@ -78,9 +78,11 @@ interface
|
|||||||
FPrimaryGroup: string;
|
FPrimaryGroup: string;
|
||||||
FSortOrder: Integer;
|
FSortOrder: Integer;
|
||||||
FMZExeUnifiedLogicalSegment: TMZExeUnifiedLogicalSegment;
|
FMZExeUnifiedLogicalSegment: TMZExeUnifiedLogicalSegment;
|
||||||
|
FLinNumEntries: TOmfSubRecord_LINNUM_MsLink_LineNumberList;
|
||||||
function GetOmfAlignment: TOmfSegmentAlignment;
|
function GetOmfAlignment: TOmfSegmentAlignment;
|
||||||
public
|
public
|
||||||
constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:longint;Aoptions:TObjSectionOptions);override;
|
constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:longint;Aoptions:TObjSectionOptions);override;
|
||||||
|
destructor destroy;override;
|
||||||
function MemPosStr(AImageBase: qword): string;override;
|
function MemPosStr(AImageBase: qword): string;override;
|
||||||
property ClassName: string read FClassName;
|
property ClassName: string read FClassName;
|
||||||
property OverlayName: string read FOverlayName;
|
property OverlayName: string read FOverlayName;
|
||||||
@ -90,6 +92,7 @@ interface
|
|||||||
property PrimaryGroup: string read FPrimaryGroup;
|
property PrimaryGroup: string read FPrimaryGroup;
|
||||||
property SortOrder: Integer read FSortOrder write FSortOrder;
|
property SortOrder: Integer read FSortOrder write FSortOrder;
|
||||||
property MZExeUnifiedLogicalSegment: TMZExeUnifiedLogicalSegment read FMZExeUnifiedLogicalSegment write FMZExeUnifiedLogicalSegment;
|
property MZExeUnifiedLogicalSegment: TMZExeUnifiedLogicalSegment read FMZExeUnifiedLogicalSegment write FMZExeUnifiedLogicalSegment;
|
||||||
|
property LinNumEntries: TOmfSubRecord_LINNUM_MsLink_LineNumberList read FLinNumEntries;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TOmfObjData }
|
{ TOmfObjData }
|
||||||
@ -124,6 +127,7 @@ interface
|
|||||||
procedure AddGroup(const groupname: string; seglist: TSegmentList);
|
procedure AddGroup(const groupname: string; seglist: TSegmentList);
|
||||||
procedure WriteSections(Data:TObjData);
|
procedure WriteSections(Data:TObjData);
|
||||||
procedure WriteSectionContentAndFixups(sec: TObjSection);
|
procedure WriteSectionContentAndFixups(sec: TObjSection);
|
||||||
|
procedure WriteLinNumRecords(sec: TOmfObjSection);
|
||||||
|
|
||||||
procedure section_count_sections(p:TObject;arg:pointer);
|
procedure section_count_sections(p:TObject;arg:pointer);
|
||||||
procedure WritePUBDEFs(Data: TObjData);
|
procedure WritePUBDEFs(Data: TObjData);
|
||||||
@ -501,6 +505,13 @@ implementation
|
|||||||
inherited create(AList, Aname, Aalign, Aoptions);
|
inherited create(AList, Aname, Aalign, Aoptions);
|
||||||
FCombination:=scPublic;
|
FCombination:=scPublic;
|
||||||
FUse:=suUse16;
|
FUse:=suUse16;
|
||||||
|
FLinNumEntries:=TOmfSubRecord_LINNUM_MsLink_LineNumberList.Create;
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TOmfObjSection.destroy;
|
||||||
|
begin
|
||||||
|
FLinNumEntries.Free;
|
||||||
|
inherited destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TOmfObjSection.MemPosStr(AImageBase: qword): string;
|
function TOmfObjSection.MemPosStr(AImageBase: qword): string;
|
||||||
@ -735,6 +746,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
sec:=TObjSection(Data.ObjSectionList[i]);
|
sec:=TObjSection(Data.ObjSectionList[i]);
|
||||||
WriteSectionContentAndFixups(sec);
|
WriteSectionContentAndFixups(sec);
|
||||||
|
WriteLinNumRecords(TOmfObjSection(sec));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -810,6 +822,36 @@ implementation
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TOmfObjOutput.WriteLinNumRecords(sec: TOmfObjSection);
|
||||||
|
var
|
||||||
|
SegIndex: Integer;
|
||||||
|
RawRecord: TOmfRawRecord;
|
||||||
|
LinNumRec: TOmfRecord_LINNUM_MsLink;
|
||||||
|
begin
|
||||||
|
if (oso_data in sec.SecOptions) then
|
||||||
|
begin
|
||||||
|
if sec.Data=nil then
|
||||||
|
internalerror(200403073);
|
||||||
|
if sec.LinNumEntries.Count=0 then
|
||||||
|
exit;
|
||||||
|
SegIndex:=Segments.FindIndexOf(sec.Name);
|
||||||
|
RawRecord:=TOmfRawRecord.Create;
|
||||||
|
LinNumRec:=TOmfRecord_LINNUM_MsLink.Create;
|
||||||
|
LinNumRec.BaseGroup:=0;
|
||||||
|
LinNumRec.BaseSegment:=SegIndex;
|
||||||
|
LinNumRec.LineNumberList:=sec.LinNumEntries;
|
||||||
|
|
||||||
|
while LinNumRec.NextIndex<sec.LinNumEntries.Count do
|
||||||
|
begin
|
||||||
|
LinNumRec.EncodeTo(RawRecord);
|
||||||
|
RawRecord.WriteTo(FWriter);
|
||||||
|
end;
|
||||||
|
|
||||||
|
LinNumRec.Free;
|
||||||
|
RawRecord.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TOmfObjOutput.section_count_sections(p: TObject; arg: pointer);
|
procedure TOmfObjOutput.section_count_sections(p: TObject; arg: pointer);
|
||||||
begin
|
begin
|
||||||
TOmfObjSection(p).index:=pinteger(arg)^;
|
TOmfObjSection(p).index:=pinteger(arg)^;
|
||||||
|
@ -546,7 +546,7 @@ interface
|
|||||||
protected
|
protected
|
||||||
procedure DebugFormatSpecific_DecodeFrom(RawRecord:TOmfRawRecord;NextOfs:Integer);override;
|
procedure DebugFormatSpecific_DecodeFrom(RawRecord:TOmfRawRecord;NextOfs:Integer);override;
|
||||||
procedure DebugFormatSpecific_EncodeTo(RawRecord:TOmfRawRecord;var NextOfs:Integer);override;
|
procedure DebugFormatSpecific_EncodeTo(RawRecord:TOmfRawRecord;var NextOfs:Integer);override;
|
||||||
|
public
|
||||||
property LineNumberList: TOmfSubRecord_LINNUM_MsLink_LineNumberList read FLineNumberList write FLineNumberList;
|
property LineNumberList: TOmfSubRecord_LINNUM_MsLink_LineNumberList read FLineNumberList write FLineNumberList;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user