From 0884c019d2a00690c667b78c18bd9e2a733ad727 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Wed, 28 Feb 2018 23:31:10 -0600 Subject: [PATCH] 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. --- Symbol.pas | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Symbol.pas b/Symbol.pas index 69bc0b3..517837c 100644 --- a/Symbol.pas +++ b/Symbol.pas @@ -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}