[Solved] ARM - Registers lazarus / 62-General ---------------------------------------------------------------------- darupe · 2015-04-07 01:00 Can anyone tell me which registers are being used for method parameters on 32 bit ARM platforms? I am currently developing an RTTI library which is basically a clone of the one from Delphi (http://docwiki.embarcadero.com/Libraries/XE7/en/System.Rtti). I already got most of the features working, including dynamic method invocation on x86/x64 platforms. However, I really want to support the ARM architecture as well. Just to be clear, the library is currently based on FPC 2.6.x which means RTTI support is not as advanced as the Delphi implementation. The classes, however, are identical to the ones from Delphi (except for a few additions) and will simply exclude a particular feature if the FPC version does not support it. An example of this is the CodePage property in TRttiAnsiStringType which is only supported by the development version of FPC. On a side note, does anyone know if work is being done on extended RTTI support such as information about regular published methods? ---------------------------------------------------------------------- DonAlfredo · 2015-04-07 05:36 Your work would be very welcome !!! But please sync (and discuss) your efforts with the work already done ! http://lists.freepascal.org/pipermail/fpc- devel/2015-February/035311.html http://lists.freepascal.org/pipermail/fpc-devel/2015-March/035452.html http://lists.freepascal.org/pipermail/fpc-devel/2015-April/035476.html ---------------------------------------------------------------------- DonAlfredo · 2015-04-07 05:51 Included the diff against current FPC trunk of (part of) the RTTI work by Steve (from the mailing list). ---------------------------------------------------------------------- darupe · 2015-04-07 06:06 Great! It seems that a lot of the missing features are starting to become available. Until now, I could only extract method names and addresses from the virtual method table. Now it seems that I can also determine the calling convention and parameters, just as with published events. I will join the discussion shortly. At least no one seems to have begun working on the Delphi compatible RTTI classes so my work has not been a waste of time. ---------------------------------------------------------------------- avra · 2015-04-07 07:29 RTTI: http://mantis.freepascal.org/view.php?id=26774 ---------------------------------------------------------------------- darupe · 2015-04-07 07:52 Quote from: avra on April 07, 2015, 09:29:06 amRTTI: http://mantis.freepascal.org/view.php?id=26774 Already saw it in one of the links posted by DonAlfredo. The part I'm working on is the TRtti<...> classes which is based on the functions provided by the TypInfo unit. So far I've only been able to dynamically invoke methods which have been published as properties (events) but with the latest changes, I will be able to invoke regular methods. Sure I can do that already with my implementation of Invoke() by providing the method address but I won't be able to automatically publish such methods for things like web services. That's what the latest changes will enable me to do. ---------------------------------------------------------------------- darupe · 2015-04-07 08:10 Back to my main question: Does anyone know which registers are used for parameters on ARM and if some types should just be placed on the stack by default like I'm doing with Int64, Double, ... on x86? Also, are registers matched to parameter indexes as on x64 like if a type doesn't fit, throw it on the stack and increment the register index (basically skipping the use of that register)? ---------------------------------------------------------------------- Laksen · 2015-04-07 09:32 The compiler should respect APCS or EABI depending on what's selected during build. You can see how it's actually implemented in compiler/arm/cpupara.pas ---------------------------------------------------------------------- darupe · 2015-04-07 10:50 Quote from: Laksen on April 07, 2015, 11:32:11 amThe compiler should respect APCS or EABI depending on what's selected during build. You can see how it's actually implemented in compiler/arm/cpupara.pas Just what I needed. Thanks ---------------------------------------------------------------------- nasa · 2015-10-29 13:43 Hi all. I´m working on a solution for raspberry PI2 (ARM) but it´s intended to run on windows and linux PC too. And i need to invoke methods with parameters using RTTI. I have seen some examples on how to invoke via rtti using new TProcedureSignature type but i could not figure out how to pass the parameters. So @Darupe your solution is working? how can i get the source code, i´m using FPC version 3.1.1 revision 49.965. Some usage examples will be welcome. Thanks.