Where can I find detailed info about ppu and obj formats,
There is no documentation for
ppu files. You'll need to look at the source to understand them.
The object files that are generated have the same format as normal object files for the platform. These are among others
COFF on Windows and
ELF on Linux.
are tools for dump/disassembling it?
To dump
ppu files you can use the
ppudump utility that is provided with each FPC distribution. Please note that the used version must match the version of the
ppu (meaning that you can't use a FPC 2.6.4
ppudump for a 3.3.1
ppu).
For the object files you can use the GNU utility
objdump which allows you to display various information about the object file and also to disassemble them.
FPC compiler can generate assembler sources?
You can see the assembler sources if you pass
-al when compiling. If you want to stop FPC from assembling and linking its files then you can use
-sh which will keep the assembly files around and also generate a
ppas.sh/
ppas.bat which allows you to manually assemble/link the files.
can optimize methods to inline?
Yes, FPC can inline routine. Either you can manually declare a method as
inline or enable auto inlining using
-Ooautoinline. In both cases the method body needs to have been parsed before it is called otherwise the routine won't be inlined.
For example:
unit foo;
interface
procedure Test; inline;
procedure TestA;
procedure TestB;
implementation
procedure TestA;
begin
Test; // this will not be inlined
end;
procedure Test;
begin
end;
procedure TestB;
begin
Test; // this will be inlined
end;