To the GDB official website Download GDB installation package, after decompression, in the "terminal" into its directory: then execute the following command line:
1st:cflags= '-wno-string-plus-int-g-o2 './configure--disable-werror
2nd:make
3rd:sudo make Install
When the above command finishes, type the following command:
Gdb
The terminal is displayed as follows:
GNU gdb (GDB) 7.6.1
Copyright (C) Free Software Foundation, Inc.
License gplv3+: GNU GPL version 3 or later
This was free software:you was 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 is configured as "x86_64-apple-darwin13.0.0".
For bugs reporting instructions, please see:
(GDB)
Indicates that the compilation installation was successful.
GDB installation steps on a Mac