Pwrcdr87
Pwrcdr87

Reputation: 965

GDB on Mac OS Sierra, trying to uninstall and remove all files completely but can't

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.

Upvotes: 0

Views: 475

Answers (2)

Jonathan Hector
Jonathan Hector

Reputation: 1

Try making your file executable using gcc -Wall -g $fileName.c -o $fileName. This will show all the errors that might exists. Secondly, if it doesn't work and you absolutely need to use gdb, using a VM of Linux(recommend Ubuntu if you're new to Linux or Mate) is a good alternative. You then have to just use sudo apt-get install gdb and even install gdb-dashboard git-hub gdb-dashboard if you want to do some serious debugging. That's the quickest fix that I can think of you are in a hurry. Btw good VMs are VirtualBox and Parallel Desktop(if you want to have access to your local files from the VM).

Upvotes: 0

ks1322
ks1322

Reputation: 35736

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).

Upvotes: 2

Related Questions