The existing gdb package containing fef-gdb uses a shell script to alert
the user that they need to code sign the program in order for it to run
properly as non-root. The info file has instructions for this...

To execute fsf-gdb without using sudo, the binary needs to be codesigned
on each machine that it is installed on. This requires the creation
of a certificate and signing of the fsf-gdb binary with the following
steps.

1) Open the application 'Keychain Access' from the Utilities folder.
2) In the Keychain Access application, select the 'Create a
   Certificate...' submenu item from the 'Keychain Access' menu and
   the 'Certificate Assistant' submenu.
3) In the 'Certificate Assistant' panel, enter 'gdb-cert' for the name
   of the certificate and leave the Identity Type as 'Self Signed Root'.
   Set the Certificate Type to 'Code Signing' and enable the 'Let me
   override defaults' checkbox. Click the 'Continue'  button. You may
   wish to lengthen the default 365 day lifespan of the certificate
   to 3650 days.
4) Continue clicking the 'Continue' buttons that appear until you see
   the panel to 'Specify a Location For The Certificate'. Set the
   Keychain to 'System' at this point. If you can't store the
   certificate in the 'System' keychain, create it in the 'login'
   keychain, then export it. You can then import it into the 'System'
   keychain.
5) Select the 'System' entry in the Keychains listing of the Keychain
   Access window. Select your newly created 'gdb-cert' certificate and
   select the 'Get Info' contextual menu item, expand the 'Trust'
   item and set 'Code Signing' to '"Always Trust'.
6) Quit the 'Keychain Access' application.
7) On darwin12 or later, you must edit the line in the file
   /System/Library/LaunchDaemons/com.apple.taskgated.plist from

                   <string>-s</string>

   to

                   <string>-sp</string>

   adding the '-p' option. Due to kernel caching, a restart is needed
   for the changes to take effect.
8) After the restart, the actual codesigning should be done with the
   command 'sudo codesign -s gdb-cert %p/lib/fsf-gdb/fsf-gdb'. Note it
   can take over five minutes for the codesigning to complete.

Note that you also need to edit
 /System/Library/LaunchDaemons/com.apple.taskgated.plist to pass the -p
option in order for gdb to properly handle tasks...

http://ntraft.com/installing-gdb-on-os-x-mavericks/

Under El Capitan, you will have to temporarily disable SIP to the the
modification to /System/Library/LaunchDaemons/com.apple.taskgated.plist.
Apple treats debuggers as a security threat and has progressively
restricted the ability to run as non-root over time so one has to jump
through a lot of hoops to do that.
          Jack
ps I added the shell script and the checks to remind users when they need
to code sign or re-add the -p option should they reinstall OS X.

On Thu, Mar 3, 2016 at 6:12 PM, Alexander Hansen <
alexanderk.han...@gmail.com> wrote:

> <switching to plain text>
>
> > On Mar 3, 2016, at 14:07, Roseli Wedemann <rose.wedem...@gmail.com>
> wrote:
> >
> > Hello,
> >
> > I tried to install fsf-gdb and gdb via fink today on OS X El Capitan
> 10.11.3.
> >
>
> There is no “fsf-gdb” Fink package.  I can only assume that you mean the
> “fsf-gdb” executable in the “gdb” package, and that “gdb” refers to the
> “gdb” executable from the “apple-gdb” package.
>
> When filing bug reports with us use the _package_ names, not just the
> _executable_ names.
>
> > First of all, a dependency is missing (libtool needed to be installed
> manually for fsf-gdb [perhaps also for gdb]).
> >
>
> What error did you get?  The packages build OK for me without libtool2
> (there  is no “libtool" for 10.11).  If you got a build or linker error
> that pertains to some other package then that only impacts (apple-)gdb
> indirectly and should be filed as a bug against _that_ package.
>
> > Secondly, gdb runs ok via sudo, but not without sudo (I did the code
> signing as described in the package description). For the error see below:
> >
> > gdb IntFokkerPlanck
> > GNU gdb 6.3.50.20050815-cvs (Thu Oct 15 12:32:49 UTC 2015)
> > Copyright 2004 Free Software Foundation, Inc.
> > GDB is free software, covered by the GNU General Public License, and you
> are
> > welcome to change it and/or distribute copies of it under certain
> conditions.
> > Type "show copying" to see the conditions.
> > There is absolutely no warranty for GDB.  Type "show warranty" for
> details.
> > This GDB was configured as "i686-apple-darwin15.0.0"...Reading symbols
> for shared libraries .. done
> >
> > (gdb) break 154
> > Breakpoint 1 at 0x10000080f: file IntFokkerPlanck.c, line 154.
> > (gdb) run
> > Starting program:
> /Users/roseliwedemann/tudo/Neural/FokkerPlanckModel/Program/IntFokkerPlanck
> > Unable to find Mach task port for process-id 1257: (os/kern) failure
> (0x5).
> > (gdb)
> >
> >
> > Thirdly, fsf-gdb does not run via sudo nor without sudo.
> >
> > error with sudo:
> >
> > sudo fsf-gdb IntFokkerPlanck
> > Password:
> > Throw without catch before boot:
> > Throw to key misc-error with args ("primitive-load-path" "Unable to find
> file ~S in load path" ("ice-9/boot-9") #f)Aborting.
> >
> >
> > error without sudo:
> >
> > fsf-gdb IntFokkerPlanck
> > Throw without catch before boot:
> > Throw to key misc-error with args ("primitive-load-path" "Unable to find
> file ~S in load path" ("ice-9/boot-9") #f)Aborting.
> > Abort trap: 6
> >
> > Can you please help me solve the above problems / fix the missing
> dependency?
> >
> > Cheers,
> >
> > --
> > Roseli S. Wedemann
> > Instituto de Matemática e Estatística
> > Coordenadora do Programa de Pós-graduação em Ciências Computacionais
> > Head of the Computational Science Graduate Program
> > Universidade do Estado do Rio de Janeiro
> > R. São Francisco Xavier 524, 6 andar
> > 20550-900, Rio de Janeiro, RJ
> > ros...@ime.uerj.br
>
> I don’t reproduce these errors when I try an executable here.  However,
> please don’t assume that we are experts in the details of every package.
> Since you’ve built something from outside of Fink, it’s hard for us to
> reproduce what you’ve done.  If you can provide a test case (sources and
> build procedure) that might help us.
> --
> Alexander Hansen, Ph.D.
> Fink User Liaison
>
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> _______________________________________________
> Fink-devel mailing list
> Fink-devel@lists.sourceforge.net
> List archive:
> http://news.gmane.org/gmane.os.apple.fink.devel
> Subscription management:
> https://lists.sourceforge.net/lists/listinfo/fink-devel
>
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to