Recent

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

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12520
  • Debugger - SynEdit - and more
    • wiki
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #30 on: January 11, 2018, 12:17:50 am »
It works as i386-win32 but not as x86_64-win64! (Lazarus i386_win32 with x86_64-win64 crosscompiler)
Not sure what you mean?

I tested only with native 64 bit fpc. I did no cross compiling.

If I build my 64 bit fpc (and the RTL, which may be what matters) with

-g- -O4  then the debugger stops on the wrong location

and if fpc was build with
-gl -O1  the debugger works

I have not tested which of the 2 flags makes the difference.

---------
The Project was build in both cases with the same settings, as set in the files provided by you.

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #31 on: January 11, 2018, 06:20:30 am »
My Lazarus is 32bit and uses a 32bit crosscompiler to build 64bit apps which have the problem with F8 stepping
when debugged with gdb 8.0.1 (and others).

My build script:
Code: DOS  [Select][+][-]
  1. @echo on
  2. set myroot=c:\freepascal
  3. set myFPC=%myroot%\fpc\trunk
  4. set mybinutils=%myroot%\binutils_3.0.4
  5. set PATH=%mybinutils%\i386-win32;%myFPC%\bin\i386-win32;%PATH%
  6. cd %myFPC%
  7. rd /s /q  %myfpc%\examples
  8. svn cleanup . --remove-unversioned  --remove-ignored
  9. make distclean all install OPT="-gl -O1" INSTALL_PREFIX=%myFPC% PP=%mybinutils%\ppc386.exe DATA2INC=%myFPC%\utils\data2inc.exe
  10. make all OPT="-gl -O1" OS_TARGET=win64 CPU_TARGET=x86_64 INSTALL_PREFIX=%myFPC% PP=%mybinutils%\ppc386.exe DATA2INC=%myFPC%\utils\data2inc.exe
  11. make crossinstall OPT="-gl -O1" OS_TARGET=win64 CPU_TARGET=x86_64 INSTALL_PREFIX=%myFPC% PP=%mybinutils%\ppc386.exe DATA2INC=%myFPC%\utils\data2inc.exe
  12. cd /d %myFPC%\bin\i386-win32
  13. fpcmkcfg -d basepath=%myFPC% -o .\fpc.cfg

If i leave the OPT parameter stepping is better but also a little confusing. First stop after F8 is:
Code: Pascal  [Select][+][-]
  1. procedure TCustomForm.DoCreate;
  2. begin
  3.   try
  4.     LockRealizeBounds;
  5.     if Assigned(FOnCreate) then FOnCreate(Self); <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  6.     FFormHandlers[fhtCreate].CallNotifyEvents(Self);
  7.     UnlockRealizeBounds;
  8.   except
  9.     if not HandleCreateException then
  10.       raise
  11.   end;
  12. end;

After next F8 it is here, where i expected it after the first F8:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   if f1 = f2 then
  4.     exit;
  5. end; <<<<<<<<<<<<<<<<<<<<<<
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12520
  • Debugger - SynEdit - and more
    • wiki
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #32 on: January 11, 2018, 03:27:50 pm »
The stop in TForm.Create is likely due to what I explained earlier: "ide too smart" => reported as bug.

I played some more, I can trigger the problem by changing the linker (internal vs external / adding -Xe)
Though with a good fpc (-O1 -gl), I get the error by adding -Xe.

---------
At this point I do not know which part of the toolchain causes the error: fpc, ld or gdb.


Unless there is a version of ld or gdb that does not cause the issue, I do not see a quick solution.


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12520
  • Debugger - SynEdit - and more
    • wiki
Re: Is there a way to stop Lazarus F8 debug to NOT step into Assembler?
« Reply #33 on: August 21, 2018, 03:33:34 pm »
I opened an issue for this https://bugs.freepascal.org/view.php?id=34159

If any one has an example for reproducing, please help by adding it.

 

TinyPortal © 2005-2018