IDE marks wrong line when debugging with gdb lazarus / 12-Debugger ---------------------------------------------------------------------- theojk · 2011-05-28 13:44 Hi, I have a strange problem. Maybe it is more an IDE problem than a debugger problem. I have a small project with 1 form and 10-15 source files. It compliles withput any problem, but when I start debugging the IDE shows in some (not all) files the wrong codeline. Most of the time it missed the correct line (with the breakpoint) by 1 or 2 code lines. for instance the red breakpoint sign is on line 103 but the green debug-position-mark is on line 104 (even if the line is empty). The debugger output log shows a breakpoint on line 103, which is correct, but the IDE shows me the debug position on line 104. I have tried to (a) replace all LF to LFCR (in fact I found 1) (b) create new Unit and copy all code in it of course always with complete recompile of the project (b) makes no changes, but (a) had a little success: After recompile the project, the code line was correct. But after fixing a logical error in the code, recompile and restarting debugger, the line was incorrect again. But this time I didnt find any single LF anymore. Do anyone have an idea how to fix this problem. It is very hard to debug, if always the wrong line is marked. Thanks Juergen ---------------------------------------------------------------------- Martin_fr · 2011-05-28 14:29 First of all it is important to know which Version of Lazarus. http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Basic_Information If you upgraded, you should check, that gdb an fpc are correctly upgraded too. Next, it is important to know what debug info you use page "linking" in "project options" (menu "project") there are -g, -gl -gw (see end of the text from each checkbox) Also it is important that you do not use smart linking. there seem to be a couple of issues with that. Also make sure, that all units where recompiled, after any changes (menu "run" => "build") ---- When you run your application, the IDE should show small blue dots on the front of each line. If you have a break-point on a line, remove it, to see if a blue dot is on this line. If there is no blue dot, the debugger can not stop there and will stop on the next line with a blue dot. If there is code on the line, but no blue dot, then there is a problem. (there is a known problem inside except...end sections) ---------------------------------------------------------------------- theojk · 2011-05-28 18:42 I have just updated the SVN download and recompile Lazarus from source. Now the error is gone. So obviosly the error was fixed already. Thanks for the fast reply anyway. Juergen