Recent

Author Topic: gdb problem  (Read 4327 times)

Clemens

  • New Member
  • *
  • Posts: 21
gdb problem
« on: June 04, 2016, 06:31:24 pm »
Hi!

I installed gdb via MacPorts (/opt/local/bin/ggdb and gdb-apple).  I signed the two binaries.

Code: Pascal  [Select]
  1. $ codesign -s "gdb certificate" /opt/local/bin/ggdb
  2. /opt/local/bin/ggdb: is already signed

Then I try to use gdb on the command line:

Code: Pascal  [Select]
  1. $ ggdb ./test
  2. GNU gdb (GDB) 7.9.1
  3. [...]
  4. (gdb) run
  5. Starting program: /Users/Clemens/Languages/Free Pascal/test/test
  6. Unable to find Mach task port for process-id 1126: (os/kern) failure (0x5).
  7.  (please check gdb is codesigned - see taskgated(8))
  8. (gdb) quit

The error is unexpected, since codesigned seems to have worked.  Any ideas?  Is there anything else I have to do before using ggdb or gdb-apple?  Needless to say, gdb also doesn't work in Lazarus.

Cheers,
Clemens

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7931
Re: gdb problem
« Reply #1 on: June 04, 2016, 06:36:14 pm »
which ggdb

?

Clemens

  • New Member
  • *
  • Posts: 21
Re: gdb problem
« Reply #2 on: June 05, 2016, 12:12:08 pm »
There are two gdb versions available in MacPorts.  Same problem with both.

Code: Pascal  [Select]
  1. $ ggdb --version
  2. GNU gdb (GDB) 7.9.1
  3. Copyright (C) 2015 Free Software Foundation, Inc.
  4. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  5. This is free software: you are free to change and redistribute it.
  6. There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  7. and "show warranty" for details.
  8. This GDB was configured as "x86_64-apple-darwin15.3.0".
  9. Type "show configuration" for configuration details.
  10. For bug reporting instructions, please see:
  11. <http://www.gnu.org/software/gdb/bugs/>.
  12. Find the GDB manual and other documentation resources online at:
  13. <http://www.gnu.org/software/gdb/documentation/>.
  14. For help, type "help".
  15. Type "apropos word" to search for commands related to "word".

Code: Pascal  [Select]
  1. $ gdb-apple --version
  2. GNU gdb 6.3.50.20050815-cvs (Sun Jan 31 06:40:33 UTC 2016)
  3. Copyright 2004 Free Software Foundation, Inc.
  4. GDB is free software, covered by the GNU General Public License, and you are
  5. welcome to change it and/or distribute copies of it under certain conditions.
  6. Type "show copying" to see the conditions.
  7. There is absolutely no warranty for GDB.  Type "show warranty" for details.
  8. This GDB was configured as "--host=i686-apple-darwin15.3.0 --target=".

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 690
Re: gdb problem
« Reply #3 on: June 13, 2016, 04:19:12 pm »
The error is unexpected, since codesigned seems to have worked.  Any ideas?  Is there anything else I have to do before using ggdb or gdb-apple?  Needless to say, gdb also doesn't work in Lazarus.
I've just significantly updated the official gdb wiki page on code signing, and added a troubleshooting section. Please follow that troubleshooting section to see whether it can resolve your problem.

Clemens

  • New Member
  • *
  • Posts: 21
Re: gdb problem
« Reply #4 on: June 14, 2016, 06:23:15 pm »
Thanks, Jonas.   :)

My binaries were owned by procmod, and these commands did the trick:
Code: Pascal  [Select]
  1. $ sudo chmod 755 gdb
  2. $ sudo chgrp admin gdb

I get warnings in the beginning that there are timeouts.  Other than that, it seems to work as far as I can tell so far.

JonRobertson

  • Newbie
  • Posts: 1
Re: gdb problem
« Reply #5 on: August 13, 2016, 06:33:46 am »
I've just significantly updated the official gdb wiki page on code signing, and added a troubleshooting section.
Jonas,

I came across this post while trying to solve an issue getting ggdb installed/codesigned.  I just wanted to give a big "Thanks!" for the gdb wiki page.  Pass along thanks to anyone else the contributed as well.  I was able to solve my issue with the info in the troubleshooting section.  :)

Jon

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 690
Re: gdb problem
« Reply #6 on: August 13, 2016, 01:33:22 pm »
You're welcome. Glad it helped!