Recent

Author Topic: Cannot make sense of lldb  (Read 3707 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Cannot make sense of lldb
« Reply #15 on: February 23, 2020, 04:03:29 pm »
Right click the message window, and find the menu entry: Copy => Copy all and original messages.
Then paste into an editor of your choice.

-------
Make sure to compile with "dwarf", not "stabs": Project Options > Debug info

Make sure you compile with range checks and all : -Criot
Also try with/without "heaptrc" -gh.

On Windows, test your app with -gt  and also -gtt  or -gttt   (1 to 3 t)
(helps sometimes to detect uninitialized vars)

When your app crashes:
1) See if you can find anything by using the Stack window. Any callers may be useful.
2) Before pressing F9/Run go to menu: View > Ide internals (on some versions "Debug windows" instead) > Debug output.
  This should print raw communications between the IDE and lldb. Copy, and paste in this topic.


AL

  • Sr. Member
  • ****
  • Posts: 261
Re: Cannot make sense of lldb
« Reply #16 on: February 24, 2020, 12:24:39 am »
Thank you Martin. Using the copy all originals I could see that the compiler is scanning may be 20 directories and reporting Not Found on each until it scan the RTL and then indicate  FOUND.
So this was not the problem.

I have noticed a strange behavior.  I changed the caption of a button on the form .  It did change on the build screen and in the .lfm file BUT it did not changed in the executable file.
This mean to me that the compiler /liker is taking the file somewhere else.
I tried to see where that could be and did not find it.
There are 3 subdirectories from differents targets ( i386-Win 32 , X86_64-Win64, X86_64-Darwin) I notices there are lfm and pas files there also.
While I was writing this, I remembered that when cross-compiliing from Windows the executable is not updated in the app folder. I was sure that in Darwin it would be, since the "Use App bundle for running and debugging" was checked. In fact it is not updated.
( Is this a bug ? Or a feature that could be implemented)
This is why all the breaks points I was putting in the code were without effect.

I wil make more tests but I think now the debugger should work.




Laz 3.1, fpc 3.2.2, Win10
Laz 3.1  fpc 3.2.2, MacOS Monterey running on VMWare/Win 10
Laz 3.1  fpc 3.2.2 Ubuntu 20.04

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Cannot make sense of lldb
« Reply #17 on: February 24, 2020, 11:13:25 am »
Afaik on Mac the executable in the app bundle is a sym-link to the exe in the project dir (or something like that / not sure)

Anyway if your form data *.lfm is not updated, that could be the cause of the crash. (And that crash would probably happen before any breakpoint can be reached).
The lfm file is saved with your sources, but on compile copied to your lib folder (where the ppu go). If that fails there is a problem.


Also if any compiled unit is not updated, then that can get you crashes.
In the same manner, debug info may be outdated and then the translation between line-number and asm-code-address does not work, and breakpoint will not stop.

The "not found" messages, are probably shown because you added some verbosity option (project options, or command line -v... / maybe -va)

------
First: Did you (in project options) on the page "Paths" change any of the path settings?
If you did, that is most certainly the cause of your issue. Those settings are truly advanced, and every so often someone runs into trouble.

Check your project folder for any *.ppu and *.o files.
Unless you deliberated copied something in (from a 3rd party closed source package), you can delete then and should do so. There is a "clean up and build" menu entry, that should allow you to get rid of them.
The correct ones will then be build.

wp

  • Hero Member
  • *****
  • Posts: 11857
Re: Cannot make sense of lldb
« Reply #18 on: February 24, 2020, 11:42:51 am »
There are 3 subdirectories from differents targets ( i386-Win 32 , X86_64-Win64, X86_64-Darwin)
I know that you have the Mac on a VM using a Windows host. Does this mean that you share your Windows project folder with the Mac VM? Are you sure that Mac has permissions to write on Windows? For a test, copy the project to the Mac-VM and work with the copy only. Make sure that you are the owner of the copied files and have all permissions needed (I know from my own (little) experience with Mac that this is critical).

AL

  • Sr. Member
  • ****
  • Posts: 261
Re: Cannot make sense of lldb
« Reply #19 on: February 24, 2020, 02:57:12 pm »
Thanks all for your help.  I am making progress (slowly).

My windows project folder is copied to the VM-Mac desktop so permissions should be OK there.

I have not changed any Paths ( the install was form FpcUpDeluxe)

I do make "clean and Build" from time to time to make sure I have good compiled files.

Since I copy manually  (at each build) the executalble in the app folder, things run more normally.
I think, before doing that, I was running always the original executable and my changes and break points and forms changes seems they were not considered because of that.


The debugger now runs since I installed the fpdebug package and use the lldb with fpdebug Beta.
However I still get crash. I am using AudioQueue and this have a Callback procedure, I think the crashes are related to that.  Crashes are related to memory.  Sometimes  I have EStackOverflow ( although I increased the memory to 6 gig), sometimes Access violation, etc.
One thing that bothers me is this warning I have when testing the complier options:
How can I eliminate that?


HINT: using config file /Users/al/Lazarus/fpc/bin/x86_64-darwin/fpc.cfg
WARNING: ppu exists twice: /Users/al/Lazarus/fpc/lib/fpc/3.3.1/units/x86_64-darwin/univint/Dialogs.ppu, /Users/al/Lazarus/fpc/lib/fpc/3.3.1/units/x86_64-darwin/fv/dialogs.ppu
WARNING: ppu exists twice: /Users/al/Lazarus/fpc/lib/fpc/3.3.1/units/x86_64-darwin/univint/Menus.ppu, /Users/al/Lazarus/fpc/lib/fpc/3.3.1/units/x86_64-darwin/fv/menus.ppu
WARNING: ppu exists twice: /Users/al/Lazarus/fpc/lib/fpc/3.3.1/units/x86_64-darwin/fv/dialogs.ppu, /Users/al/Lazarus/lazarus/lcl/units/x86_64-darwin/dialogs.ppu
WARNING: ppu exists twice: /Users/al/Lazarus/fpc/lib/fpc/3.3.1/units/x86_64-darwin/fv/menus.ppu, /Users/al/Lazarus/lazarus/lcl/units/x86_64-darwin/menus.ppu
WARNING: ppu exists twice: /Users/al/Lazarus/fpc/lib/fpc/3.3.1/units/x86_64-darwin/univint/Controls.ppu, /Users/al/Lazarus/lazarus/lcl/units/x86_64-darwin/controls.ppu
WARNING: ppu exists twice: /Users/al/Lazarus/fpc/lib/fpc/3.3.1/units/x86_64-darwin/univint/Dialogs.ppu, /Users/al/Lazarus/lazarus/lcl/units/x86_64-darwin/dialogs.ppu
WARNING: ppu exists twice: /Users/al/Lazarus/fpc/lib/fpc/3.3.1/units/x86_64-darwin/univint/Menus.ppu, /Users/al/Lazarus/lazarus/lcl/units/x86_64-darwin/menus.ppu
Laz 3.1, fpc 3.2.2, Win10
Laz 3.1  fpc 3.2.2, MacOS Monterey running on VMWare/Win 10
Laz 3.1  fpc 3.2.2 Ubuntu 20.04

 

TinyPortal © 2005-2018