Recent

Author Topic: [FIXED] El Capitan (10.11 beta): GDB no longer usable ...  (Read 18917 times)

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
[FIXED] El Capitan (10.11 beta): GDB no longer usable ...
« on: August 10, 2015, 12:04:54 pm »
I'm running El Capitan (10.11) beta 3 and have noticed that GDB can no longer be used.
So far I had been lucky using an old GDB version from XCode (link), whick still worked with 10.10.

Unfortunately, in 10.11 /usr/bin/ has been made read only, even for root ... even when disabling rootless mode. (HomeBrew users will run into a similar issue, see Apple Stackexchange)

I'm fully aware that I'm running a beta OS, which comes with it's problem for sure.
Maybe somebody knows a fix, maybe not ... and if not; then at least let this a warning before switching to "El Capitan" ... :-)

I assume either a HomeBrew work around is needed, or LLDB support is needed.


Because El Capitan seems to have removed previously installed files fro several /usr/ locations, I cannot even get anything compiled (probably waiting for XCode 7 w/Commandline tools).
« Last Edit: August 15, 2015, 03:16:39 pm by Hansaplast »

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1059
Re: El Capitan (10.11 beta): GDB no longer usable ...
« Reply #1 on: August 10, 2015, 02:10:39 pm »
Unfortunately, in 10.11 /usr/bin/ has been made read only, even for root ...
You should never install something yourself in /usr/bin on any OS X version, it always belonged to the system.

