Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2010-07

RTTI question

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Sergei Gorelkin

Hello,

I have discovered that the pointer returned by typeinfo() builtin in FPC is very different from one returned in Delphi. What Delphi returns points to rough equivalent of FPC's INIT$_<typename> structure, so one may examine the structure to figure out the 'managed' fields. FPC, however, returns pointer to RTTI$_<typename> structure, which - for records and objects - doesn't seem to contain anything useful except the type name. At the same time there seems to be no way to access INIT$_<typename> information from code.
Is this a subject for bugreport?

Regards,
Sergei

Reply by email

Florian Klämpfl
to Sergei Gorelkin
Sergei Gorelkin wrote 11 lines
Hello, I have discovered that the pointer returned by typeinfo() builtin in FPC is very different from one returned in Delphi. What Delphi returns points to rough equivalent of FPC's INIT$_<typename> structure, so one may examine the structure to figure out the 'managed' fields. FPC, however, returns pointer to RTTI$_<typename> structure, which - for records and objects - doesn't seem to contain anything useful except the type name. At the same time there seems to be no way to access INIT$_<typename> information from code. Is this a subject for bugreport?

If you've a proposal how to solve this keeping backward and delphi compatibility :)

Reply by email