Subject: Re: Questions about gnu debug
From: Csaba Raduly <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Wed, 23 Dec 2009 21:56:46 +0200
List-Id: <cygwin.cygwin.com>

On Wed, Dec 23, 2009 at 6:48 PM, Liming <[email-masked]> wrote:
> I read the FAQ, but still very confused, please help.
>
> 1.
> I have a project written by C++, I want to debug it under Cygwin. I
> know I can use g++ -g, but I think this is for a single .cpp file.

Hi Liming,
If you have a project with multiple C++ files, you can compile each
C++ file with "g++ -g" into an object file (usually with .o suffix).
Then you can link the object files together with ... "g++ -g", like
this:

g++ -g -o executable_name  a.o b.o ...

Then you have an executable with debug info, which you can load with gdb.

> How
> to debug a whole Project? Anyway to debug the project inside a windows like editor?
>

If you used Windows IDEs, GDB needs time to get used to. It has an
extensive manual (search for "Debugging with GDB").

There are many GDB front-ends. I've been using ddd successfully. It
has a Cygwin package, I think (under Devel).

Emacs has gdb integration. It is a very powerful editor, but takes a
long time to learn.

Anther possibility is Eclipse (it has GDB integration too, but a bit
of an overkill, really). But it's fiddly to set up because it is a
Windows program and sometimes paths have to be translated between
Windows format and Cygwin.

Hope this helps,
Csaba
-- 
Life is complex, with real and imaginary parts

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple