19

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???

3
  • Which version of Xcode? Commented Nov 13, 2013 at 11:42
  • xcode 5.01 does not come with gdb bundled anymore (at least on mavericks) Commented Nov 13, 2013 at 15:17
  • GDB is part of the optional "Command-line Tools" component in recent Xcode versions. Did you try doing the extra step of this optional install? Commented Nov 13, 2013 at 16:00

4 Answers 4

33

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

Sign up to request clarification or add additional context in comments.

6 Comments

@trojanfoe: Did you even read what you posted ? From the link you gave: post-destroot { system "chgrp procmod ${destroot}${prefix}/bin/**ggdb**" system "chmod g+s ${destroot}${prefix}/bin/**ggdb**"
No, I didn't see that, however I interpreted your answer as "you need to use 'port install ggdb' to install gdb", so you need to tidy-up your answer as it's ambiguous.
Thanks for the help! That did not work initially, so I reinstalled via port install gdb, and I noticed a comment at the end of the install.
Ugh. This kind of nonsense is why I usually just run stuff in a Linux VM. Well, thanks.
|
2

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

2 Comments

Just read why this is required, and it has nothing to do with the command. This additional parameters allow gdb to actually start tracing a process, it does not prevent it to start. So this part as nothing to do with the fact that you were unable to run ggdb.
you're right. At work I re-installed, did that, and then it seemed like it magically worked. At home, (which I had it already installed on also) I tried the GGDB and it worked. Sorry about that, I will accept your answer
0

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".
$ 

3 Comments

My question is specifically talking about Mavericks, aka 10.9
@Jameo - Understood. I just wanted to make sure you know that in recent versions of Xcode, the command line tools (including GDB) are optional components which must be manually installed from the Xcode preferences menu. Did you try this step? I don't think this has anything to do with OSX version.
Yeah as far as I know, you cant get it anymore. Here is the link confirming it stackoverflow.com/questions/19554439/…
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.