On Thu, 3 Feb 2011 19:52:46 +0100
Darius Blaszyk <[email protected]> wrote:

> [...]
> >>> 2. replace the FPC executable with the profiling frontend executable. 
> >>> currently I do:
> >>> 
> >>> //insert profiling code using TProcess
> >>> //build project using : LazarusIDE.DoBuildProject(crCompile, []);    
> >>> //remove profiling code using TProcess
> >>> //execute project if LazarusIDE.ActiveProject.ExecutableType = petProgram
> >>> 
> >>> however, I'm not sure if it could be done better
> >> 
> >> Ideally I would replace the FPC executable by FPP and then execute 
> >> LazarusIDE.DoRunProject (??)  . This way I would not have to play with 
> >> TProcess to insert and remove profiling code and execute the application.
> > 
> > Can you explain this inserting/removing of profiling code?
> Sure. In short:
> 
> I have written a simple front end for FPC called FPP. What it does is it 
> searches all -Fu paths and inserts profiling code on each method it finds 
> (using a modified version of fcl-passrc). Then it strips any FPP command line 
> switches and passes the remaining switches directly to FPC. After compilation 
> it strips the profiling code by restoring the backed up files.
> 
> see also: http://wiki.lazarus.freepascal.org/fpprofiler

Ideally the procedure modifications can be done by FPC via a compiler
switch, similar to the -pg switch.


Mattias

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to