* * *

Author Topic: Lazarus 1.8.5 sometimes Debugger F7,F8 not working  (Read 761 times)

af0815

  • Full Member
  • ***
  • Posts: 132
Lazarus 1.8.5 sometimes Debugger F7,F8 not working
« on: August 10, 2018, 06:33:23 pm »
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.
« Last Edit: August 10, 2018, 06:44:19 pm by af0815 »
regards
Andreas

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4711
    • wiki
Re: Lazarus 1.8.5 sometimes Debugger F7,F8 not working
« Reply #1 on: August 10, 2018, 07:51:38 pm »
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_debug_session

Pascal

  • Hero Member
  • *****
  • Posts: 692
Re: Lazarus 1.8.5 sometimes Debugger F7,F8 not working
« Reply #2 on: August 10, 2018, 08:04:12 pm »
There 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  :(
laz trunk - fpc trunk 32bit - Windows 10 Pro x64 (1803)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4711
    • wiki
Re: Lazarus 1.8.5 sometimes Debugger F7,F8 not working
« Reply #3 on: August 10, 2018, 09:24:41 pm »
There 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

  • Full Member
  • ***
  • Posts: 132
Re: Lazarus 1.8.5 sometimes Debugger F7,F8 not working
« Reply #4 on: August 10, 2018, 09:33:40 pm »
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 :-) ? 

regards
Andreas

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4711
    • wiki
Re: Lazarus 1.8.5 sometimes Debugger F7,F8 not working
« Reply #5 on: August 10, 2018, 09:43:14 pm »
One 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

  • Administrator
  • Hero Member
  • *
  • Posts: 4711
    • wiki
Re: Lazarus 1.8.5 sometimes Debugger F7,F8 not working
« Reply #6 on: August 10, 2018, 09:44:40 pm »
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

  • Hero Member
  • *****
  • Posts: 692
Re: Lazarus 1.8.5 sometimes Debugger F7,F8 not working
« Reply #7 on: August 11, 2018, 05:42:54 am »
There 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).
laz trunk - fpc trunk 32bit - Windows 10 Pro x64 (1803)

af0815

  • Full Member
  • ***
  • Posts: 132
Re: Lazarus 1.8.5 sometimes Debugger F7,F8 not working
« Reply #8 on: August 11, 2018, 10:33:01 am »
i am using on Windows only win32 Lazarus.
regards
Andreas

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4711
    • wiki
Re: Lazarus 1.8.5 sometimes Debugger F7,F8 not working
« Reply #9 on: August 11, 2018, 12:29:55 pm »
And 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_debug_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.
« Last Edit: August 11, 2018, 04:41:30 pm by Martin_fr »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4711
    • wiki
Re: Lazarus 1.8.5 sometimes Debugger F7,F8 not working
« Reply #10 on: August 13, 2018, 05:10:41 pm »
Off topic from the original post.
Related only to the following issue reported later in this thread:

There 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"
« Last Edit: August 13, 2018, 05:12:30 pm by Martin_fr »

Pascal

  • Hero Member
  • *****
  • Posts: 692
Re: Lazarus 1.8.5 sometimes Debugger F7,F8 not working
« Reply #11 on: August 13, 2018, 09:26:36 pm »
Off topic from the original post.
Related only to the following issue reported later in this thread:

There 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!
laz trunk - fpc trunk 32bit - Windows 10 Pro x64 (1803)

Pascal

  • Hero Member
  • *****
  • Posts: 692
Re: Lazarus 1.8.5 sometimes Debugger F7,F8 not working
« Reply #12 on: August 13, 2018, 10:17:06 pm »
Shouldn't there be a compiler switch to prevent generating debug_frame section?
laz trunk - fpc trunk 32bit - Windows 10 Pro x64 (1803)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4711
    • wiki
Re: Lazarus 1.8.5 sometimes Debugger F7,F8 not working
« Reply #13 on: Today at 12:13:36 am »
Not that I know of.

Pascal

  • Hero Member
  • *****
  • Posts: 692
Re: Lazarus 1.8.5 sometimes Debugger F7,F8 not working
« Reply #14 on: Today at 05:37:31 am »
If there isn't , it should be implemented!
laz trunk - fpc trunk 32bit - Windows 10 Pro x64 (1803)

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus