Gdb fails in mountain lion

I tried to compile gxb 7.x version with no luck. I encoded an executable file (http://sourceware.org/gdb/wiki/BuildingOnDarwin).

The next version had these problems.

7.5.7.4, git clone: ​​unknown boot command 0x2a (and others) for my application and various system libraries when gbd starts. When I try to print a vector, for example, I always get: Could not find the frame base for "main (int, char **)"

7.3 (macports and gdb-website): when the application starts, it cannot set a breakpoint and continues to work.

(gdb) start Temporary breakpoint 1 at 0x100000950: file ../src/main.cpp, line 15. Starting program: [...] BFD: unable to read unknown load command 0x24 BFD: unable to read unknown load command 0x2a BFD: unable to read unknown load command 0x26 Error in re-setting breakpoint 1: Cannot access memory at address 0x100000950 [application continues] 

I used the llvm-gcc, gcc4.7 and svn-gcc4.8 systems to compile. Has anyone succeeded in installing gdb on Mountain Lion?

+2
osx-mountain-lion gdb bfd
Aug 21 2018-12-12T00:
source share
4 answers

I installed gdb 7.5 on a mountain lion without any problems ...

  • these steps can help you: ./ configure --prefix = / usr / local --enable-target = x86_64-apple-darwin10 --enable-64-bit-bfd --disable-werror --build = x86_64-apple- darwin10 -host = x86_64-apple-darwin10 --target = x86_64-apple -darwin10

  • then install gdb.

  • create your own certificate as described here and sign gdb http://sourceware.org/gdb/wiki/BuildingOnDarwin

  • you need to explicitly specify: codesign -s gdb-cert / usr / local / gdb before signing gdb, make sure you have already installed the trust certificate. also close the keychain before signing your gdb.

hope this also works for your

+11
Sep 11
source share
— -

I solved this problem by following these steps: http://coding.derkeiler.com/Archive/Ada/comp.lang.ada/2012-09/msg00305.html

Steps

  • sudo chgrp procmod / usr / local / bin / gdb
  • sudo chmod g + s / usr / local / bin / gdb
  • Edit /System/Library/LaunchDaemons/com.apple.taskgated.plist and add the + p argument to the job process
  • force kill the given process (it will restart)
  • Try again

Other links:

+5
Dec 01
source share

this does not work for me ... the same problem as in the default settings of homebrew

 v1:src zeph$ brew install gdb ==> Downloading http://ftpmirror.gnu.org/gdb/gdb-7.5.tar.bz2 Already downloaded: /Library/Caches/Homebrew/gdb-7.5.tar.bz2 ==> ./configure --prefix=/usr/local/Cellar/gdb/7.5 --with-python=/usr --with-system-readline --enable-targets=x86_64-apple-darwin10 --enable-64-bit-bfd --disable-werror --build=x86_64-apple-darwin10 --hos ==> make ==> make install ==> Caveats gdb requires special privileges to access Mach ports. You will need to codesign the binary. For instructions, see: http://sourceware.org/gdb/wiki/BuildingOnDarwin ==> Summary /usr/local/Cellar/gdb/7.5: 62 files, 9.3M, built in 119 seconds v1:src zeph$ codesign -s gdb-cert /usr/local/Cellar/gdb/7.5/bin/gdb v1:src zeph$ /usr/local/Cellar/gdb/7.5/bin/gdb --args /Users/zeph/tmp/CouchBase/src/install/bin/memcached -d -u root -P /tmp/0libmemcached_memc.pid -t 1 -p 11221 -U 11221 -m 128 GNU gdb (GDB) 7.5 Copyright (C) 2012 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-darwin10". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... BFD: /Users/zeph/tmp/CouchBase/src/install/bin/memcached: unknown load command 0x29 BFD: /Users/zeph/tmp/CouchBase/src/install/bin/memcached: unknown load command 0x29 Reading symbols from /Users/zeph/tmp/CouchBase/src/install/bin/memcached...done. (gdb) run Starting program: /Users/zeph/tmp/CouchBase/src/install/bin/memcached -d -u root -P /tmp/0libmemcached_memc.pid -t 1 -p 11221 -U 11221 -m 128 Unable to find Mach task port for process-id 28755: (os/kern) failure (0x5). (please check gdb is codesigned - see taskgated(8)) (gdb) 

k, I had to re-sign it after it SHOULD GET a certificate for all sections.

codeign -fs gdb-cert / usr / local / Cellar / gdb / 7.5 / bin / gdb

+2
Nov 15 '12 at 18:05
source share

There were two questions in the OP question. The issue of signing an executable file or changing a task and using setgid procmod was considered. The second problem is warnings about unknown boot commands. I came across this too, and after a bunch of searches came up with the following fixes, fix this:

https://gist.github.com/davidbalbert/4197567

+2
Feb 05 '13 at 17:45
source share



All Articles