mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 07:09:29 +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}
|
||||
cclasses,
|
||||
{$endif memdebug}
|
||||
{$ifdef OMFOBJSUPPORT}
|
||||
omfbase,
|
||||
ogomf,
|
||||
{$endif OMFOBJSUPPORT}
|
||||
{$if defined(cpuextended) and defined(FPC_HAS_TYPE_EXTENDED)}
|
||||
{$else}
|
||||
{$ifdef FPC_SOFT_FPUX80}
|
||||
@ -2063,6 +2067,16 @@ Implementation
|
||||
break;
|
||||
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;
|
||||
ait_symbolpair:
|
||||
|
@ -78,9 +78,11 @@ interface
|
||||
FPrimaryGroup: string;
|
||||
FSortOrder: Integer;
|
||||
FMZExeUnifiedLogicalSegment: TMZExeUnifiedLogicalSegment;
|
||||
FLinNumEntries: TOmfSubRecord_LINNUM_MsLink_LineNumberList;
|
||||
function GetOmfAlignment: TOmfSegmentAlignment;
|
||||
public
|
||||
constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:longint;Aoptions:TObjSectionOptions);override;
|
||||
destructor destroy;override;
|
||||
function MemPosStr(AImageBase: qword): string;override;
|
||||
property ClassName: string read FClassName;
|
||||
property OverlayName: string read FOverlayName;
|
||||
@ -90,6 +92,7 @@ interface
|
||||
property PrimaryGroup: string read FPrimaryGroup;
|
||||
property SortOrder: Integer read FSortOrder write FSortOrder;
|
||||
property MZExeUnifiedLogicalSegment: TMZExeUnifiedLogicalSegment read FMZExeUnifiedLogicalSegment write FMZExeUnifiedLogicalSegment;
|
||||
property LinNumEntries: TOmfSubRecord_LINNUM_MsLink_LineNumberList read FLinNumEntries;
|
||||
end;
|
||||
|
||||
{ TOmfObjData }
|
||||
@ -124,6 +127,7 @@ interface
|
||||
procedure AddGroup(const groupname: string; seglist: TSegmentList);
|
||||
procedure WriteSections(Data:TObjData);
|
||||
procedure WriteSectionContentAndFixups(sec: TObjSection);
|
||||
procedure WriteLinNumRecords(sec: TOmfObjSection);
|
||||
|
||||
procedure section_count_sections(p:TObject;arg:pointer);
|
||||
procedure WritePUBDEFs(Data: TObjData);
|
||||
@ -501,6 +505,13 @@ implementation
|
||||
inherited create(AList, Aname, Aalign, Aoptions);
|
||||
FCombination:=scPublic;
|
||||
FUse:=suUse16;
|
||||
FLinNumEntries:=TOmfSubRecord_LINNUM_MsLink_LineNumberList.Create;
|
||||
end;
|
||||
|
||||
destructor TOmfObjSection.destroy;
|
||||
begin
|
||||
FLinNumEntries.Free;
|
||||
inherited destroy;
|
||||
end;
|
||||
|
||||
function TOmfObjSection.MemPosStr(AImageBase: qword): string;
|
||||
@ -735,6 +746,7 @@ implementation
|
||||
begin
|
||||
sec:=TObjSection(Data.ObjSectionList[i]);
|
||||
WriteSectionContentAndFixups(sec);
|
||||
WriteLinNumRecords(TOmfObjSection(sec));
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -810,6 +822,36 @@ implementation
|
||||
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);
|
||||
begin
|
||||
TOmfObjSection(p).index:=pinteger(arg)^;
|
||||
|
@ -546,7 +546,7 @@ interface
|
||||
protected
|
||||
procedure DebugFormatSpecific_DecodeFrom(RawRecord:TOmfRawRecord;NextOfs:Integer);override;
|
||||
procedure DebugFormatSpecific_EncodeTo(RawRecord:TOmfRawRecord;var NextOfs:Integer);override;
|
||||
|
||||
public
|
||||
property LineNumberList: TOmfSubRecord_LINNUM_MsLink_LineNumberList read FLineNumberList write FLineNumberList;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user