Previous embedded struct debugger fix didn't account for pointers to structs (ExpandPointerType).

This always pre-increments symLength then compensate by subtracting 12 in GetTypeDisp.
This commit is contained in:
Kelvin Sherlock 2018-03-05 23:15:14 -05:00
parent 28fa8b1853
commit ae55b80f2f

View File

@ -836,7 +836,7 @@ var
tp1^.next := tpList; tp1^.next := tpList;
tpList := tp1; tpList := tp1;
tp1^.tp := tp; tp1^.tp := tp;
tp1^.disp := symLength; tp1^.disp := symLength-12;
end; {else} end; {else}
end; {GetTypeDisp} end; {GetTypeDisp}
@ -849,8 +849,6 @@ var
{ ip - identifier to generate } { ip - identifier to generate }
{ storage - storage type; none for struct/union fields } { storage - storage type; none for struct/union fields }
label 1;
var var
disp: integer; {disp to symbol of same type} disp: integer; {disp to symbol of same type}
@ -1094,6 +1092,7 @@ var
if ip^.itype^.kind in if ip^.itype^.kind in
[scalarType,arrayType,pointerType,enumType,structType,unionType] [scalarType,arrayType,pointerType,enumType,structType,unionType]
then begin then begin
symLength := symLength+12; {update length of symbol table}
WriteName(ip); {write the name field} WriteName(ip); {write the name field}
WriteAddress(ip); {write the address field} WriteAddress(ip); {write the address field}
case ip^.itype^.kind of case ip^.itype^.kind of
@ -1110,11 +1109,7 @@ var
if disp = noDisp then begin if disp = noDisp then begin
CnOut(12); CnOut(12);
CnOut2(0); CnOut2(0);
{update length of symbol table before }
{handling any nested struct definitions}
symLength := symLength+12;
ExpandStructType(ip^.itype); ExpandStructType(ip^.itype);
goto 1;
end {if} end {if}
else begin else begin
CnOut(13); CnOut(13);
@ -1122,8 +1117,7 @@ var
end; {else} end; {else}
end; end;
end; {case} end; {case}
symLength := symLength+12; {update length of symbol table} end; {if}
1: end; {if}
end; {GenSymbol} end; {GenSymbol}