Feedback about GDB on Windows lazarus / 12-Debugger ---------------------------------------------------------------------- Martin_fr · 2019-10-13 15:59 To all who - use Lazarus on Windows (any version of Lazarus 2.0 or 2.1) - use or have tried GDB 8.2 (for 64bit users also GDB 7.7 or 8.1) from https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2032% 20bits/Alternative%20GDB/ https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064% 20bits/Alternative%20GDB/ This question is aimed at "Dwarf 2 with sets" setting. Dwarf 3 experiences can be reported, but are expected to be worse. (There are plenty of types/structures that GDB (in any version) can not display when using dwarf 3) 32bit users, please ensure you switch to Dwarf. Testing with Stabs (fpc -g or -gs  / the default for 32 bit) is pointless. What is your experience with GDB 8.2 (7.7/8.1)? Compared to the default GDB (32bit: 7.7.1 / 64bit: 7.3.50) Any improvements you noticed? Any degradations you noticed? - Your Lazarus and FPC version/revision. - Your OS (with version and 32 or 64 bit) - Your IDE is 32 or 64 bit - Your FPC is 32 or 64 bit - Your target app is 32 or 64 bit (and indicate if it was cross compiled, by an FPC with different bitness) Thank you ---------------------------------------------------------------------- nanobit · 2019-10-13 22:28 Laz win32: my baseline mostly is fpc3.2, dwarf3 and gdb8.2 (with fpdebug). Stability and speed are good. Stepping with gdb8.2 is definitely faster than gdb7.7.1. I go back to gdb7.7.1 only in special case: if source code has interface variables, which is known: https://bugs.freepascal.org/view.php?id=35129 About dwarf2 vs. dwarf3: Regardless of gdb version, dwarf2 is needed sometimes for watching ( oldstyle object), but I'm not aware of unreported dwarf3 issues. And dwarf2 is needed for regular Laz2.0.4, because it has not the fix for dwarf3 issue 0035405 ( here I found another (unreported) effect: The exception classname can be faulty. If the exception is registered in the ignorelist, it won't be found there, thus not ignored.) ---------------------------------------------------------------------- Martin_fr · 2019-10-14 23:46 Quote from: nanobit on October 14, 2019, 12:28:38 ambut I'm not aware of unreported dwarf3 issues. Just added some: https://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Bugs_in_GDB (last 3 in the list) ---- EDIT: Quote from: nanobit on October 14, 2019, 12:28:38 amRegardless of gdb version, dwarf2 is needed sometimes for watching ( oldstyle object), but I'm not aware of unreported dwarf3 issues. That is fixed in fpc trunk: https://bugs.freepascal.org/view.php?id=36017 ---------------------------------------------------------------------- BrunoK · 2019-10-15 12:47 Find that lazarus (+/-) trunk, FPC 3.0.4 (the mac one with some downport from trunk) and GDB 8.2 do work really well. Haven't found any particular problems. Default debugging optimization/compilation settings I use for lazarus / FPC : -O1 -OoREGVAR -gw2 -godwarfsets -gl ---------------------------------------------------------------------- BrunoK · 2019-10-15 12:49 Meant mostly 32 bit w10 programs, and occasionally also 64 bit W10. ---------------------------------------------------------------------- Akira1364 · 2019-10-15 14:32 I've found the overall debugging experience has definitely been steadily improving on Windows over the past little while. I'm using native-64-bit trunk FPC / Lazarus on 64-bit Windows 10, with the GDB from here: https://nuwen.net/mingw.html And it works nearly flawlessly in "FPDebug enhanced" mode, with both Dwarf 2 and Dwarf 3. Really my only "complaint" at this point is that the visual aspect of debugging in the IDE itself could probably be better... for example, the use of a grid control for displaying variables is perhaps not the best approach, because it means that stuff like arrays get crammed onto one line and become somewhat difficult to read. ---------------------------------------------------------------------- Martin_fr · 2019-10-15 15:14 Quote from: BrunoK on October 15, 2019, 02:47:39 pmFind that lazarus (+/-) trunk, FPC 3.0.4 (the mac one with some downport from trunk) and GDB 8.2 do work really well. Haven't found any particular problems. While off topic, if you are an Mac, you might want to compare your experience to using LLDB (important the one WITH fpdebug) https://forum.lazarus.freepascal.org/index.php/topic,42869.0.html QuoteDefault debugging optimization/compilation settings I use for lazarus / FPC : -O1 -OoREGVAR -gw2 -godwarfsets -gl While those settings are fine, they can have side effects. OoREGVAR: Fpc does not write debug info for values held in registers (it will instead claim the value in the mem location that is reserved but potentially not updated). Therefore local vars may sometimes show outdated values. O1: A similar effect, but only in very rare occasions can be caused by -O1 (instead of -O- ). Though I have not seen it happen in a long time.