something like debug dcu lazarus / 12-Debugger ---------------------------------------------------------------------- lorincka · 2008-09-07 16:09 Hi all I would like to set breakpoints into units of FLC library (more exactly, units now I'm interested in are ones related with TDataSet, like DB), and I would like debugger to stop on them, just to explore units and understand how they work. To be more clear, in delphi ide I would reach this goal by setting "use debug dcus" in project options. Last I tried (I don't know if correctly, probably no because it didn't work ) was to open unit DB on editor, work on "configure Build+Run file" and recompile unit DB. I see that this operation generates new *.o files, but system seems not to accept parameters I try to pass to the compiler on "configure Build+Run file" menu. In particular I wanted to change the option "Build Command" to "$(CompPath) -g -gl -01 $(EdFile)" but system seems not to save this information, since when I open the panel always proposes default command "$(CompPath) $(EdFile)". Have you any idea to compile/find debug versions of FCL units from IDE? Is there a standard way to do this job? Thank you all! ---------------------------------------------------------------------- bobo · 2008-09-08 03:37 If you copy the source files of those FCL units into your project directory wouldn't Lazarus compile your project using those copied files? And you can open them in the editor and put breakpoints in them. Or make changes to them too, god forbid. ---------------------------------------------------------------------- lorincka · 2008-09-08 12:50 Yes, that was the first thing I tried to do: I'm working on a local copy of fpcsrc (something like /home/username/lazarus/lib/fpcsrc), also changed in "Environment options" parameter "FPC source directory" to that value, and added directory /home/username/lazarus/lib/fpcsrc/packages/fcl-db/src/ to library path in "compiler options", but system seems to use its owns already existing compiled units. Even if I change db.pas in a stupid way, so that it should not compile, it keeps on linking project. Maybe I'm doing somewhere something very stupid, due to my inexperience with this environment ... any suggestions? ---------------------------------------------------------------------- bobo · 2008-09-08 22:10 This might help a little: http://www.lazarus.freepascal.org/index.php?name=PNphpBB2&file;=viewto pic&t;=2740&start;=0&postdays;=0&postorder;=asc&highlight;= "You need to build a FCL with debugcode. You can try by doing a make OPT=-g in the FCL dir and then adding the units dir to the compiler path. (they must be before the regular path to the fcl units" So basically: cd \lazarus\fpc\2.2.3\source\packages (or wherever it is for you) make OPT=-g and then "add the units dir to the compiler path. (they must be before the regular path to the fcl units)" in Lazarus. I'm not sure for this last one what exactly you need to do and where but let us know how did it go ---------------------------------------------------------------------- lorincka · 2008-09-09 09:35 Oh, thank you, I think that's what I need. I sought posts about that for a while, but I didn't find it. Sorry. ---------------------------------------------------------------------- lorincka · 2008-09-10 07:51 well, I built debug version of fpc by downloading a fpcbuild-2.2.0.zip file containing a valid makefile. By the command make FPC=/my_path/ppc_compiler OPT=-g install system smoothly installed a new compiler and new libraries. (while on linux ubuntu I had problems with the latest release of sources, version 2.2.2, due to a not matching version of libgdb.a, so that I could build it only passing to make the parameter  "NOGDB=1"). And that was the step 1 The second step I think means: "tell the compiler to use new libraries instead of default ones". Till now I did not understand, you can change it someway from ide, or you must edit some config file, or set an environment variable ... ---------------------------------------------------------------------- lorincka · 2008-09-18 08:36 well, the only way I found to perform step 2 on linux ubuntu 8.04 was to substitute /usr/lib/fpc/2.2.0/units/ with my own custom fcl units by a soft link. I don't know if there is a smarter way ... I would appreciate any suggestion.