Quote
Maybe somebody knows a fix, maybe not ... and if not; then at least let this a warning before switching to "El Capitan" ... :-)
gdb does not need to be installed in /usr/bin (unless you directly copy the binary from a previous OS version, but that's something which is never supported anyway).

Quote
I assume either a HomeBrew work around is needed, or LLDB support is needed.
HomeBrew by default installs in /usr/local/bin, which is completely different from /usr/bin and which should still be writeable in OS X 10.11.

Quote
Because El Capitan seems to have removed previously installed files fro several /usr/ locations, I
Every OS X update removes the Apple developer tools installed under previous versions from /usr/*, because they are generally not compatible with newer OS X versions. I've never known them to remove things you installed yourself (unless you, wrongly, put them in /usr/bin instead of in /usr/local/bin etc).

Quote
cannot even get anything compiled (probably waiting for XCode 7 w/Commandline tools).
You should probably have a look at the *comments* under the first answer at http://superuser.com/questions/940874/homebrew-doesnt-install-new-apps-in-el-capitan

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: El Capitan (10.11 beta): GDB no longer usable ...
« Reply #2 on: August 10, 2015, 05:31:52 pm »
Thanks Jonas!


Yeah, you're probably right about /usr/bin, just didn't know any easier way to get GDB to work.
I'll read up on the HomeBrew version ... (if I recall correctly, there is a GDB that comes with HomeBrew)

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
[FIXED] El Capitan (10.11 beta): GDB no longer usable ...
« Reply #3 on: August 15, 2015, 03:15:59 pm »
Well, thanks to Jonas, you made me think about "/usr/local/bin" ... I've got a working solution!

I tried HomeBrew and MacPorts, but both failed in El Capitan (they do not support a pre-release OS - which make perfect sense) and I'm not educated enough on the topic to fix it.

I did however manage to get the GDB from XCode 4.x to work again.
Probably not the best or cleanest method, but most certainly the easiest, quickest and a working method.

For this I took the “gdb-i386-apple-darwin” file (in /usr/libexec/gdb) and renamed it to “gdb”. After that I copy it into “/usr/local/bin”, and that works!


Even breakpoints and stepping through code works like a charm.


You can download that version at Tweaking4All, I tried to upload it as an attachment but it failed, and I'm not 100% sure how appropriate that would be.

marcelohalpern

  • New member
  • *
  • Posts: 7
Re: [FIXED] El Capitan (10.11 beta): GDB no longer usable ...
« Reply #4 on: October 06, 2015, 06:01:18 am »
Hey Hansaplast,

I've been trying to use your method to fix the same problem wile compiling with Lazarus / El Capitan.

When running, I get:
Compile Project, Target: project1: Exit code 1, Errors: 1
Fatal: Compilation aborted

Already tried to rename "gdb-i386-apple-darwin" to "gdb" and copy it to “/usr/local/bin”, like you said so, but no success at all (Fatal: Compilation aborted still goes on). Any ideas? Please help.

Thanks,
Halpern

For the record, I'm running:
- OSX 10.11 (15A284) - El Capitan
- XCode7.0.1 (7A1001)
- Command_Line_Tools_OS_X_10.10_for_Xcode_7.1_beta_2
- Lazarus 1.4.2 - FPC V. 2.6.4 i386 - darwin - carbon

herux

  • Full Member
  • ***
  • Posts: 102
Re: [FIXED] El Capitan (10.11 beta): GDB no longer usable ...
« Reply #5 on: October 06, 2015, 08:47:42 am »

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: [FIXED] El Capitan (10.11 beta): GDB no longer usable ...
« Reply #6 on: October 06, 2015, 09:15:24 am »
I've tried MacPorts before, but at the time it did not support El Capitan yet (for obvious reasons).
I do see that MacPorts supports El Capitan now (see: Installing MacPorts).


@marcelohalpern;


I'm not an expert, unfortunately, by the method described worked, and is still working for me.
Is everything working OK with de debugger completely disabled (in Lazarus)?

marcelohalpern

  • New member
  • *
  • Posts: 7
Re: [FIXED] El Capitan (10.11 beta): GDB no longer usable ...
« Reply #7 on: October 12, 2015, 02:07:31 am »
Hey guys,

still can't get it to work.
Already tried to change the debugging to Dwarf 2, such as installing GDB using Macports.

I just don't know whats going on.

Any ideias?
Thanks,
Halpern

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: [FIXED] El Capitan (10.11 beta): GDB no longer usable ...
« Reply #8 on: October 12, 2015, 02:58:04 am »
what is the error message you're getting?

marcelohalpern

  • New member
  • *
  • Posts: 7
Re: [FIXED] El Capitan (10.11 beta): GDB no longer usable ...
« Reply #9 on: October 12, 2015, 03:18:47 am »
Compiling package FCL 1.0.1: Exit code 1, Errors: 1
Fatal: Compilation aborted

thanks!

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: [FIXED] El Capitan (10.11 beta): GDB no longer usable ...
« Reply #10 on: October 12, 2015, 03:20:04 am »
Compiling package FCL 1.0.1: Exit code 1, Errors: 1
Fatal: Compilation aborted
FCL...huh... can you compile a simple "hello world" program from Terminal (without Lazarus)?

marcelohalpern

  • New member
  • *
  • Posts: 7
Re: [FIXED] El Capitan (10.11 beta): GDB no longer usable ...
« Reply #11 on: October 12, 2015, 03:21:17 am »
Not sure If I know how to do that.
Sorry, noob over here.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: [FIXED] El Capitan (10.11 beta): GDB no longer usable ...
« Reply #12 on: October 12, 2015, 03:52:25 am »
sure. Here're some steps.

Open Lazarus.
In the application menu hit "Project ->New Project"
Select "Simple Program"
write the text of the program to look like this:
Code: [Select]
begin
  writeln('hello world');
end.
Save it. Don't compile. (though you can try to!)
Close Lazarus
Open Terminal application (could be under Utilities).
In terminal "cd" to the directory where you saved the project.
There compile the project with FPC (it's likely lazarus will name the project file with .lpr extension)
Code: [Select]
  fpc project1.lpr
See compiler output.

marcelohalpern

  • New member
  • *
  • Posts: 7
Re: [FIXED] El Capitan (10.11 beta): GDB no longer usable ...
« Reply #13 on: October 12, 2015, 04:09:26 am »
This is what I've got.
(the name of the file is Help.pr)

Free Pascal Compiler version 2.6.4 [2014/02/26] for i386
Copyright (c) 1993-2014 by Florian Klaempfl and others
Target OS: Darwin for i386
Compiling Help.lpr
Assembling (pipe) Help.s
Linking Help
ld: warning: object file (Help.o) was built for newer OSX version (10.11) than being linked (10.4)
8 lines compiled, 1.6 sec

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1059
Re: [FIXED] El Capitan (10.11 beta): GDB no longer usable ...
« Reply #14 on: October 12, 2015, 10:35:20 am »
Try updating to Lazarus 1.4.4, it should be fixed there.

 

TinyPortal © 2005-2018