Recent

Author Topic: Debugger not working (lldb) / app does not start / no errors reported  (Read 4789 times)

MISV

  • Hero Member
  • *****
  • Posts: 783
I updated Lazarus yesterday due to other problems

In Tools -> Options -> Debugger I have selected LLDB (Alpha)

However - when I try run my program it never comes up. Lazarus writes "(debugging ...)" in its title but nothing happens.

I started Lazarus using "startlazarus"

My project options - compiler options - debugging has:
* Checked option to generate debugging info for GDB (maybe wrong when using LLDB? But does it hurt?)
* Type of debug info: Dwarf with sets (-gw -godwarfsets)

No errors are reported... It just like hangs


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger not working (lldb) / app does not start / no errors reported
« Reply #1 on: January 30, 2019, 02:35:16 pm »
I updated Lazarus yesterday due to other problems
Updated to which version?

Quote
My project options - compiler options - debugging has:
* Checked option to generate debugging info for GDB (maybe wrong when using LLDB? But does it hurt?)
* Type of debug info: Dwarf with sets (-gw -godwarfsets)
That is the correct setting. LLDB and GDB both use dwarf. The caption needs updating.

Quote
No errors are reported... It just like hangs

1) Does it run, if you do "Run" => "Run without debugging"!

2) 32 or 64 bit? Same bitness as the IDE, or cross compiled?
(IIRC debugging 64/32 cross compile requires fixes branch past rc3)

3) GUI or console app?
I assume GUI. Is the option to create a bundle set?

Does your app do any write(ln) to console, that may fail if stdout is closed?
(I do not know if redirecting stdout under debugger works)

4) Can you produce a log?
http://forum.lazarus-ide.org/index.php/topic,42869.0.html

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger not working (lldb) / app does not start / no errors reported
« Reply #2 on: January 30, 2019, 02:39:00 pm »
In Tools -> Options -> Debugger I have selected LLDB (Alpha)

Not related to your problem, but any reason why you do not use the "lldb (with fpdebug / beta)"?

Well yes, it still has issues in rc3, but should be good in very latest fixes.

It should make watches much more user friendly.


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger not working (lldb) / app does not start / no errors reported
« Reply #3 on: January 30, 2019, 02:41:18 pm »
If the IDE itself hands or misbehave after trying to debug, then please try the advice from this post: http://forum.lazarus-ide.org/index.php/topic,42869.msg309550.html#msg309550

MISV

  • Hero Member
  • *****
  • Posts: 783
Re: Debugger not working (lldb) / app does not start / no errors reported
« Reply #4 on: January 30, 2019, 02:59:56 pm »
FPC 3.0.4 + Lazarus v2.1.0 r60244M x76_64-darwin-cocoa (alpha)

I can not select "lldb (with fpdebug / beta)" - it is not in the dropdown list in "Debugger" options ... Should there be another option?

Yes, app runs fine when using "Run without debugging" - it is 64bit Cocoa app

GUI - not doing anything console output

I do not recall having seen any option called "bundle set", but I do have a info.plist file in the .app file. (Been working fine earlier.)

Will look into adding log / viewing the link you posted

MISV

  • Hero Member
  • *****
  • Posts: 783
Re: Debugger not working (lldb) / app does not start / no errors reported
« Reply #5 on: January 30, 2019, 03:07:50 pm »
Installing LazDebuggerFpLldb and switching to that did not help... It still just hangs... But I will try restart... See if that maybe helps

Would it help diagnosing/troubleshooting the problem is I run it from command line?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger not working (lldb) / app does not start / no errors reported
« Reply #6 on: January 30, 2019, 03:09:29 pm »
I can not select "lldb (with fpdebug / beta)" - it is not in the dropdown list in "Debugger" options ... Should there be another option?
Install the package components/lazdebuggers/lazdebuggerFpLldb

Quote
I do not recall having seen any option called "bundle set", but I do have a info.plist file in the .app file. (Been working fine earlier.)
If it works without debugging, it is probably set. Project Options > Application: bottom of the page "for MacOS"


One more. Try with/without -Xg (external debug info)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger not working (lldb) / app does not start / no errors reported
« Reply #7 on: January 30, 2019, 03:10:49 pm »
Would it help diagnosing/troubleshooting the problem is I run it from command line?

The IDE outputs some info, if you have a command line. But if you use --debug-log (as in the referenced post) then it all goes to the log file.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger not working (lldb) / app does not start / no errors reported
« Reply #8 on: January 30, 2019, 03:11:48 pm »
One more question.

When you started the debugger. Use ps or top, to see if your app is in memory.


---
Also, try with a new empty app.

MISV

  • Hero Member
  • *****
  • Posts: 783
Re: Debugger not working (lldb) / app does not start / no errors reported
« Reply #9 on: January 30, 2019, 03:29:55 pm »
- Restart did not help.

- I have checked Project Options > Application: bottom of the page "for MacOS"

- Using Top(maximized) and "Activity Monitor" did not reveal my app is running. (GDB seems to be running though? with parent process being Lazarus?) ... Forcing quit triggers Lazarus dialog about debugger error state

- New... New application... Prompted for enabled dwarf2 with sets (yes) - prompted for bundle (yes) ... And this also does not start

...

I think the problem is Lazarus is starting GDB and not LLDB ... just tried forcing quit GDB and run new project ... And again I can see GDB pop up...

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger not working (lldb) / app does not start / no errors reported
« Reply #10 on: January 30, 2019, 03:33:45 pm »
Tools > Options > Debugger.

Below the drop down under "Debugger type and path" is an edit field. (NOT "additional search path", above that).

This edit must have the path to lldb. usually
/usr/bin/lldb

MISV

  • Hero Member
  • *****
  • Posts: 783
Re: Debugger not working (lldb) / app does not start / no errors reported
« Reply #11 on: January 30, 2019, 11:39:41 pm »
You are right... That works. Somehow I missed that. (Doh!)

 Thank you :)

MISV

  • Hero Member
  • *****
  • Posts: 783
Re: Debugger not working (lldb) / app does not start / no errors reported
« Reply #12 on: April 23, 2019, 11:53:45 am »
I seem to be experiencing this problem again - Lazarus stalls when debugging but running without debugging works:

Tools:Options:Debugger: LLDB Debugger (with fpdebug) (Beta)
Tools:Options:Debugger: /usr/bin/lldb (file is there)
Project:Options:Compiler options:Debugging:Generate debugging info = checked
Project:Options:Compiler options:Debugging:Type of debug info = Dwarf with sets (-gw -godwarfsets)
Project:Options:Compiler options:Custom Options: -WM10.8
Project:Options:Compiler options:Applications and Override: -vd -va LCLWidgetType:=cocoa -FD/Library/Developer/CommnadLineTools/usr/bin
Project:Options:Project Settings:Application:Use Application Bundle for running and debugging
Custom Options: -WM10.8

Mojave 10.14.4
Lazarus IDE: 2.1.0 r60244M

« Last Edit: April 23, 2019, 12:15:53 pm by MISV »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki

 

TinyPortal © 2005-2018