debug problems lazarus / 21-General ---------------------------------------------------------------------- Paolo · 2021-03-08 11:14 Hello, i wrote the test-prog attached to show the problem (windows 10-pro), just a fesh project and one button. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit Unit1; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls; type   { TForm1 }   TForm1 = class(TForm)    Button1: TButton;    procedure Button1Click(Sender: TObject);  private   public    function ok : boolean;  end; var  Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.Button1Click(Sender: TObject);begin  if ok then    beep;end; function TForm1.ok: boolean;begin  result:=true;end; end. with laz 2.0.12 r64642 and a breakpoint on the "ok" with "F7" the debug jump to next line ignoring the breakpoint with laz 2.0.10 r63526 and a breakpoint on the "ok" with "F7" the debug goes inside the "ok" function (as expected) at the moment I cannot debug anything with laz 2.0.12 (moreover very often CPU windows pop-up). Both laz on the same pc and no-different settings among laz versions. ---------------------------------------------------------------------- bpranoto · 2021-03-08 11:30 No problem here with lazarus 2.0.12 SVN:64678 on Linux ubuntu 18.04 64 bits ---------------------------------------------------------------------- Paolo · 2021-03-08 11:31 now the problem is dissapeared ! but in my larger application it is still there... I need to investigate furhter.. ---------------------------------------------------------------------- Paolo · 2021-03-08 12:21 I have to work with laz 2.0.10, same project but in laz 2.0.12 I cannnot debug it ! ---------------------------------------------------------------------- Paolo · 2021-03-08 12:31 I can reproduce the problem also in the above shown "easy" code, see the picture. with laz vers 2.0.10 it is ok, but lax 2.0.12 does not work. ---------------------------------------------------------------------- Martin_fr · 2021-03-08 14:51 ok several issues... All of them assume 64bit IDE / 64bit target. Quotemoreover very often CPU windows pop-upIt's a known issue together with "F8 sometime steps in, instead of over". Some problem either in fpc or gdb. If this happens, then 2 things can be done, both in Tools > Option > Debugger 1) Debugger > General: "Automatically close the asm win". Once you step back to source code... 2) Debugger > General (Laz 2.1: Backend): property grid: FixIncorrectStepOver = True Quotewith "F7" the debug jump to next line ignoring the breakpointActually do you mean "ignoring the "step in"? because you are already stopped at the breakpoint. You want to step into the function (but in the function "result := true" there is no breakpoint)? IIRC 2.0.10 came with GDB 8.2 => 2.0.12 switched back to GDB 7.3.50 The reason is that 8.2 only works correct for people with a latin based locale. Any one else gets there entire environment variables scrambled. Until a few days ago, 7.3.5 was the only build available that would work on other locales. I did spent some time (about 2 weeks) earlier this year, to get a newer GDB. I uploaded this (8.3.1, and yes that is old...) now, despite not having tested it yet. (Still not got the time to test it). And yes it takes a lot of time to build gdb (or maybe I have not yet found the instructions how to do that faster). Usually errors happen about half an hour into the compile. Then you have to do trial and error, how to fix it, and each trial is another half an hour. - I had to extensively search the sources to find, that it will only work with cygwin. - I had to then to lots of trial and error on gbd 10 under cygwin, until I got an error that I could trace via google to a report that all gdb over version 9 are broken for cygwin. - And then it was trial and error to find the settings to compile gdb 8.3.1 (ok, I could have saved some time, and build it none static, and include about 5 or 6 more dll / the cygwin dll itself can not be avoided, unless maybe one uses a real old version of cygwin) - end of rant on building gdb. So your choice for Lazarus 2.0.12 is to download a different gdb from https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064% 20bits/Alternative%20GDB/ If 8.2 works for you, go for it. Or try 8.3.1. Lazarus 2.2 will have 7.3.5. Unless I find the time to test 8.3.1 (feedback on it will help) Alternatively, use FpDebug => package LazDebuggerFp / search the wiki ---------------------------------------------------------------------- Paolo · 2021-03-08 15:09 thanks Martin, I'll check what you suggest. for sake of completeness, also on trunk the same problem QuoteAll of them assume 64bit IDE / 64bit target.  yes win 64 QuoteActually do you mean "ignoring the "step in"? because you are already stopped at the breakpoint. You want to step into the function (but in the function "result := true" there is no breakpoint)? yes F7 does not go inside the function ---------------------------------------------------------------------- Martin_fr · 2021-03-08 15:12 Quote from: Paolo on March 08, 2021, 04:09:49 pmfor sake of completeness, also on trunk the same problem If it is the gdb version, then it depends where you got your trunk from. There is a binaries svn, where the current gdb version is stored. ---------------------------------------------------------------------- Paolo · 2021-03-08 15:26 I have downloaded the following files from 8.3.1 folder gdb.exe gdbserver.exe cygwin1.dll now, what should I do ? ---------------------------------------------------------------------- Paolo · 2021-03-08 15:43 Aaaarghhhh, solved ! I found that in my "stable" 2.0.10 the F7 and F8 buttons are in different order, I have not noticed that and in 2.0.12 I pressed the wrong button (they look very similar), so everything is ok, I'm so sorry for the generated "noise"  and thanks again for the support. ---------------------------------------------------------------------- Martin_fr · 2021-03-08 16:11 Quote from: Paolo on March 08, 2021, 04:26:50 pmI have downloaded the following files from 8.3.1 folder gdb.exe gdbserver.exe cygwin1.dll now, what should I do ? You do not need gdbserver, but no harm. Put them in a folder, go to Tools > Options Debugger Edit the path to gdb.exe. (cygwin1.dll just has to be in the same folder). --- Or replace them in the original folder c:\lazarus\mingw\x86_64\ but keep a copy of the original.... ---------------------------------------------------------------------- Paolo · 2021-03-08 16:50 thanks a lot.