Re: variable types unravel / RTTI



["Followup-To:" header set to comp.lang.pascal.delphi.misc.]
On 2005-05-25, michalp <michalp@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> there is the declaration (suppose in unit that we havn't access to):
>
> type
> t1 = integer;
> t2 = record
> a: t1;
> b: array[1..2] of integer;
> end;
> var
> x: t2;
>
> Suppose that we know that x exist and we don't know what type x is.

> Is there any possibility to ask Delphi compiler to tell us someting more
> about x (what type x is, no matter run-time/compilation-time) ?

No. Except that you can get the size. Note also that the compiler doesn't
have an interactive mode where you can ask him questions during compiletime.

> So, is there any chance to get all this informations step by step,
> precisely, each level?

No.

> Bonus question: if there isn't possibility to do this, maybe there is
> any tool to show all types and variables (and functions etc) from
> DCU/TPU/LIB and other binary files?

Can it be done in theory?

DCU: yes if the type is exported
TPU: yes if the type is exported
PPU: yes if the type is exported

Others: are probably prelinked and don't contain this info anymore.

Is there a tool:

DCU: is version dependant, stuff that can read it exists.
TPU: is version dependant, stuff that can read it exists.
PPU: is version dependant, however each version comes with a unit (ppu)
and program (ppudump) that can dump the contents.


.



Relevant Pages

  • Re: variable types unravel / RTTI
    ... TPU: is version dependant, stuff that can read it exists. ... PPU: is version dependant, however each version comes with a unit and program (ppudump) that can dump the contents. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Using Makefile rather than GreenHills (GHS) Multi .GPJ files
    ... Spontaneously changing link order is an immediate disaster in that situation. ... are passed to the linker, ... Getting your global objects initialised correctly is not hard, but it is easily forgotten - resulting in a program whose correctness is dependant on the link order. ... If you need to specify different compiler flags for some of the files, for example, the makefile is probably the best place to put this information. ...
    (comp.arch.embedded)
  • Re: allocating space for local variables
    ... int arr2; ... true or the space is allocated when the function "func" is called. ... The answer would be compiler dependant, compiler flags dependant, and ...
    (comp.lang.c)
  • Re: allocating space for local variables
    ... int arr2; ... true or the space is allocated when the function "func" is called. ... The answer would be compiler dependant, compiler flags dependant, and ...
    (comp.lang.c)
  • Re: allocating space for local variables
    ... int arr2; ... true or the space is allocated when the function "func" is called. ... The answer would be compiler dependant, compiler flags dependant, and ...
    (comp.lang.c)