Debugger Error lazarus / 12-Debugger ---------------------------------------------------------------------- MoellerCLaus · 2014-12-27 11:33 Out of nowhere this debugger messages comes up (see attachment)? I ahve removed all breakpoints and started up again - but the error is persistant. Any ideas how to avoid it? Running under Windows 7, 32 bit ---------------------------------------------------------------------- howardpc · 2014-12-27 12:50 Do you use an external gdb debug symbols file? If so, delete all .dbg files before rebuilding and see if it makes any difference. If not, try setting this option in your project options dialog. ---------------------------------------------------------------------- MoellerCLaus · 2014-12-27 17:17 No I did not use external debugger. Tried that as well after recompiling Lazarus. Same result Got another one; see attachment. I am testing further. If I close all open files in the editor - it seems to disappear ---------------------------------------------------------------------- MoellerCLaus · 2014-12-27 17:38 When leaving my application (debugging) the attached error comes up. ---------------------------------------------------------------------- marcov · 2014-12-27 17:56 What GDB do you use? Maybe it finds some 3rd party installed gdb instead the one that comes with Lazarus? ---------------------------------------------------------------------- MoellerCLaus · 2014-12-27 18:33 My setup for debugger: ---------------------------------------------------------------------- MoellerCLaus · 2014-12-27 18:54 Found something scarry; but now I can omit the fault/error. Code: [Select]procedure TImportVigForm.IndlaesExecute(Sender: TObject); Var A : Integer; begin   A := 1;   While A < StringGrid1.RowCount Do     Begin       If StringGrid1.Cells[ImportCheck,A] = '1' Then         Begin // Indlæses           If A = RaekAfdDef Then IndlaesAfdDef;           If A = RaekMedlem Then IndlaesMedlem;           If A = RaekKontoBes Then IndlaesKontoBes;           If A = RaekAktiviteter Then IndlaesAktiviteter;           If A = RaekPrisKategori Then IndlaesPrisKategori; //          If A = RaekAktMed Then IndlaesAktMed; // If I remove the // I get a debugger error; having a breakpoint in this procedure           If A = RaekPeriode Then IndlaesPeriode;           If A = RaekMaerke Then IndlaesMarkDef;           If A = RaekMarks Then IndlaesMarks;         end;       Inc(A);     end; end; In practise if I place a breakpoint in a procedure that is never called I get these errors! Further I get the attached message - which leads to that I have to leave/close Lazarus. Delete the exe. Start again and we are back. Maybe this has to be so; but it took me by surprise.   I am still a big fan of Lazarus; been with Delphi for several years. ---------------------------------------------------------------------- Laksen · 2014-12-27 19:57 What version of lazarus and FPC is that? What GDB is the environment options for the debugger pointed at? The one shipped with FPC? ---------------------------------------------------------------------- MoellerCLaus · 2014-12-27 20:04 Lazarus and FPC - The latest I believe - see attached copy of the About. The debugger is the default option for windows - please see above/below in previous ansver. ---------------------------------------------------------------------- Laksen · 2014-12-27 21:50 I mean the options in the IDE. Tools -> Options... -> Debugger -> General It sounds like you either have some very aggressive virus scanner, or a broken/incompatible GDB. ---------------------------------------------------------------------- MoellerCLaus · 2014-12-27 22:01 Again I don't think anything is changed from default install. See attached. Just to get it right. Everything works fine after I included a call to the procedure in my code. So in a way my problem is solved, but I was not expecting that response to setting a breakpoint in a procedure not called/used. Thanks for your interest in my experience. ---------------------------------------------------------------------- Martin_fr · 2014-12-28 11:21 Quote from: MoellerCLausIn practise if I place a breakpoint in a procedure that is never called I get these errors! Further I get the attached message - which leads to that I have to leave/close Lazarus. Delete the exe. Start again and we are back. This sounds as if you have smart linking enabled. Switch it off (search debugger setup on the wiki). - no smart linking - no optimization smart linking iirc is an issue in the build in linker (on win), there is somewhere a bug report for this. ---------------------------------------------------------------------- MoellerCLaus · 2014-12-30 07:24 OK I was not aware of that. My seetings were: Projects Options, Compilation and Linking: Optimizations levels : 1 (Debugger friendly) -> now 0 no optimization No linking switches set. So nothing change. I will try that and come if the error messages comes again. ---------------------------------------------------------------------- Martin_fr · 2014-12-30 11:43 http://wiki.freepascal.org/Debugger_Setup#Project_Options -O1 is not likely to have caused your issue. But in some cases O1 causes local vars to display wrong in watch/hint. *IF* you did edit fpc.cfg in the past, make sure you have no -XX in there. QuoteI ahve removed all breakpoints and started up again - but the error is persistant.Did you remove them in the breakpoint window, or in the source editor? http://wiki.freepascal.org/IDE_Window:Breakpoints you may have breakpoints in closed files. Also maybe "reset the debugger" (Menu run) between runs. If this helps, see the options, it can be automated. ---------------------------------------------------------------------- MoellerCLaus · 2014-12-30 16:33 No the O1 did not help me. The debugger error comes occasionally! FPC.cfg no I did not change anything. The breakpoints I remove from the breakpoint window. But I have have to remove them after every compile/run - it hinders effective coding. Reset the debugger - seems as I good idea. How do I do that automatically ---------------------------------------------------------------------- Martin_fr · 2014-12-31 11:40 Quote from: MoellerCLaus on December 30, 2014, 05:33:46 pm Reset the debugger - seems as I good idea. How do I do that automatically There is a checkbox in Menu: tools > options > debugger.  The way lazarus uses gdb is, that it starts one instance of gdb once, and then uses this for all your debugging. Reset starts a new gdb instance. So there is no memory of previous runs. ------------------------ About the error: cannot set brk at addr: 0x0000 The address in your screenshot was very small. Normally addresses should be at least 5 digits (e.g. 0x410123). My guess still is that the linker put in unused debug info (It does when smart linking, but maybe in other cases too). You can try the external linker (slower) by adding -Xe in the options. (project options / other / custom opts)