* * *

Author Topic: macOS Sierra - Debugging not working  (Read 24978 times)

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 556
Re: macOS Sierra - Debugging not working
« Reply #45 on: December 07, 2016, 11:52:33 am »
It has been fixed in the current git version of gdb. The required change doesn't seem to have been picked up yet by macports though. I don't know about fink.

xaver13

  • Jr. Member
  • **
  • Posts: 79
Solved : macOS Sierra - Debugging not working
« Reply #46 on: December 11, 2016, 09:57:12 am »
I have very much troubles with it and later I recognise that restart computer is needed - like in this link http://stackoverflow.com/questions/13913818/how-to-get-a-codesigned-gdb-on-osx
--
Jiri Cvrk

MISV

  • Full Member
  • ***
  • Posts: 244
Re: macOS Sierra - Debugging not working
« Reply #47 on: January 27, 2017, 12:14:35 am »
Any news on recommended solution for this? I am still using Lazarus 1.4.4 / homebrew (but can upgrade/change both if necessary)

i.e. is there now an easy way to get a signed gdb through homebrew or macports which will "just work". It is a pitty Mac changes dev tools all the time :(

Phil

  • Hero Member
  • *****
  • Posts: 2324
Re: macOS Sierra - Debugging not working
« Reply #48 on: January 27, 2017, 12:21:38 am »
It is a pitty Mac changes dev tools all the time :(

The supported debugger on OS X has been lldb for some years. gdb was put out to pasture a long time ago.



Jonas Maebe

  • Hero Member
  • *****
  • Posts: 556
Re: macOS Sierra - Debugging not working
« Reply #49 on: January 27, 2017, 05:35:42 pm »
Any news on recommended solution for this? I am still using Lazarus 1.4.4 / homebrew (but can upgrade/change both if necessary)
gdb 7.12.1 was just released, and it contains the necessary patches to support debugging on macOS 10.12/Sierra. If you can get fink and/or MacPorts to upgrade to that version, it should work. You do currently have give the gdb command "set startup-with-shell off" before you can launch programs and debug them on macOS 10.12/Sierra.

MISV

  • Full Member
  • ***
  • Posts: 244
Re: macOS Sierra - Debugging not working
« Reply #50 on: January 30, 2017, 01:33:29 pm »
I will try - will need debugging functionality soon

tshahzad

  • New member
  • *
  • Posts: 9
Re: macOS Sierra - Debugging not working
« Reply #51 on: February 15, 2017, 02:05:36 pm »
Is there any plan to implement lldb for Lazarus. GDB will always create issues in newer versions of OSX.

Thanks, Tauseef

Phil

  • Hero Member
  • *****
  • Posts: 2324
Re: macOS Sierra - Debugging not working
« Reply #52 on: February 15, 2017, 04:33:19 pm »
Is there any plan to implement lldb for Lazarus.

I doubt it. It looks as though the plan from about 3 years ago was to replace gdb entirely on Mac. See item 2 here:

http://lazarus-dev.blogspot.com/2014/05/de-bug-wars-new-hope.html

I don't know anything about the status of that effort.

Note that you _can_ debug now with lldb. Just run it from the command line:

  lldb yourapp.app

Here's the equivalent lldb command:

http://lldb.llvm.org/lldb-gdb.html

Also, it is possible to debug a Lazarus project with lldb within Xcode. It requires creating a little dummy Xcode project, but it is possible.

Hansaplast

  • Sr. Member
  • ****
  • Posts: 288
  • Tweaking4All.com
    • Tweaking4All
Re: macOS Sierra - Debugging not working
« Reply #53 on: March 26, 2017, 07:08:52 pm »
Any news on recommended solution for this? I am still using Lazarus 1.4.4 / homebrew (but can upgrade/change both if necessary)
gdb 7.12.1 was just released, and it contains the necessary patches to support debugging on macOS 10.12/Sierra. If you can get fink and/or MacPorts to upgrade to that version, it should work. You do currently have give the gdb command "set startup-with-shell off" before you can launch programs and debug them on macOS 10.12/Sierra.


This worked for me as well, however adding "set startup-with-shell off" to ~/.gdbinit didn't work. Instead I added this to the "Debugger_Startup_option" in Lazarus in the "Options" - "Debugger" - "General" window:
[/size]
  "--eval-command=set startup-with-shell off"


(including the double quotes!!!)
This does display a message each time I run a project, but it works (incl. break points and such).

MISV

  • Full Member
  • ***
  • Posts: 244
Re: macOS Sierra - Debugging not working
« Reply #54 on: March 28, 2017, 08:39:11 pm »
I still can not get it working :(


I have Lazarus 1.6.4 on MacOS Sierra 10.12.3

I today installed MacPorts https://www.macports.org/install.php and through that gdb by "sudo port install gdb"

I rebooted after initial failure

I then in  Lazarus > Tools > Options > Debugger > Debugger_Startup_Options  added this with quotes "--eval-command=set startup-with-shell off"

Two new hings happened
1) I got the message:
Quote
Initialization output: =cmd-param-changed,param="startup-with-shell",value="off"
2) I got prompted for  password

Quote
But in the end I get the same debugger error on startup:
 The GDB command:
"-exec-run"
returned the error:
",msg="During statup program terminated with signal SIG113, Real-time event 113""

I am right now looking at:
http://stackoverflow.com/questions/33162757/how-to-install-gdb-debugger-in-mac-osx-el-capitan

« Last Edit: March 28, 2017, 08:44:23 pm by MISV »

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 556
Re: macOS Sierra - Debugging not working
« Reply #55 on: March 28, 2017, 08:41:23 pm »
According to https://github.com/macports/macports-ports/blob/master/devel/gdb/Portfile , MacPorts still has gdb 7.12 while you need 7.12.1 for macOS 10.12

MISV

  • Full Member
  • ***
  • Posts: 244
Re: macOS Sierra - Debugging not working
« Reply #56 on: March 28, 2017, 08:52:24 pm »
Thanks! maybe I misunderstood other posts here.

Is there any automated system on Mac (i.e. like MacPorts, HomeBrew etc.) that can handle installing GDB and which has 7.12.1 or newer? Otherwise I guess I will try a more manual approach

--update--

fink should have it: http://pdb.finkproject.org/pdb/browse.php?summary=gdb

brew should http://braumeister.org/formula/gdb

--brew help--

When I tred write "brew install gdb" it claimed I already got newest version 7.8.1 of gdb (this was after running "brew update" )

Solution: Unlink old version first

I have now also signed using:
Code: Pascal  [Select]
  1. codesign -s gdb-cert  /usr/local/Cellar/gdb/7.12.1/bin/gdb

--This combination seems to work for me--
« Last Edit: March 29, 2017, 11:37:07 am by MISV »

Hansaplast

  • Sr. Member
  • ****
  • Posts: 288
  • Tweaking4All.com
    • Tweaking4All
Re: macOS Sierra - Debugging not working
« Reply #57 on: March 28, 2017, 09:23:39 pm »
FYI: I'm using 7.12.1 as well, through HomeBrew, and the problem remains, even though others seem to have had success with this.
I described the steps I followed here.


Adding the "--eval-command=set startup-with-shell off" to Lazarus > Tools > Options > Debugger > Debugger_Startup_Options resolved it for me.


Adding "set startup-with-shell off" (without the quotes) to ~/.gdbinit did not seem to work on my setup.

tigerA15

  • New member
  • *
  • Posts: 17
Re: macOS Sierra - Debugging not working
« Reply #58 on: April 21, 2017, 05:43:32 pm »
Thanks! maybe I misunderstood other posts here.

Is there any automated system on Mac (i.e. like MacPorts, HomeBrew etc.) that can handle installing GDB and which has 7.12.1 or newer? Otherwise I guess I will try a more manual approach

--update--

fink should have it: http://pdb.finkproject.org/pdb/browse.php?summary=gdb

brew should http://braumeister.org/formula/gdb

--brew help--

When I tred write "brew install gdb" it claimed I already got newest version 7.8.1 of gdb (this was after running "brew update" )

Solution: Unlink old version first

I have now also signed using:
Code: Pascal  [Select]
  1. codesign -s gdb-cert  /usr/local/Cellar/gdb/7.12.1/bin/gdb

--This combination seems to work for me--
marked & thanks .

 

Recent

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