* * *

Author Topic: New debugger for Mac based on lldb (Call for testers)  (Read 595 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4802
    • wiki
New debugger for Mac based on lldb (Call for testers)
« on: October 14, 2018, 09:05:00 pm »
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.

Code: Pascal  [Select]
  1. /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
  2.  

Attach the log file after reproducing the error.
« Last Edit: October 14, 2018, 09:27:49 pm by Martin_fr »

dbannon

  • Sr. Member
  • ****
  • Posts: 305
Re: New debugger for Mac based on lldb (Call for testers)
« Reply #1 on: October 15, 2018, 03:10:30 am »
Martin, forgive my ignorance, I am unsure of how gdb / LLdb interact with heaptrc.

Specifically about memory leaks, will using LLdb give me the same sort of info on the Mac I am used to getting on Linux ?

Even if not, this is an astounding step forward. We loose so many potential Mac user who just read through those code signing instructions and shake their heads sadly...

Davo
Lazarus 1.8, Linux (and reluctantly Win10, OSX)

Cyrax

  • Hero Member
  • *****
  • Posts: 608
Re: New debugger for Mac based on lldb (Call for testers)
« Reply #2 on: October 15, 2018, 12:19:58 pm »
GDB/lldb have nothing to do with heaptrc functionality. Heaptrc uses compiler generated debug info to display the lines and their numbers where the leak happened.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4802
    • wiki
Re: New debugger for Mac based on lldb (Call for testers)
« Reply #3 on: October 15, 2018, 01:08:09 pm »
Heaptrc, works without the debugger.

GDB/LLDB is for setting breakpoints, single stepping, inspecting variables.

The LLDB based does not yet have all the features. E.G. "step to cursor" does not yet work. And the disassembler may not always work.

As for properties (with getter function): They can not be watched, same as under gdb.

josh

  • Hero Member
  • *****
  • Posts: 631
Re: New debugger for Mac based on lldb (Call for testers)
« Reply #4 on: October 15, 2018, 02:30:36 pm »
Hi

Had a quick look and did not see a folder for mac osx x86_64 to test? Just OSXi386

Am I missing something?
Development Installation Lazarus 1.3, FPC 2.7.1,Windows 7/8 32/64, OSX, *nix

Test Environment Lazarus & FPC Trunk on Windows and OSX (Cocoa Mainly on OSX). Testing also Crosscompile windows to OSX.. 
Any posts made from 2015 will be based on Lazarus Trunk.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4802
    • wiki
Re: New debugger for Mac based on lldb (Call for testers)
« Reply #5 on: October 15, 2018, 03:25:16 pm »
Had a quick look and did not see a folder for mac osx x86_64 to test? Just OSXi386

Am I missing something?

Not really related to the debugger, you may want to follow this up on the RC announcment. http://forum.lazarus-ide.org/index.php/topic,42868.0.html

Afaik currently only carbon is pre-build. cocoa (64bit) is still alpha/beta.
But I believe (not sure) that the fpc package installs both, 64 and 32 bit. Then you can rebuild the IDE for 64 bit.

The debugger should work for both 64 and 32 bit. (As long as Apple does not remove 32bit support from lldb)

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus