[Lazarus] Another IDE interface question

Darius Blaszyk dhkblaszyk at zeelandnet.nl
Thu Feb 3 19:52:46 CET 2011


On Feb 3, 2011, at 7:43 PM, Mattias Gaertner wrote:

> On Thu, 3 Feb 2011 18:49:56 +0100
> Darius Blaszyk <dhkblaszyk at zeelandnet.nl> wrote:
> 
>> 
>> On Feb 3, 2011, at 6:45 PM, Darius Blaszyk wrote:
>> 
>>> For the fpprofiler package I would like to know/do the following;
>>> 
>>> 1. get all the -Fu and -Fi folders so the package can search them and allow the user to include/exclude them from profiling, which method to use in LazIDEIntf?
> 
> I added some info:
> 
> http://wiki.lazarus.freepascal.org/Extending_the_IDE#Getting_the_search_paths_for_units_and_include_filesuses
> CodeToolManager;
Thank you for that.

> 
> 
>>> 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

Regards, Darius



More information about the Lazarus mailing list