From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: C++ debugging with GDB Date: Thu, 30 Apr 1998 23:08:25 -0400 Organization: Two pounds of chaos and a pinch of salt. Lines: 39 Message-ID: <35493CA9.3253@cs.com> References: NNTP-Posting-Host: ppp126.cs.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Gavin Sinclair wrote: > > Hello there, > > Can anybody offer me some advice in using GDB to debug C++ programs? > Using DOS/Win95 with DJGPP and GDB 4.16, I notice the following problems: > > - method names are not demangled. For this problem, try "set print demangle". > - cannot refer to class variables directly, must use this->foo I've never had this problem as long as demangling was enabled. > - can't find inline code This is a well-known limitation of the COFF debugging format. The recent updates of GNU tools to the 2.8.1 binutils and gcc 2.8.0 have collectively enabled another format known as stabs that supposedly helps. Use the -gstabs switch to enable this. > I've pored through the documentation for GDB and it seems the problem lies > with the executable file format. In UNIX at university, I use the same > version of GDB and can debug C++ no problems. Is there anything I can do > at home? Unless somebody wants to go to the substantial effort of converting all the DJGPP tools, as well as the real mode stub, to use a different object format, users will have to live with this limitation. Sorry. :-( -- --------------------------------------------------------------------- | John M. Aldrich | "Animals can be driven crazy by pla- | | aka Fighteer I | cing too many in too small a pen. | | mailto:fighteer AT cs DOT com | Homo sapiens is the only animal that | | http://www.cs.com/fighteer | voluntarily does this to himself." | ---------------------------------------------------------------------