Lazarus 1.8.5 sometimes Debugger F7,F8 not working lazarus / 12-Debugger ---------------------------------------------------------------------- af0815 · 2018-08-10 16:33 Win10 64/Pro, Laz Win32 actual fixes brach with fpc trunk svn39507 or actual stable, gdb 7.7.1 Sometimes i cannot Debug step by step. F9 and the breakpoints work as expected. Buit if i want to step with F7 or F8 i got no reaction.  If i place breakpoints on every line in a procedure, i can step with F9 from brerakpoint to breakepoint and can also evaluate the information. I seems GDB is working correctly, only F7 and F8 are not sendet bny the IDE. Questions A) Am i alone with this problem ? B) How can i solve this ? Edit: It looks working, if i switch to Dwarf2 instead of Dwarf with sets. ---------------------------------------------------------------------- Martin_fr · 2018-08-10 17:51 Quote It looks working, if i switch to Dwarf2 instead of Dwarf with sets. Not yet heard of this one. There is an issue with 64bit (possible only if fpc 3.0.4 is used, not sure) where step over, will step in. But yours I have not yet seen. Well unless you need to inspect sets, you can just use Dwarf2. If you need sets, you can try dwarf3. Dwarf3 also keeps the case (upper/lower) of locals, so they look nicer). But gdb may be less stable. You have to try for yourself. You can also try to compile with -Xe (external linker). That sometimes makes a diff. And make sure you do NOT use smartlinking. You can also try fpdebug (depends on what features you need). Install package LazDebuggerFp, which is part of the distribution. While I cannot promise anything, could you supply a log file: http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debu g_session ---------------------------------------------------------------------- Pascal · 2018-08-10 18:04 Quote from: Martin_fr on August 10, 2018, 07:51:38 pmThere is an issue with 64bit (possible only if fpc 3.0.4 is used, not sure) where step over, will step in. This also is in latest trunk. Very aanoying ---------------------------------------------------------------------- Martin_fr · 2018-08-10 19:24 Quote from: Pascal on August 10, 2018, 08:04:12 pmQuote from: Martin_fr on August 10, 2018, 07:51:38 pmThere is an issue with 64bit (possible only if fpc 3.0.4 is used, not sure) where step over, will step in.This also is in latest trunk. Very aanoying  Afaik it does not depend on the Lazarus version, but on the version of fpc. But not sure. (Older Lazarus, came with older FPC) ---------------------------------------------------------------------- af0815 · 2018-08-10 19:33 I have this problems in the past only if i use Dialogs, like FileOpendialog. After using the dialogs i have seen this. ANd i use the debugger every day :-) for my work. I will go ahead with the tips from Martin_fr. One question more, what did automatic do :-) ? ---------------------------------------------------------------------- Martin_fr · 2018-08-10 19:43 Quote from: af0815 on August 10, 2018, 09:33:40 pmOne question more, what did automatic do :-) ? "Automatic" leaves the choice to fpc. FPC chooses depending on the target. (OS, bitness,...). Different fpc versions may make diff choices. I am not aware of any list, what defaults fpc uses. ---------------------------------------------------------------------- Martin_fr · 2018-08-10 19:44 Btw, if you have the problem, check the "Thread" window. Maybe you are in the wrong thread, then in that thread there may be no info how to step. ---------------------------------------------------------------------- Pascal · 2018-08-11 03:42 Quote from: Martin_fr on August 10, 2018, 09:24:41 pmQuote from: Pascal on August 10, 2018, 08:04:12 pmQuote from: Martin_fr on August 10, 2018, 07:51:38 pmThere is an issue with 64bit (possible only if fpc 3.0.4 is used, not sure) where step over, will step in.This also is in latest trunk. Very aanoying  Afaik it does not depend on the Lazarus version, but on the version of fpc. But not sure. (Older Lazarus, came with older FPC) And with 64bit  breakpoints are only transmitted to the debugger while program is paused (F12). ---------------------------------------------------------------------- af0815 · 2018-08-11 08:33 i am using on Windows only win32 Lazarus. ---------------------------------------------------------------------- Martin_fr · 2018-08-11 10:29 Quote from: Pascal on August 11, 2018, 05:42:54 amAnd with 64bit  breakpoints are only transmitted to the debugger while program is paused (F12). Another one that is news to me. No one reported yet. Can you please supply a logfile? http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debu g_session -- Edit: It works for me. That is local debugger. This issue is known for some remote debugger ("over ssh"). DebugServer *should* deal with it, but depends on gdb. ---------------------------------------------------------------------- Martin_fr · 2018-08-13 15:10 Off topic from the original post. Related only to the following issue reported later in this thread: Quote from: Pascal on August 10, 2018, 08:04:12 pmQuote from: Martin_fr on August 10, 2018, 07:51:38 pmThere is an issue with 64bit (possible only if fpc 3.0.4 is used, not sure) where step over, will step in. This also is in latest trunk. Very aanoying  Try the following. You need an "objcopy" for win 64 bit apps. The only one I could find is in the fpc-build repository, with the tools for cross compiling to 64 bits (but it works fine). The one that comes with fpc 32 bit, will not work. Code: [Select]\FPC\SVN- build\install\crossbinw64\x86_64-win64-objcopy.exe -R .debug_frame  project1.exe  project1n.exeIf you do it right, it shrinks by just a few MB (an empty form1 goes from 27MB to 26MB) then copy project1n.exe back to the original, or set "run parameters" to use the new one. It may be possible to add this to project opitons "compiler commands" ---------------------------------------------------------------------- Pascal · 2018-08-13 19:26 Quote from: Martin_fr on August 13, 2018, 05:10:41 pmOff topic from the original post. Related only to the following issue reported later in this thread: Quote from: Pascal on August 10, 2018, 08:04:12 pmQuote from: Martin_fr on August 10, 2018, 07:51:38 pmThere is an issue with 64bit (possible only if fpc 3.0.4 is used, not sure) where step over, will step in. This also is in latest trunk. Very annoying  Try the following. You need an "objcopy" for win 64 bit apps. The only one I could find is in the fpc-build repository, with the tools for cross compiling to 64 bits (but it works fine). The one that comes with fpc 32 bit, will not work. Code: [Select]\FPC\SVN- build\install\crossbinw64\x86_64-win64-objcopy.exe -R .debug_frame  project1.exe  project1n.exeIf you do it right, it shrinks by just a few MB (an empty form1 goes from 27MB to 26MB) then copy project1n.exe back to the original, or set "run parameters" to use the new one. It may be possible to add this to project opitons "compiler commands" Yes! Works great. I found a newer one here https://svn.freepascal.org/svn/fpcbuild/binaries/i386-win32 Many thanks, Martin! ---------------------------------------------------------------------- Pascal · 2018-08-13 20:17 Shouldn't there be a compiler switch to prevent generating debug_frame section? ---------------------------------------------------------------------- Martin_fr · 2018-08-13 22:13 Not that I know of. ---------------------------------------------------------------------- Pascal · 2018-08-14 03:37 If there isn't , it should be implemented! ---------------------------------------------------------------------- af0815 · 2018-08-14 05:23 Back to my original problem with F7 and F8. I have cleared the whole projectgroup. Recompiled anything with automatic and now it is working (for me). If the problem araise i will have a look on the debugging-windows and make a trace of it. ---------------------------------------------------------------------- af0815 · 2018-08-14 07:50 I have it again, the problem with F7 and F8. Lazarus 1.8.5 r58495 FPC 3.1.1 i386-win32-win32/win64 F7 in Debuggerwindow Quote<-data-evaluate-expression $fp> ^done,value="0x195f8d8" (gdb) <-exec-step> ^error,msg="Warning:\nCannot insert breakpoint -233.\nCannot access memory at address 0x72d54ef4\n" (gdb) F8 in Debuggerwindow Quote<-break-enable 10> ^done (gdb) <-break-enable 9> ^done (gdb) <-data-evaluate-expression $fp> ^done,value="0x195f8d8" (gdb) <-exec-next> ^error,msg="Warning:\nCannot insert breakpoint -236.\nCannot access memory at address 0x72d54ef4\n" (gdb) Comandlineparameters (from Projectoptions - Show Options) without the -F ! Quote -MObjFPC -Scaghi -CirotR -O1 -g -gl -gh -Xg -gt -WG -l -vewnhibq The program is not using Threads. Edit: It look actual for me, if i use not 'Use external gdb debug symbols file (-Xg)' it works. If i recompile with -Xg it doesnt work. ---------------------------------------------------------------------- Martin_fr · 2018-08-14 10:48 QuoteCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ^error,msg="Warning:\nCannot insert breakpoint -233.\nCannot access memory at address 0x72d54ef4\n" The above means gdb has an internal problem. Something went wrong in GDB when GDB tried to find out where the step should end (where the next line is). I dont know why it is related to Xg. Though one danger of Xg is, that the file may for some reason not be updated on every compile (verify it has the same date as the exe). Or there may be an old one around in addition to the new one (I do not know all the locations that gdb searches.). If gdb had an outdate file, then that would cause problems. Generally I recommend not to use Xg. Set up build modes for debug and release. Then it is easy to recompile your release version without debug info. Or use strip.exe to generate your release. ---------------------------------------------------------------------- af0815 · 2018-08-14 11:49 The date/time is similar to the exe. If i set breakpoint by breakpoint i can step wit F9 :-) So the dbg file it looks not corrupt. But i have no problem now, because i look for the Xg switch and set it off, if i want to debug. BTW i use buildmodes very extensive. This was one of my problem to find the logic of the issue. ---------------------------------------------------------------------- Pascal · 2018-08-14 13:41 Quote from: Pascal on August 13, 2018, 09:26:36 pmYes! Works great. I found a newer one here https://svn.freepascal.org/svn/fpcbuild/binaries/i386-win32 Many thanks, Martin! Well, after using this the whole day, i must say that i have problems with F7 now  Sometimes it works like F9 and sometime the IDE says the program is running while it isn't reacting anymore. ---------------------------------------------------------------------- Martin_fr · 2018-08-14 13:46 Quote from: Pascal on August 14, 2018, 03:41:30 pmQuote from: Pascal on August 13, 2018, 09:26:36 pmYes! Works great. I found a newer one here https://svn.freepascal.org/svn/fpcbuild/binaries/i386-win32 Many thanks, Martin! Well, after using this the whole day, i must say that i have problems with F7 now  Sometimes it works like F9 and sometime the IDE says the program is running while it isn't reacting anymore. logfile? ---------------------------------------------------------------------- Martin_fr · 2018-08-21 13:30 Quote from: Pascal on August 10, 2018, 08:04:12 pmQuote from: Martin_fr on August 10, 2018, 07:51:38 pmThere is an issue with 64bit (possible only if fpc 3.0.4 is used, not sure) where step over, will step in. This also is in latest trunk. Very aanoying  Anyone with a good way to reproduce, can you add to https://bugs.freepascal.org/view.php?id=34159