Recent

Author Topic: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?  (Read 14438 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9864
  • Debugger - SynEdit - and more
    • wiki
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #15 on: January 08, 2018, 03:21:48 pm »
For me DB with F8 often stops in fpc_AnsiStr_XXX routines. (win64/x86_64, fpc trunk, laz trunk i386, gdb 7.7.50)
How about with older/released fpc?
What debug info type?

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #16 on: January 08, 2018, 03:25:42 pm »
For me DB with F8 often stops in fpc_AnsiStr_XXX routines. (win64/x86_64, fpc trunk, laz trunk i386, gdb 7.7.50)
How about with older/released fpc?
I always use trunk. It happens for some time now. Don't know exactly.

What debug info type?
All.
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #17 on: January 08, 2018, 03:41:27 pm »
Use attached test project to reproduce.
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

RedOctober

  • Sr. Member
  • ****
  • Posts: 452
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #18 on: January 08, 2018, 04:03:36 pm »
My project is built (so far) in Lazarus 1.9 and Fpc 3.1.1 (not trunk).  The original GDB that comes in that install (using fpcupdeluxe 1.6) is 7.3.5  I then upgraded my GDB to 7.7 in accordance with the instructions given earlier in this thread.  I then upgraded my GDB to 7.7.5 in accordance with the instructions given earlier in this thread.  I tried F8-ing through my project, everything happens the same way, on the same lines, as you describe.  I have not yet made the other adjustments. 

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9864
  • Debugger - SynEdit - and more
    • wiki
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #19 on: January 08, 2018, 04:09:34 pm »
According to the feedback from Pascal the other adjustments will not help.

@Pascal: The testproject, you mean no DB needed? A simple stringcompare will trigger it?

I will have to update my win64 environment.

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #20 on: January 08, 2018, 04:13:41 pm »
@Pascal: The testproject, you mean no DB needed? A simple stringcompare will trigger it?
No, just debug the project. There is a breakpoint in OnCreate. When the DB stops press F8 and you will stop at fpc_AnsiStr_Compare_equal.
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

ASerge

  • Hero Member
  • *****
  • Posts: 2241
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #21 on: January 08, 2018, 04:30:31 pm »
No, just debug the project. There is a breakpoint in OnCreate. When the DB stops press F8 and you will stop at fpc_AnsiStr_Compare_equal.
Not reproduced.
All defaults. Lazarus 1.8.0 x64, Windows, GDB 7.3.50. Compiled with debug info. Optimization off.
Stopping at the breakpoint, but F7 and F8 do nothing (move on to the next line).

RedOctober

  • Sr. Member
  • ****
  • Posts: 452
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #22 on: January 08, 2018, 07:50:56 pm »
I'm on Lazarus 1.9  (I moved up from 1.8 due to FBAdmin object causing memory access errors when closing the running .exe )  Fpc 3.1.1

RedOctober

  • Sr. Member
  • ****
  • Posts: 452
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #23 on: January 09, 2018, 06:26:00 pm »
Hi guys and gals.  I have somehow messed up my debugging so that F7 and F8 do nothing now.  Only F9 works.  Here's what I did:

1) Installed Laz 1.8, Fpc 3.0.4 from the Lazarus webpage
2) Installed Laz 1.9, Fpc 3.1.1 from fpcupdelux 1.6
3) Uninstalled Laz 1.8, Fpc 3.0.4
4) Installed Laz 1.8, Fpc 3.0.4 from the fpcupdelux 1.6
5) Used mostly Laz 1.9, Fpc 3.1.1 until I ran into trouble with F8 stepping into Assembler, made all adjustments recommended in this thread.  Did not help the situation, ... so...
6) Deleted both Laz 1.8 and Laz 1.9 that were installed by fpcupdelux 1.6
4) Installed Laz 1.8, Fpc 3.0.4 from the Lazarus webpage

Not sure where to look next.


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9864
  • Debugger - SynEdit - and more
    • wiki
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #24 on: January 09, 2018, 08:45:01 pm »
Check that your keyboard assignment is still ok (it probably is).

Check that you still have a valid gdb installed, and configured under tool > options.

-------
If you install a release, you can clear all old user config.

Otherwise config is kept.
Menu View > Ide Internals > About IDE : search for primary config path.




RedOctober

  • Sr. Member
  • ****
  • Posts: 452
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #25 on: January 09, 2018, 11:31:05 pm »
Thanks Martin_fr.  I cleared my previous user settings when I installed the final Laz 1.8, Fpc 3.1.1   I closed and reopened Lazarus and it seems to work about 60% of the time..  sometimes it will work in some forms and not others.  Then when I start the program again, it works on the form it did not work just a minute earlier in a previous run.  At least it is somewhat useable now.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9864
  • Debugger - SynEdit - and more
    • wiki
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #26 on: January 10, 2018, 10:34:16 pm »
No, just debug the project. There is a breakpoint in OnCreate. When the DB stops press F8 and you will stop at fpc_AnsiStr_Compare_equal.

Steps correctly here.

Fpc (svn from today) build with -gl -O1
Lazarus (svn from today)

Tried with gdb 7.3.5 and 7.7

------------
Edit:

@Pascal
Can you compile the test app with
-alrt

Check if the result still produces the error, and if yes attach the unit1.s file


just got it, if I compile fpc with -O4 -g-
« Last Edit: January 10, 2018, 10:45:24 pm by Martin_fr »

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #27 on: January 10, 2018, 10:50:36 pm »

@Pascal
Can you compile the test app with
-alrt

Check if the result still produces the error, and if yes attach the unit1.s file

Code: Text  [Select][+][-]
  1. Unit1.pas(40,0) Error: Assembler x86_64-win64-as.exe not found, switching to external assembling
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9864
  • Debugger - SynEdit - and more
    • wiki
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #28 on: January 10, 2018, 11:21:45 pm »
Never mind the asm. Since I was able to get the issue myself.

I compared the generated asm output by both compilers (build with the 2 settings). I could not see any relevant difference.

The asm for unit1 is the same (as it should)
The generated debug info (in the asm source) has equal line info. (Other parts are affected by the differences in the compiled rtl, but they do not matter: eg TObject)

Even the asm for stringcompare is similar enough (disassembled by gdb)

So that indicates that the problem lays further down the road.

It could be the linker (that has happened before).
Or it is gdb.

--------------------
In either case the solution is to have a version of fpc/rtl compiled with settings that work for debugging.

Or try gdb 8.x / if you can get it. May or may not make a diff.


Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #29 on: January 10, 2018, 11:25:34 pm »
just got it, if I compile fpc with -O4 -g-

It works as i386-win32 but not as x86_64-win64! (Lazarus i386_win32 with x86_64-win64 crosscompiler)
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

 

TinyPortal © 2005-2018