records or objects without fields (including forward declared objects) generate bad debugger symbol tables since there is no terminating field.

This generates a fake FIELD field to compensate.
This commit is contained in:
Kelvin Sherlock 2018-03-16 21:04:26 -04:00
parent cf72a073f8
commit 6f88fe5cee

View File

@ -47,6 +47,7 @@ var
fwptr: ctp; {head of chain for forw decl type ids}
inptr,outptr,erroroutputptr: ctp; {standard I/O}
dummyString: stp; {index entry for string constants}
dummyField: ctp;
{---------------------------------------------------------------}
@ -744,6 +745,21 @@ with dummyString^ do begin
min := 1;
max := 2;
end; {with}
dummyField := pointer(Malloc(sizeof(identifier)));
with dummyField^ do begin
name := @'FIELD';
idtype := intptr;
next := nil;
fldaddr := 0;
klass := field;
hasIFile := false;
llink := nil;
rlink := nil;
fldaddr := 0;
end; {with}
end; {EnterUndecl}
@ -951,6 +967,7 @@ var
ip := tp^.fstfld
else
ip := tp^.objfld;
if ip = nil then ip := dummyField;
GenSymbol(ip, true);
end; {ExpandRecordType}