I should preface this by stating I'm working with Xcode on macOS Sierra 10.12.6.
I installed GDB with homebrew
and it appeared to install fine until I tried to use it. In terminal it kept saying that it was not a valid command. (I'm new to C and was working with my professor. Even he was baffled when I tried to use it after downloading it in front of him). So later I tried to install it by creating the make file and still having problems. I then used homebrew
again but to uninstall and reinstall, still having problems.
Now I'm at the point where I can't even run my C files when I use gcc
to compile them. I simply get a statement that unable to open file
. I've read someone suggest to sudo mv /usr/local /usr/_local
and I'm notified that I don't have permission, even after entering in my password.
I've gotten every error when I try to remove all items belonging to gdb
. I've gone as far as removing Xcode in hopes that I can do a fresh install of it all.
I'm at the point where I've begun looking into removing my macports entirely.
I'm looking for any advice into how I can try to start off from a clean slate. I need to use gdb
on a project that is due and can't get this up and running. Please help talk me from a ledge!
EDIT:
I have used Sublime to create a simple Hello World
file and it compiles and runs fine with gcc
. So my project file has become corrupted somehow. At least I can calm down a bit. But I would still like to get this gdb
issue figured out and install a fresh copy with everything old removed.
I'm working with Xcode on macOS Sierra 10.12.6
I need to use gdb on a project that is due and can't get this up and running
I don't know how to reinstall gdb on macOS, but be aware that gdb is broken on macOS Sierra as of now (at least debugging dynamic libraries), see Bug report.
So if you even get gdb correctly installed you can probably end up with nothing (gdb won't be able to debug what you want).