From 6f88fe5cee6438f1c41da78ccaff3f284e5ead54 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 16 Mar 2018 21:04:26 -0400 Subject: [PATCH] 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. --- symbols.pas | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/symbols.pas b/symbols.pas index 48c56da..f9fcb91 100644 --- a/symbols.pas +++ b/symbols.pas @@ -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}