Recent

Author Topic: gbd on Mavericks.... so close....  (Read 11151 times)

JimKueneman

  • Full Member
  • ***
  • Posts: 246
gbd on Mavericks.... so close....
« on: November 19, 2013, 02:19:30 am »
I followed the direction here:

http://wiki.freepascal.org/GDB_on_OS_X_Mavericks_and_Xcode_5

All went as planned.... except

Quote
The GDB command:
"-exec-run"
returned the error:
",msg="Unable to find Mach task port for process-id 451: (os/kern) failure (0x5).\n (please check gdb is codesigned - see taskgated(8))""

It seems like it is signed so what could be wrong?

Quote
Jim-iMac:python jimkueneman$ codesign -vvv /usr/local/bin/gdb
/usr/local/bin/gdb: valid on disk
/usr/local/bin/gdb: satisfies its Designated Requirement

Tools->Options>Debugger->Debugger Path = /usr/local/bin/gdb

I do notice that this gdb file is a hardlink to the actual executable that homebrew compiled.

Jim

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: gbd on Mavericks.... so close....
« Reply #1 on: November 19, 2013, 02:46:17 pm »
could you please try to "sudo" lazarus?

JimKueneman

  • Full Member
  • ***
  • Posts: 246
Re: gbd on Mavericks.... so close....
« Reply #2 on: November 20, 2013, 11:36:49 am »
Hi,

   No go.  I ran

Quote
sudo open lazarus.app

same error:

Quote
The GDB command:
"-exec-run"
returned the error:
",msg="Unable to find Mach task port for process-id 1121: (os/kern) failure (0x5).\n (please check gdb is codesigned - see taskgated(8))""

Jim

JimKueneman

  • Full Member
  • ***
  • Posts: 246
Re: gbd on Mavericks.... so close....
« Reply #3 on: November 21, 2013, 02:12:17 pm »
Any other thought what I can do?  If anyone is willing I am willing to run remote access of my iMac to try to figure this out. I am not well versed in OSX's internals so I am helpless. This will be a real roadblock for Lazarus on a Mac if this is an issue.

Thanks,
Jim

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12706
  • FPC developer.
Re: gbd on Mavericks.... so close....
« Reply #4 on: November 21, 2013, 02:59:42 pm »
Try to run GDB directly, then use the new gatekeeper exceptions dialog described Here to forcedly allow the last run blocked application.

sysrpl

  • Sr. Member
  • ****
  • Posts: 315
    • Get Lazarus
Re: gbd on Mavericks.... so close....
« Reply #5 on: November 21, 2013, 04:31:53 pm »
I have Mavericks installed and was able to setup debugging using macports:

curl https://distfiles.macports.org/MacPorts/MacPorts-2.2.1-10.9-Mavericks.pkg -o macports.pkg
sudo installer -pkg macports.pkg -target /
sudo port install gdb

The debugger will then be located at:

/opt/local/bin/ggdb

You will need to sign ggdb using the steps provided here:

http://www.opensource.apple.com/source/lldb/lldb-69/docs/code-signing.txt

Substitute ggdb for lldb and it should work.

JimKueneman

  • Full Member
  • ***
  • Posts: 246
Re: gbd on Mavericks.... so close....
« Reply #6 on: November 22, 2013, 01:43:40 pm »
Quote
Try to run GDB directly, then use the new gatekeeper exceptions dialog described Here to forcedly allow the last run blocked application

Ok I ran:

Quote
open /usr/local/bin/gdb

and gdb opened right up:

Quote
Last login: Wed Nov 20 03:32:16 on ttys005
Jim-iMac:~ jimkueneman$ /usr/local/Cellar/gdb/7.6.1/bin/gdb ; exit;
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin13.0.0".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb)

I run Lazarus and hit the Run button and I get this:

Quote
The GDB command:
"-exec-run"
returned the error:
",msg="Unable to find Mach task port for process-id 2406: (os/kern) failure (0x5).\n (please check gdb is codesigned - see taskgated(8))""

I am lost...

sysrpl :
  I think the home-brew compile and signing did everything that macports would do.  gdb is compiled and will run off the command line but not through Lazarus.

BTW I am running the release candidate for 1.2.

Not sure if this is of any help but here is the console logging if I try to compile and run the debugger:

