[SOLVED] How to debug TDBF lazarus / 12-Debugger ---------------------------------------------------------------------- markftl · 2022-03-14 23:26 Hi All,  I'm rewriting a system I wrote over 20 yrs ago, and am looking at options for the databases (to run under linux and windows).  I've found the answers to most of my questions by looking at the source code and forum posts, but am at the point that I would really like to step through the TDbf code at multiple points to make complete sense out of it.  The problem is that I'm a bit rusty and have little successful experience compiling the IDE or Compiler manually, so I'm a bit lost.  I use fpcUpDeluxe (what a GREAT tool) for my laz installs.  Any help on this would be greatly appreciated. Lazarus v2.0.12 FPC v3.2.2 Installed with fpcUpDeluxe Linux Mint 20.2 ---------------------------------------------------------------------- wp · 2022-03-15 00:02 If you do not dare to recompile FPC with debug information you can do this: Not recommended in general, but since no other units use the dbf sources, you can simply add the path to the dbf source files to the unit path of your project. Assuming your Lazarus is installed in c:\Lazarus then normally this is "C:\Lazarus\fpc\3.2.2\source\packages\fcl-db\src\dbase" ---------------------------------------------------------------------- markftl · 2022-03-15 00:20 Thanks for the reply, wp. I just tried adding '.../dbase' to the unit search path and it works perfectly. Thanks so much! I'll mark this as solved. but, since you mentioned it, can you point me in the right direction to recompile fpc with debug info? I'd like very much to be able to do this when needed. ---------------------------------------------------------------------- wp · 2022-03-15 00:43 Here is the batch file that I am using to recompile FPC/main (64 bit) with debug info for Windows: Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i set BINUTILS_DIR=C:\Lazarus\fpc_bootstrap_compiler\3.2.2\x86_64-win64set BOOTSTRAP_COMPILER=%BINUTILS_DIR%\ppcx64.exeset FPC_DEST_DIR=c:\Lazarus\fpc-mainset BIN_DIR=bin\x86_64-win64set FPC_BIN_DIR=%FPC_DEST_DIR%\%BIN_DIR%set OPTIONS="-dDEBUG -gl -gw2" ::- ---------------------------------------------------------------------- -------:: Set Path::-------------------------------------------------- ----------------------------path %BINUTILS_DIR%;%PATH% ::------------- -----------------------------------------------------------------:: Pr eparations::---------------------------------------------------------- --------------------cd %FPC_DEST_DIR%md %FPC_BIN_DIR%copy %BINUTILS_DIR%\*.* %FPC_BIN_DIR% > nul :: Required - otherwise the script does not always work del /q /s %FPC_DEST_DIR%\units > nulrmdir /q /s %FPC_DEST_DIR%\units ::----------------------------------------- -------------------------------------:: Build FPC::------------------- -----------------------------------------------------------make clean all install OPT=%OPTIONS% PREFIX=%FPC_DEST_DIR% FPC=%BOOTSTRAP_COMPILE R% ::----------------------------------------------------------------- -------------:: Make fpc.cfg, ::-------------------------------------- ----------------------------------------cd %FPC_DEST_DIR%fpcmkcfg -d basepath=%FPC_DEST_DIR% -o %FPC_BIN_DIR%\fpc.cfg  echo Compilation successful. The folder BINUTILS_DIR contains the bootstrap compiler, i.e. the compiler which will do the work - simply use the fpc from another installation; you can use the current or previous release version. The folder FPC_DEST_DIR is the folder containing the FPC source files; the fpc binary will be created in a subfolder of it. Adjust these two variables to your folder structure. ---------------------------------------------------------------------- markftl · 2022-03-15 00:48 Thanks again sir, you're a scholar and a gentleman. I started translating your batch file into a shell script and noticed the differences from this being an fpcUpDeluxe install. In the fpcUpDeluxe setup screen there's a checkbox/option to build fpc with debug info. Works like a champ. My plate's pretty full, so I'll save nailing it down via the cl for later, but wanted to share this info in case someone might find it useful.