Question

I am trying to install GDB to work with LiteIDE, on Mavericks.

After some research, I found out that GDB does not come with Xcode anymore, and that you have to install it yourself. Short of actually installing GDB from source, and self code signing (id rather not do this), I would like to use MacPorts to get this done.

I did port install gdb, which ran and succeeded as far as I know. After the install, I closed terminal and then typed gdb and I get -bash: gdb: command not found

Does anyone have a solution for this, using MacPorts???

Was it helpful?

Solution

You should use the command "ggdb" to start the MacPorts' build of gdb.

I don't know why they have renamed it, probably a transient bug/change that will be fixed somehow, I suspect they wanted to avoid a collision with the alias "gdb" launching LLDB.

Edit: Reworded the answer to avoid ambiguities as reported by @trojanfoe

OTHER TIPS

I finally figured it out, with some help from @xryl669. His tip that you have to use the command "ggdb" in order to access this port from macports, is correct. Also, however, I missed a command that displayed after the port installed:

You will need to make sure
/System/Library/LaunchDaemons/com.apple.taskgated.plist has the '-p' option,
e.g.
        <key>ProgramArguments</key>
        <array>
                <string>/usr/libexec/taskgated</string>
                <string>-sp</string>
        </array>

To do this, type

sudo nano /System/Library/LaunchDaemons/com.apple.taskgated.plist

And then add the "p" after -s. I don't really know what this does, but after this "ggdb" command started working for me

Edit: Adding the p is recommended but simply using "ggdb" should do the trick

I don't have Mavericks yet, but since Xcode 4.3, the command-line tools are optional: https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/xcode_4_3.html "The command-line tools are not bundled with Xcode 4.3 by default. Instead, they can be installed optionally using the Components tab of the Downloads preferences panel.".

I have Xcode 5.0.1 on OSX 10.8.5 and gdb is definitely there after doing the optional command-line tools install:

$ which -a gdb
/usr/bin/gdb
$ gdb --version
GNU gdb 6.3.50-20050815 (Apple version gdb-1824) (Wed Feb  6 22:51:23 UTC 2013)
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 "x86_64-apple-darwin".
$ 

I spent some time and figured it out with help of great documentation. 1. Install ggdb using MacPorts: sudo port install gdb, the file will be /opt/local/bin/ggdb. 2. Follow tutorial https://www.ics.uci.edu/~pattis/common/handouts/macmingweclipse/allexperimental/mac-gdb-install.html and it works.

I spent number of days and many various tutorials, this one actually works ! Good luck.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top