Recent

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

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4949
    • wiki
Re: New debugger for Mac based on lldb (Call for testers)
« Reply #60 on: December 06, 2018, 06:22:47 pm »
It seems that unchecking "Use Application Bundle" in Project Options breaks debugger. Is this a known bug? Or should I check it deeper?
No, not known. Please provide a log.

How exactly does the "break" manifest? What error is displayed, or what feature stops working.

Does it work or break with a simple program? (Just one pas file)

Are you testing with:
RC2
fixes2_0 branch svn
trunk svn
?


carl_caulkett

  • Sr. Member
  • ****
  • Posts: 258
Re: New debugger for Mac based on lldb (Call for testers)
« Reply #61 on: December 07, 2018, 09:52:34 pm »
I've installed Lazarus v2.0.0RC2 and have got the LLDB debugger working there. I've also installed separately v2.1.0 r59743 from SVN and built using the Cocoa widget set. I cannot find the option for LLDB in the options there. Is this expected behaviour?
macOS 10.14.1
Lazarus 2.0.0RC2 Carbon / Lazarus 2.1.0 r59743 Cocoa
FPC 3.0.4

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 258
Re: New debugger for Mac based on lldb (Call for testers)
« Reply #62 on: December 07, 2018, 10:00:33 pm »
Sorry! My mistake! In my eagerness I forgot what I did last night and forgot to install the LazDebuggerFpLLdb package. Seems to be working fine now.
« Last Edit: December 07, 2018, 10:02:38 pm by carl_caulkett »
macOS 10.14.1
Lazarus 2.0.0RC2 Carbon / Lazarus 2.1.0 r59743 Cocoa
FPC 3.0.4

Arvur

  • New member
  • *
  • Posts: 23
    • My GitHub
Re: New debugger for Mac based on lldb (Call for testers)
« Reply #63 on: December 10, 2018, 02:49:27 pm »
It seems that unchecking "Use Application Bundle" in Project Options breaks debugger. Is this a known bug? Or should I check it deeper?
No, not known. Please provide a log.

I didn't manage to reproduce it on a simple project.

Lazarus RC2, Mac OS Mojave (10.14.1), dwarf2 debug info, cleanup and build before run.
No error when I turn off bundle option, it just shows me Assembler window. So I supposed debug info cannot be found.
But... If I press Run to continue, Assembler window stucks to the same address point (938B7284 : 8b 50 04 movl 0x4(%eax), %edx).

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4949
    • wiki
Re: New debugger for Mac based on lldb (Call for testers)
« Reply #64 on: December 10, 2018, 03:23:59 pm »
Try to get a log file (see 1st message of this thread)

Stepping, Running, Stopping, are done by lldb. If lldb can not handle that situation, then there is probably nothing that can be done to fix it.

If you do change between app-bundle / no app-bundle, then make sure the old app bundle is no longer there. (The same, if you had compiled with external debug info, and change to none external, ensure the old external info is deleted).
If you have such remains, the debugger (both lldb, which for that part is outside our control / and fpdebug in the IDE) may find the old left overs. And that may cause hick ups.
(lldb may (?) give warnings, and they may show in the logfile).

Please also note, that once compiled, you must not touch any of the .o files that are in the project's and packages' lib directories. The debugger (lldb and fpdebug) will read those. They must match what is in the exe.

You may be able to notice this, if you try to debug the IDE itself within the IDE.
If you build the IDE with extra options (Tools menu), and then open the ide/lazarus.lpi and select Run. The project may get compiled again, but without the final linking (because the IDE project is setup specially). So the .o files will then be newer than the exe. (But the debug info might still match, IF the opt level, or other code generating related flags (asserts, range checks ...) have NOT changed.
If you run the IDE from console (or tail the logfile) you should see warnings in this case.
But then this case should not happen with normal projects.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4949
    • wiki
Re: New debugger for Mac based on lldb (Call for testers)
« Reply #65 on: December 11, 2018, 01:22:24 pm »
You can also try to compile with -godwarfcpp

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4949
    • wiki
Re: New debugger for Mac based on lldb (Call for testers)
« Reply #66 on: December 12, 2018, 11:44:47 pm »
Could those on trunk please update to revision 59812

rev 59811: This enables capturing debug history.
 if you think it affects the speed of continuous stepping (repeated F7/F8), compile with -dLLDB_SKIP_IDLE
 if you have issues stepping (F8) over (ignored) exceptions, or stepping from raise to except/finally-block then try -dLLDB_SKIP_SNAP

Note: independent of this rev, stepping from raise to except/finally-block will always visually stop at the last statement before except. even though it is on except. (or finally)


rev 59812: some startup processing moved to thread. On very large apps this may lead to slightly faster start up.
  no side effects expected

Please let me know if those work well for you.
« Last Edit: December 13, 2018, 12:12:17 am by Martin_fr »