mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 04:29:20 +02:00
+ implemented parsing of omf group definitions as well
git-svn-id: trunk@30970 -
This commit is contained in:
parent
5539d6366f
commit
1cae939615
@ -126,6 +126,7 @@ interface
|
|||||||
|
|
||||||
function ReadLNames(RawRec: TOmfRawRecord): Boolean;
|
function ReadLNames(RawRec: TOmfRawRecord): Boolean;
|
||||||
function ReadSegDef(RawRec: TOmfRawRecord; objdata:TObjData): Boolean;
|
function ReadSegDef(RawRec: TOmfRawRecord; objdata:TObjData): Boolean;
|
||||||
|
function ReadGrpDef(RawRec: TOmfRawRecord; objdata:TObjData): Boolean;
|
||||||
|
|
||||||
property LNames: TOmfOrderedNameCollection read FLNames;
|
property LNames: TOmfOrderedNameCollection read FLNames;
|
||||||
public
|
public
|
||||||
@ -979,6 +980,40 @@ implementation
|
|||||||
Result:=True;
|
Result:=True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TOmfObjInput.ReadGrpDef(RawRec: TOmfRawRecord; objdata: TObjData): Boolean;
|
||||||
|
var
|
||||||
|
GrpDefRec: TOmfRecord_GRPDEF;
|
||||||
|
GroupName: string;
|
||||||
|
SecGroup: TObjSectionGroup;
|
||||||
|
i,SegIndex: Integer;
|
||||||
|
begin
|
||||||
|
Result:=False;
|
||||||
|
GrpDefRec:=TOmfRecord_GRPDEF.Create;
|
||||||
|
GrpDefRec.DecodeFrom(RawRec);
|
||||||
|
if (GrpDefRec.GroupNameIndex<1) or (GrpDefRec.GroupNameIndex>LNames.Count) then
|
||||||
|
begin
|
||||||
|
InputError('Group name index out of range');
|
||||||
|
GrpDefRec.Free;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
GroupName:=LNames[GrpDefRec.GroupNameIndex];
|
||||||
|
SecGroup:=objdata.createsectiongroup(GroupName);
|
||||||
|
SetLength(SecGroup.members,Length(GrpDefRec.SegmentList));
|
||||||
|
for i:=0 to Length(GrpDefRec.SegmentList)-1 do
|
||||||
|
begin
|
||||||
|
SegIndex:=GrpDefRec.SegmentList[i];
|
||||||
|
if (SegIndex<1) or (SegIndex>objdata.ObjSectionList.Count) then
|
||||||
|
begin
|
||||||
|
InputError('Segment name index out of range in group definition');
|
||||||
|
GrpDefRec.Free;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
SecGroup.members[i]:=TOmfObjSection(objdata.ObjSectionList[SegIndex-1]);
|
||||||
|
end;
|
||||||
|
GrpDefRec.Free;
|
||||||
|
Result:=True;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TOmfObjInput.create;
|
constructor TOmfObjInput.create;
|
||||||
begin
|
begin
|
||||||
inherited create;
|
inherited create;
|
||||||
@ -1041,9 +1076,8 @@ implementation
|
|||||||
if not ReadSegDef(FRawRecord,objdata) then
|
if not ReadSegDef(FRawRecord,objdata) then
|
||||||
exit;
|
exit;
|
||||||
RT_GRPDEF:
|
RT_GRPDEF:
|
||||||
begin
|
if not ReadGrpDef(FRawRecord,objdata) then
|
||||||
{todo}
|
exit;
|
||||||
end;
|
|
||||||
RT_COMENT:
|
RT_COMENT:
|
||||||
begin
|
begin
|
||||||
{todo}
|
{todo}
|
||||||
|
Loading…
Reference in New Issue
Block a user