Bug with wrong breakpoint which works when not needed lazarus / 12-Debugger ---------------------------------------------------------------------- AlexTP · 2020-08-18 10:01 Project: CudaText. is has formmain.pas file. and another project: ATSynEdit demo. demo with formmain.pas file. by mistake i placed brkpnt in ATSynEdit demo when CudaText was opened. result: bad breakpoint which stops running of CudaText. it shows stop in some random func in formmain.pas where NOT needed. cudatext.lps file shows bad data. after deleting, bad breakpoint gone. 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                                                                   Laz trunk. fpc 3.2.1. linux gtk2 x64. ---------------------------------------------------------------------- Martin_fr · 2020-08-18 10:37 You mean you have 2 units: - First: In project CudaText, unit "FormMain.pas", in folder of project CudaText - Second: In project AtSynEdit, unit "FormMain.pas" (same name, diff folder), in folder of project AtSynEdit Then you had the project CudaText open. But you also opened the unit  /FormMain.pas  which is not part of the project. You placed a breakpoint in /FormMain.pas The debugger does ignore the path [1]. So this breakpoint will apply in the file "FormMain.pas" that is in the exe. It does not matter where this file came from. [1] It tries first with path, but if that fails then without path ---------------------------------------------------------------------- AlexTP · 2020-08-18 12:06 Yes, like this. Can you make this? if path is found on disk, but file is NOT in project, ignore this breakpnt? ---------------------------------------------------------------------- Martin_fr · 2020-08-18 13:45 The current behaviour is indented. Because on some platform, with sym-links there was a problem where fpc and the IDE had a different idea about what the path should be. So in those scenarios breakpoints would fail, without the current behaviour. What should happen though is, that if such a breakpoint is reached, the IDE should realize if the file that is shown for the "current debug location" differs from the "location of the breakpoint". In that case some useful info should be made available to the user. (This should also happen if a user sets a breakpoint on a line with no code (comment, interface section) and the real breakpoint by gdb is 100 lines later / threshold of break-realline > 10 ) Unfortunately, I have no idea when I will be able to do something about this. Quotebut file is NOT in project, There are people who include files into their code, without adding them to the project. (from within or outside the project folder, both is possible) So breakpoints set here, must work.