X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: <46069.57660.qm@web110511.mail.gq1.yahoo.com> References: <46069 DOT 57660 DOT qm AT web110511 DOT mail DOT gq1 DOT yahoo DOT com> Date: Wed, 23 Dec 2009 21:56:46 +0200 Message-ID: <1ef5a52f0912231156i2cf55043q8b787d276c04bdae@mail.gmail.com> Subject: Re: Questions about gnu debug From: Csaba Raduly To: cygwin AT cygwin DOT com Cc: linhaiyxs AT yahoo DOT com Content-Type: text/plain; charset=ISO-8859-1 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Wed, Dec 23, 2009 at 6:48 PM, Liming 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