Reputation:
I am currently using a mid 2012 macbook Pro that is running macOS Mojave version 10.14.5. I am trying to use the GDB debugger for debugging C language code. I've already used Homebrew to install gdb on my computer, however it does not seem to work. Here is the output that I get from the terminal in VSCode:
steelwinds-MacBook-Pro:Chapter05 steelwind$ gdb ex2_dbg.out
GNU gdb (GDB) 9.1
Copyright (C) 2020 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-darwin18.7.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 <RET> for more, q to quit, c to continue without paging--<RET>
Type "apropos word" to search for commands related to "word"...
Reading symbols from ex2_dbg.out...
Reading symbols from
/Users/steelwind/HardWay/CandC++/CandC++/Chapter05/ex2_dbg.out.dSYM/Contents/Resources/
DWARF/ex2_dbg.out...
(gdb) run
Starting program: /Users/steelwind/HardWay/CandC++/CandC++/Chapter05/ex2_dbg.out
Unable to find Mach task port for process-id 7502: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
(gdb) q
steelwinds-MacBook-Pro:Chapter05 steelwind$
I'm not sure if I missed a step or if there is something that I should do instead of using Homebrew, but any advice is helpful.
Upvotes: 2
Views: 4395
Reputation: 1580
The hint is this line: please check gdb is codesigned - see taskgated(8)
Because of one of Apple's security features, you will need to codesign GDB. Here's how to do that: "please check gdb is codesigned - see taskgated(8)" - How to get gdb installed with homebrew code signed?
Upvotes: 1