Quote
Free Pascal Compiler version 2.6.2 [2013/02/03] for i386
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Darwin for i386
Compiling OLCB_Commander.lpr
OLCB_Commander.lpr(10,62) Hint: Unit "file_utilities" not used in OLCB_Commander
OLCB_Commander.lpr(11,56) Hint: Unit "common_utilities" not used in OLCB_Commander
OLCB_Commander.lpr(12,3) Hint: Unit "olcb_node" not used in OLCB_Commander
OLCB_Commander.lpr(12,14) Hint: Unit "com_port_hub" not used in OLCB_Commander
OLCB_Commander.lpr(12,28) Hint: Unit "form_thread_debug" not used in OLCB_Commander
OLCB_Commander.lpr(12,47) Hint: Unit "form_config_mem_viewer" not used in OLCB_Commander
OLCB_Commander.lpr(13,3) Hint: Unit "common_objects" not used in OLCB_Commander
OLCB_Commander.lpr(13,19) Hint: Unit "form_awesome_throttle" not used in OLCB_Commander
OLCB_Commander.lpr(13,42) Hint: Unit "form_awesome_throttle_deallocate_error" not used in OLCB_Commander
OLCB_Commander.lpr(14,3) Hint: Unit "form_awesome_throttle_duplicate_address" not used in OLCB_Commander
OLCB_Commander.lpr(14,44) Hint: Unit "form_train_config_editor" not used in OLCB_Commander
OLCB_Commander.lpr(15,3) Hint: Unit "unit_cdi_parser" not used in OLCB_Commander
OLCB_Commander.lpr(15,20) Hint: Unit "olcb_defines" not used in OLCB_Commander
OLCB_Commander.lpr(16,25) Hint: Unit "ethernet_hub" not used in OLCB_Commander
Assembling (pipe) /Users/jimkueneman/Documents/openlcb/trunk/scratchpads/jkueneman/OlcbCommander/lib/i386-darwin/OLCB_Commander.s
Compiling resource /Users/jimkueneman/Documents/openlcb/trunk/scratchpads/jkueneman/OlcbCommander/lib/i386-darwin/OLCB_Commander.or
Linking /Users/jimkueneman/Documents/openlcb/trunk/scratchpads/jkueneman/OlcbCommander/Compiled_Binaries/i386-darwin/OlcbCommander
30 lines compiled, 3.8 sec
16 hint(s) issued
[TCompiler.Compile] end
TMainIDE.DoInitProjectRun ProgramFilename=/Users/jimkueneman/Documents/openlcb/trunk/scratchpads/jkueneman/OlcbCommander/Compiled_Binaries/i386-darwin/OlcbCommander
[TCmdLineDebugger] Debug PID: 2517
[TMainIDE.DoRunProject] Debugger=TGDBMIDebugger
[TMainIDE.DoRunProject] END
TGDBMIDebugger.StartDebugging WorkingDir="/Users/jimkueneman/Documents/openlcb/trunk/scratchpads/jkueneman/OlcbCommander/Compiled_Binaries/i386-darwin/"
TCarbonBitBtn.SetFocus Error: SetKeyboardFocus  failed with result -30585

Then the Debugger Error dialog pops up.
« Last Edit: November 22, 2013, 02:03:19 pm by JimKueneman »

JimKueneman

  • Full Member
  • ***
  • Posts: 246
Re: gbd on Mavericks.... so close....
« Reply #7 on: November 23, 2013, 03:58:21 am »
Arrrggggg....  I missed this:

Quote
open the “Trust” item, and set “Code Signing” to “Always Trust”.

For others this took me a while to find...

http://www.mustangpeak.net/ggdb_on_mavericks.png

Feel free to add this image to the Mavericks/XCode 5 page...

Jim

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: gbd on Mavericks.... so close....
« Reply #8 on: November 23, 2013, 07:16:57 am »
good to know.

So even though gdb was signed, the certificate was not trusted enough.

JimKueneman

  • Full Member
  • ***
  • Posts: 246
Re: gbd on Mavericks.... so close....
« Reply #9 on: November 23, 2013, 01:21:20 pm »
Correct, "Use System Defaults" was not trusted enough.  I also removed home-brew and used MacPorts but I am sure what fixed it was this as the MacPorts build of ggdb had the same problem until I changed it to Always Trust.

Jim

danysz

  • Newbie
  • Posts: 1
Re: gbd on Mavericks.... so close....
« Reply #10 on: March 26, 2014, 08:02:09 am »
For me is still not working and the certificate is signed "always trust"
I just have gdb 7.7

 

TinyPortal © 2005-2018