Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2018-10

New debugger for Mac based on lldb (Call for testers)

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin Frb

With the Lazarus Release Candidate 1 for 2.0 a new debugger for Mac users has been shipped.
It is based on LLDB, which is provided by apple and is ready to use. So there should no longer be a need to build and codesign gdb.

As the LLDB integration is all new, it needs a lot of testing. So this is a ...

      call to all Mac users:
      Please test the new LLDB based Lazarus debugger.

To test the new debugger, please download the Lazarus 2.0RC1.

- Open the IDE and install the package "LazDebuggerFpLLdb".   It should be in the list of available packages, but if not it is in components/lazdebuggers/lazdebuggerfplldb
  Make sure to use the one with "Fp" in the name. (There also is LazDebuggerLLdb, but it is not as good.)
  Restart the IDE.

- Go to Tools > Options > Debugger
  In the "debugger type" dropdown, you should find and select "LLDB debugger (with fpdebug)"
  The edit below this (where you normally have the path to gdb), should be changed to the path of lldb.
  (lldb comes with the tools from apple; and as such it is already codesigned by apple).

To report any problems:
Start Lazarus from a shell with the following command line (replace pathes according to your installation):

You may need to use startlazarus, or specify the re-build lazarus which may be in your home folder / pcp.

/path/to/lazarus/lazarus.app/Contents/MacOS/lazarus --debug-log=/path/to/yourfiles/laz.log
--debug-enable=DBG_CMD_ECHO,DBG_STATE,DBG_DATA_MONITORS,DBGMI_QUEUE_DEBUG,FPDBG_DWARF_ERRORS,FPDBG_DWARF_WARNINGS,FPDBG_DWARF_VERBOSE_LOAD,FPDBG_DWARF_DATA_WARNINGS,DBG_VERBOSE,DBG_WARNINGS,DBG_STATE,DBG_EVENTS,DBG_THREAD_AND_FRAME

Attach the log file after reproducing the error.

Reply by email

C Western
to Martin Frb
Martin Frb wrote 9 lines
- Go to Tools > Options > Debugger   In the "debugger type" dropdown, you should find and select "LLDB debugger (with fpdebug)"   The edit below this (where you normally have the path to gdb), should be changed to the path of lldb.   (lldb comes with the tools from apple; and as such it is already codesigned by apple).

Did you mean the option "(with fpdebug)"? Trying with this option lazarus throws an exception trying to open a .o file that exists - I can't immediately see why it is throwing the exception. It doesn't seem to reach the stage of starting the program. If I try it without, the debugger seems to be working OK, at least at first glance.

Colin

Reply by email

Martin Frb
to C Western
C Western wrote 15 lines
On 14/10/2018 20:09, Martin Frb via Lazarus wrote: > > - Go to Tools > Options > Debugger >   In the "debugger type" dropdown, you should find and select "LLDB > debugger (with fpdebug)" >   The edit below this (where you normally have the path to gdb), > should be changed to the path of lldb. >   (lldb comes with the tools from apple; and as such it is already > codesigned by apple). > Did you mean the option "(with fpdebug)"? Trying with this option lazarus throws an exception trying to open a .o file that exists - I can't immediately see why it is throwing the exception. It doesn't seem to reach the stage of starting the program. If I try it without, the debugger seems to be working OK, at least at first glance.

Depending on which of the LazDebugger...LLDB package(s) you installed, you should have one or two entries:
  "LLDB Debugger (Alpha)"
  "LLDB Debugger (with fpdebug) (Alpha)"

The 2nd one should be the better one.
The first (without fpdebug), will accept/display watches in C style only, and has had way less testing.

If you get an error, please provide the stacktrace (if you have), together with console output, and logfile.

Please also test with and without "external debug info". When using (or having used) external dbg info, ensure that the folder with the debug info is not left behind/outdated (IIRC a folder with psym in the name)

I tested this on a Mac, that I had on loan. Currently I do not have a Mac for testing.

---
What you mean by "without, the debugger"
Without any debugger, or with the lldb without fpdebug?

Reply by email

C Western
to Martin Frb
Martin Frb wrote 41 lines
On 16/10/2018 23:23, C Western via Lazarus wrote: > On 14/10/2018 20:09, Martin Frb via Lazarus wrote: >> >> - Go to Tools > Options > Debugger >>   In the "debugger type" dropdown, you should find and select "LLDB >> debugger (with fpdebug)" >>   The edit below this (where you normally have the path to gdb), >> should be changed to the path of lldb. >>   (lldb comes with the tools from apple; and as such it is already >> codesigned by apple). >> > Did you mean the option "(with fpdebug)"? Trying with this option > lazarus throws an exception trying to open a .o file that exists - I > can't immediately see why it is throwing the exception. It doesn't > seem to reach the stage of starting the program. If I try it without, > the debugger seems to be working OK, at least at first glance. Depending on which of the LazDebugger...LLDB package(s) you installed, you should have one or two entries:   "LLDB Debugger (Alpha)"   "LLDB Debugger (with fpdebug) (Alpha)" The 2nd one should be the better one. The first (without fpdebug), will accept/display watches in C style only, and has had way less testing. If you get an error, please provide the stacktrace (if you have), together with console output, and logfile. Please also test with and without "external debug info". When using (or having used) external dbg info, ensure that the folder with the debug info is not left behind/outdated (IIRC a folder with psym in the name) I tested this on a Mac, that I had on loan. Currently I do not have a Mac for testing. --- What you mean by "without, the debugger" Without any debugger, or with the lldb without fpdebug?

Using "LLDB Debugger (Alpha)" seems to give me working debugging.

This was with current trunk fpc and lazarus.

This was not with "external debug info". I will post some output when I have a chance.

Colin

Reply by email

C Western
to C Western

I have identified the issue. It seems that fpdebug opens all the object files associated with the project, and keeps them open. For the project I was working on this results in 700 or so open files in lazarus, and it seems the default system limit is 256. Awkwardly it is not clear how to change this; putting (say) "ulimit -n 6000" in .profile changes it in the terminal window, and the debugger then runs OK if lazarus is started from the terminal window, but if startlazarus is used the limit for lazarus

Reply by email