From 4722e95a3f5b0efdd4889c6eae88a0306e1f7fc3 Mon Sep 17 00:00:00 2001 From: Ryan Joseph Date: Tue, 30 May 2023 15:52:06 +0200 Subject: [PATCH] * Allow to read extended RTTI info --- compiler/utils/ppuutils/ppudump.pp | 65 ++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/compiler/utils/ppuutils/ppudump.pp b/compiler/utils/ppuutils/ppudump.pp index 4ffe02a23a..e73d45d779 100644 --- a/compiler/utils/ppuutils/ppudump.pp +++ b/compiler/utils/ppuutils/ppudump.pp @@ -3281,6 +3281,67 @@ begin end; +procedure readextendedrtti; +type + tvisopt=record + mask : trtti_visibility; + str : string[10]; + end; +const + visopt : array[0..ord(high(trtti_visibility))] of tvisopt=( + (mask:rv_private; str:'Private'), + (mask:rv_protected; str:'Protected'), + (mask:rv_public; str:'Public'), + (mask:rv_published; str:'Published') + ); +type + toptionopt=record + mask : trtti_option; + str : string[10]; + end; +const + voptionopt : array[0..ord(high(trtti_option))] of toptionopt=( + (mask:ro_methods; str:'Methods'), + (mask:ro_fields; str:'Fields'), + (mask:ro_properties; str:'Properties') + ); +var + clause: string; + visibilities: trtti_visibilities; + first: boolean; + i, ro: integer; +begin + clause:=''; + case trtti_clause(ppufile.getbyte) of + rtc_none: clause:='None'; + rtc_inherit: clause:='Inherit'; + rtc_explicit: clause:='Explicit'; + end; + writeln([space,' Clause : ',clause]); + + for ro:=0 to high(voptionopt) do + begin + ppufile.getset(tppuset1(visibilities)); + if visibilities<>[] then + begin + write([space,' ',voptionopt[ro].str,' : ']); + first:=true; + for i:=0 to high(visopt) do + if visopt[i].mask in visibilities then + begin + if first then + first:=false + else + write(', '); + write(visopt[i].str); + end; + if not first then + writeln; + end; + end; +end; + + procedure readprocimploptions(const space: string; out implprocoptions: timplprocoptions); type tpiopt=record @@ -4456,6 +4517,8 @@ begin writeln([space,' Import lib/pkg : ',getstring]); write ([space,' Options : ']); readobjectdefoptions(objdef); + writeln([space,' Extended RTTI : ']); + readextendedrtti; if (df_copied_def in defoptions) then begin Include(TPpuRecordDef(def).Options, ooCopied); @@ -4494,6 +4557,8 @@ begin writeln([space,' Import lib/pkg : ',getstring]); write ([space,' Options : ']); readobjectdefoptions(objdef); + writeln([space,' Extended RTTI : ']); + readextendedrtti; otb:=getbyte; write ([space,' Type : ']); case tobjecttyp(otb) of