gdb output for type information very verbose

Rick Moseley rmoseley@redhat.com
Wed Aug 13 14:45:00 GMT 2008


Hi all,

Recently we polled our resident C++ developers for comment on what the 
archer project could do to improve the gdb debugging experience.  The 
main complaint was that "gdb output for type information very verbose".  
The gdb UI interface Nemiver was given as an example of giving ouput 
that "does a good job of separating out the debug type from derived 
types, what is member data, etc."  Here is an example of this using this 
simple c++ program:

int main()
{
  std::string s;
  std::size_t i = s.size();
 
  s += 'a';

  return 0;
}


debugging session:

(gdb) finish
  .
  .
(gdb) ptype s
type = class std::basic_string<char, std::char_traits<char>, 
std::allocator<char> > {
  public:
    static const size_t npos;
  .
  . (135 more lines output)
  .
int compare(unsigned long, unsigned long, char const*) const;
    int compare(unsigned long, unsigned long, char const*, unsigned 
long) const;
}


It does seem that 140 or so lines of output is a bit excessive and for a 
"ptype" command on a string variable.  I'm not sure if this is the 
expected output of this command or not.  If not I need to file a bug.  
If 140+ lines is the expected output, then maybe there needs to be some 
sort of switch that can be set where the verbose output can be 
abbreviated somehow.  I can file a bugzilla on that as an enhancement 
request.

Any comments/suggestions here are appreciated.

Thanks,

Rick



More information about the Archer mailing list