Search code examples
c++eclipsegdbgdbinit

How do I get the .gdbinit command file needed by Eclipse for debugging?


My knowledge and experience in programming is still very fresh and basic, so please bear with me.

I want to be able to use C++ on my MacBook (OS 10.9.5 Mavericks) via Eclipse, which I have already been using for Java previously.

So I followed the instructions in Eclipse GDB MacOSX Mavericks to get GDB, but now I still need the GDB command file (.gdbinit), which I can't find anywhere (I tried which .gdbinit on Terminal to no avail).

Please help me.


Solution

  • .gdbinit is a configuration file. You won't have one unless you've downloaded one or written one separately. It goes in your home directory and just contains a list of commands to run on startup. You don't necessarily need one. See this answer: .gdbinit file missing

    However, if you are fairly new to programming, I'd suggest starting with Xcode, Clang and LLDB on the Mac for C++ rather than Eclipse, GCC and GDB. It's far easier to get setup, and well documented.

    See:

    How do I set up a C++ project in Xcode 4?