I have a gdb brew version installed on Mavericks. It is encoded and I can debug without problems with a local connection:
$ gdb myprog GNU gdb (GDB) 7.7.1 Copyright (C) 2014 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.3.0". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from myprog...done. (gdb) b main Breakpoint 1 at 0x1000028e6: file main.c, line 38. (gdb) r Starting program: myprog Breakpoint 1, main (argc=1, argv=0x7fff5fbffae8) at main.c:38 38 float pi=4.*(float)atan((double)1.);
However, if I first connected to the host using ssh, now gdb no longer works:
$ ssh localhost Last login: Tue Jul 15 11:57:44 2014 from localhost $ gdb myprog GNU gdb (GDB) 7.7.1 blah blah... Reading symbols from myprog...done. (gdb) b main Breakpoint 1 at 0x1000028e6: file main.c, line 38. (gdb) r Starting program: myprog Unable to find Mach task port for process-id 826: (os/kern) failure (0x5). (please check gdb is codesigned - see taskgated(8)) (gdb)
Does anyone know why this is happening and how to fix it?
source share