Generate correct debugger symbol tables for nested struct types.

Previously, when a struct type first appeared in a symbol table nested within another struct type, subsequent references to that type would use the wrong offset and be corrupted. This occurred because the symbol table length had not yet been updated to reflect the size of the entry for the outer structure at the time the inner one was processed.

Fixes #54.
This commit is contained in:
Stephen Heumann 2018-02-28 23:31:10 -06:00
parent 83df2fd9e1
commit 0884c019d2

View File

@ -849,6 +849,8 @@ var
{ ip - identifier to generate }
{ storage - storage type; none for struct/union fields }
label 1;
var
disp: integer; {disp to symbol of same type}
@ -1108,7 +1110,11 @@ var
if disp = noDisp then begin
CnOut(12);
CnOut2(0);
{update length of symbol table before }
{handling any nested struct definitions}
symLength := symLength+12;
ExpandStructType(ip^.itype);
goto 1;
end {if}
else begin
CnOut(13);
@ -1117,7 +1123,7 @@ var
end;
end; {case}
symLength := symLength+12; {update length of symbol table}
end; {if}
1: end; {if}
end; {GenSymbol}