How to modify and debug the IDE? lazarus / 13-General ---------------------------------------------------------------------- markus_ja · 2016-06-27 06:54 Hello, I am new to Lazarus and I would like to make same changes in the IDE (e.g. in the procedurelist.pas). I also want to debug it. Where should I start and how do to it? ---------------------------------------------------------------------- JuhaManninen · 2016-06-27 07:59 http://wiki.freepascal.org/Extending_the_IDE#Debugging_the_IDE Please also list the changes you plan for ProcedureList. I changed it once but apparently did not understand how it works and I had to revert my changes. The code is from Graeme, he may also review your changes. ---------------------------------------------------------------------- markus_ja · 2016-06-27 08:26 I want to add, that the search word does also filter by the class name, like in CnPack for Delphi. I tried the steps in the wiki page, but with no luck 1) I recompiled the IDE in debug mode (Tools/Build Lazarus) 2) Opend the ide\lazbuild.lpi file 3) Pressed the run button: DOS windows appeard and disappeared, and the run was finished. I also tried to open the procedurelist.pas file, to set a breakpoint, but it doesn't work. What steps did I miss? ---------------------------------------------------------------------- JuhaManninen · 2016-06-27 08:46 Quote from: markus_ja on June 27, 2016, 10:26:32 am2) Opend the ide\lazbuild.lpi file Please read the instructions again. ---------------------------------------------------------------------- markus_ja · 2016-06-27 09:54 I didn't get you? It is stated you cannot directly compile that project, and then it is stated: set breakpoints and run the project. What is the difference between compile and run the project? I just pressed the Start button (green arrow). I have the german version. How to set a breakpoint, when the file doesn't belong to the project? ---------------------------------------------------------------------- Thaddy · 2016-06-27 10:12 Quote from: markus_ja on June 27, 2016, 11:54:27 amI didn't get you? It is stated you cannot directly compile that project, and then it is stated: set breakpoints and run the project. What is the difference between compile and run the project? I just pressed the Start button (green arrow). I have the german version. How to set a breakpoint, when the file doesn't belong to the project? If you run a standard fpcup for Lazarus and FPC, the code is debuggable. Mind you: that is NOT the code your default IDE is running under, although sometimes you get some info. You have to compile Lazarus with Lazarus (or FPC only) to debug properly. i.e.: let fpcup do its job. Then run lazarus and open the Lazarus project file and compile... I'd recommend changing some paths to not run into trouble, but it is quite doable. Also: a default fpcup compiled Lazarus should run under GDB just fine. ---------------------------------------------------------------------- JuhaManninen · 2016-06-27 10:27 Quote from: markus_ja on June 27, 2016, 10:26:32 am2) Opend the ide\lazbuild.lpi file Apparently you didn't read the instructions again. It does not say lazbuild.lpi, it says lazarus.lpi. QuoteI didn't get you? It is stated you cannot directly compile that project, and then it is stated: set breakpoints and run the project. Yes, you can run the project but you cannot build Lazarus using it. Feel free to improve the wiki text if needed. Thaddy is confusing you with fpcup. You don't really need it. Just get Lazarus trunk from SVN server and compile using your installed FPC. However Lazarus trunk is necessary when you plan to create patches. Don't use a release version for that. fpcup is most useful when you must get and install FPC trunk but you don't need it. ---------------------------------------------------------------------- Thaddy · 2016-06-27 10:31 Quote from: JuhaManninen on June 27, 2016, 12:27:23 pmThaddy is confusing you with fpcup. You don't really need it. Just get Lazarus trunk from SVN server and compile using your installed FPC. However Lazarus trunk is necessary when you plan to create patches. Don't use a release version for that. fpcup is most useful when you must get and install FPC trunk but you don't need it. What I tried to explain is that fpcup in its default mode includes debug info into both Lazarus and FPC. That's all. I don't think that was that confusing. After you build Lazarus and FPC with debug info you can use GDB to debug them. ---------------------------------------------------------------------- markus_ja · 2016-06-27 10:48 QuoteApparently you didn't read the instructions again. It does not say lazbuild.lpi, it says lazarus.lpi. Thanks. It's working now ---------------------------------------------------------------------- markus_ja · 2016-06-27 11:33 OK. Debugging is now working. But as already descript re-compiling doesn't work in the current IDE. So, I downloaded lazarus trunk from svn. But how can I compile it? I tried to open the lazarus.lpi file from svn trunk in my installed lazarus IDE, but I couldn't compile. Error: lazarus.exe not found. It is also stated that I should use the FPC compiler in the installed lazarus version, to compile the trunk, but don't know how. ---------------------------------------------------------------------- JuhaManninen · 2016-06-27 12:30 It is explained in the same wiki page. Basically just run "make".  http://wiki.freepascal.org/Getting_Lazarus#Compiling_and_running_Laza rus Don't mix the different IDE versions. You can use the installed FPC. For cmd line "make" it must be in PATH. (Inside an already built Lazarus you can configure also a compiler which is not in PATH). ---------------------------------------------------------------------- markus_ja · 2016-06-27 16:42 QuotePlease also list the changes you plan for ProcedureList. I changed it once but apparently did not understand how it works and I had to revert my changes. The code is from Graeme, he may also review your changes. Finally, I was able to compile and debug the IDE I also made some modifications to the procedurelist.pas file. How can I share my changes with the community? Changes: * the filter text now filters the class name, as well. * with the . (dot) you can seperate the class name and method filter e.g.: TForm1.Test  => fo.es : match = true TForm1.Test => .st : match = true (filters only class methods) TForm1.Test => tes : match = true TForm1.Test => orm : match = true ---------------------------------------------------------------------- JuhaManninen · 2016-06-27 19:09 Quote from: markus_ja on June 27, 2016, 06:42:48 pmFinally, I was able to compile and debug the IDE I also made some modifications to the procedurelist.pas file. How can I share my changes with the community? http://wiki.freepascal.org/Creating_A_Patch Usually the bug tracker is the right place but now you can also attach your patch here. I hope Graeme can check it. The logic in ProcedureList is a little odd to start with, and your changes are a little odd, too. I am not sure if I can be a fair judge. ---------------------------------------------------------------------- markus_ja · 2016-06-27 19:40 I just added an option to include the classname while filtering The . (dot) is just an option to distinguish between class name and method name. If you dont use the . (dot) it filters as usual, but including the class name. ---------------------------------------------------------------------- markus_ja · 2016-06-28 06:53 Added it to the bug tracker in order I can watch the status. http://bugs.freepascal.org/view.php?id=30317 ---------------------------------------------------------------------- vfclists · 2016-07-06 20:20 Developing IDE extensions is something I want to be doing so I want understand this. In order to debug Lazarus in the IDE you must have a working IDE to debug the newly downloaded one which was compiled by fpcup, get lazarus or the standard wiki methoed.? Does this mean that the version of FPC you are using must be the same one that was used to build the new Lazarus? If it is the case then I assume that: 1. You  use the FPC of your working Lazarus to compile the download, after which you open the lazarus.lpi like any other project for development. or 2. You download a new FPC to build the new Lazarus, switch the FPC of your working Lazarus to it, do a Clean All and Build then open the lazarus.lpi of the newly downloaded Lazarus? Am I right?