delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/12/01/01:44:12

Date: Wed, 30 Nov 1994 18:02:46 -0800 (PST)
From: Gordon Hogenson <ghogenso AT u DOT washington DOT edu>
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Debugging format for C++

It's difficult to debug C++ with the DJGPP version of GDB.  For
example, the only way to access the data elements of a base class
is via the "this" pointer:

*(this->Base->element_of_base)

this is pretty bad if the inheritance hierarchy is large.
Basically, classes are treated as dumb structs.

Further problems are that "bool" values always show up in
GDB as "void" (instead of "true" or "false"); function names
are mangled; member functions cannot be called using C++ notation;
'ptype' doesn't work; virtual base classes really confuse gdb,
etc, etc.

In short, C++ is not a supported language in the debug format
used by DJGPP.  This is a great shame, since under UNIX, gdb's support
for C++ is amazing. 

Is there some way to configure GCC to output a C++-friendly
debugging format?  I tried "-ggdb", "-gstabs", but these result
in the message: "option '-ggdb' not supported by this version of
GCC.  Is this inherent in the object file format used by DJGPP
or is it the way GCC was built (i.e. options like --with-stabs )?

Another suggestion: build versions of the libraries with
debug info.  I rebuilt libiostream.a with debugging information,
and it has helped me enormously.

Gordon 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019