Recent

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

AL

  • Sr. Member
  • ****
  • Posts: 261
Cannot make sense of lldb
« on: February 22, 2020, 03:39:58 am »
I just installed FPC 3.3.1 and Laz 2.1.0 on a VM-Mac OS 10.14 Mojave
I have set the lldb debugger in the preferences.
The debugger does not stop on break point I have set.
But it give me a debugger error. Could it be a bad installation?
I have installed Xcode and the command line tools.
From the name : I386GPFLT  could it a debugger for 386 ?
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

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Cannot make sense of lldb
« Reply #1 on: February 22, 2020, 12:34:15 pm »
I386GPFLT means "General Protection Fault". Looks like something is trying to access memory it doesn't own.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

AL

  • Sr. Member
  • ****
  • Posts: 261
Re: Cannot make sense of lldb
« Reply #2 on: February 22, 2020, 03:02:24 pm »
yes but this is the I386 that bothers me. I am on 64 bits Cocoa
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

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Cannot make sense of lldb
« Reply #3 on: February 22, 2020, 03:51:15 pm »
IIRC (and I may not: I'm no expert with lldb) the "I386" is meant to signal an Intel PM-capable processor, of which the first was the iAPX 80386. Note that GP faults are old-style exceptions and have been there from the beginning (the 386; the 286 had a similar trap but it worked differently).
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: Cannot make sense of lldb
« Reply #4 on: February 22, 2020, 07:02:46 pm »
The situation with the debuggers is a bit confusing, also to me. Since Martin is not around at the moment, and since I also installed a Lazarus trunk on Mac Mojave recently I want to share my configuration which seems to be working:
  • Are the packages fpdebug and lazdebuggerfplldb installed?
  • In the menu "Preferences" > "Debugger" > "Debugger backend", the combo "Debugger type and path" displays "LLDB debugger (with FPDebug) (Beta)". The path combo underneath displays "lldb" - there is another option "usr/bin/lldb" which I did not test
  • I had some errors due to GDB still, and found out that it helps to check the option "SkipGDBDetection" in the "Debugger specific options" below.
I did not check the other LLDB debugger (package "lazdebuggerlldb" which is marked as "alpha".

AL

  • Sr. Member
  • ****
  • Posts: 261
Re: Cannot make sense of lldb
« Reply #5 on: February 22, 2020, 07:51:33 pm »
In Preferences / Debuggerbackend I have only LLDB Debugger Alpha which is in /Library/Developer/CommandLineTools/usr/bin/lldb
Strangely, the exact name is (2) LLDB Debugger Alpha
I also have GDB (3 options)
I checked the path for Lldb and it is good.

However there is another one (lldb) in
Xcode.app/contents/Developer/usr/bin

The xcode-select --install,  point to this second installation

The installed debugger packages are:
CmdLineDebuggerBase
DebuggerIntf
fpDebug
LazDebuggerGDBmi
LazDebuggerLldb


NOT installed are:
LazdebuggerFp
LazDebuggerfpdserver
LazDebuggerfpgdbmi
LazDebuggerfplldb

Should I de-install all gdb related packages?
« Last Edit: February 22, 2020, 08:08:24 pm by AL »
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

AL

  • Sr. Member
  • ****
  • Posts: 261
Re: Cannot make sense of lldb
« Reply #6 on: February 22, 2020, 09:06:37 pm »
I set the packages like WP said, still the same.
I set break points in my code and the debugger do not stop at them, so I cannot step in the code and see where the error occur.
I made sure the breakpoints were way before the error.
I will try the debugger with one of the example programs.
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

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: Cannot make sense of lldb
« Reply #7 on: February 22, 2020, 11:43:35 pm »
I set break points in my code and the debugger do not stop at them, so I cannot step in the code and see where the error occur.
I usually have this observation, also on Windows, when the checkbox "Generate info for the debugger" in the Compiler Options is not set. And I noticed: In the Project Options of trunk, there is a Debugger Backend combobox now as well, I guess it overrides the IDE-wide debugger settings.

AL

  • Sr. Member
  • ****
  • Posts: 261
Re: Cannot make sense of lldb
« Reply #8 on: February 23, 2020, 12:03:29 am »
Have was not aware of the project debugger backend.
It was set differently from the IDE.  It was set to LLDB Debugger (ALpha)
I tried to set it to "LLDB debugger (with FPDebug) (Beta)" but it would not keep it.
I then set it to "Use IDE debugger".
Now I have a new warning form the debugger (See attached).
It still does not stop at the break points but this may be due to this error.
I have no idea what it is talking about !
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

AL

  • Sr. Member
  • ****
  • Posts: 261
Re: Cannot make sense of lldb
« Reply #9 on: February 23, 2020, 12:17:29 am »
I have erased the dyn file and now that error is gone.
Still not stopping on my break points!
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

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Cannot make sense of lldb
« Reply #10 on: February 23, 2020, 01:38:31 pm »
I tried to set it to "LLDB debugger (with FPDebug) (Beta)" but it would not keep it.
I then set it to "Use IDE debugger".

I struck that too. "Use IDE debugger" was the curious fix.

Quote
It still does not stop at the break points [...]

I can't test at the moment as I'm interstate for a few days for owners corporation meetings. I'll test on my return if no-one else has beaten me to it.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Cannot make sense of lldb
« Reply #11 on: February 23, 2020, 02:48:29 pm »
LazDebuggerfplldb

Should I de-install all gdb related packages?

That one needs to be installed, and "LLdb with fpdebug" should then be in the list.

Not sure if that will solve the issue...

1) Your app does not crash outside the debugger?
2) Does it crash (in the debugger) during start app (before any form is shown). Or does it crash once the form is show (on user action)?
3) Does it crash (in the debugger) if you do not set any breakpoint, and let it just run?

AL

  • Sr. Member
  • ****
  • Posts: 261
Re: Cannot make sense of lldb
« Reply #12 on: February 23, 2020, 02:56:39 pm »
This is very strange.  My program runs fine on windows.
I use TaChart. Without the debugger , my app crash during some Addxy, but never on the same point ( I have 4000 points to chart).
With the debugger it crash almost on startup.
But I have seen something which may be related.  During compilation there are a lot of "file not found" displayed in the message window, but this goes fast and I cannot see what it is exactly.  Also these messages do not stay in the message box, they are overwritten by new ones.  This may be related to the fact that I have a "space" in my folder name where my project is. (I copied that from a Windows Env).  I will rename my folder and see what happens.

Is there a way to make the compiler stop on these errors?
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

AL

  • Sr. Member
  • ****
  • Posts: 261
Re: Cannot make sense of lldb
« Reply #13 on: February 23, 2020, 03:01:02 pm »
removing the space did not help.

I could see the name of some of the 'not found' files. Mailny pp and ppu related to the system and cocoa.
I will make a new fpcUpDeluxe installation.
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

AL

  • Sr. Member
  • ****
  • Posts: 261
Re: Cannot make sense of lldb
« Reply #14 on: February 23, 2020, 03:53:17 pm »
New installation did not help also.
Still report of files not found, but the compiler does not stop ?  And give a success st the end.
I will try to set my VM slower so I can read the missing files.
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