Debian Bug report logs - #519525
gdb: TAB expansion for class members does not work

version graph

Package: gdb; Maintainer for gdb is Héctor Orón Martínez <[email protected]>; Source for gdb is src:gdb (PTS, buildd, popcon).

Reported by: Thomas Richter <[email protected]>

Date: Fri, 13 Mar 2009 10:21:07 UTC

Severity: normal

Found in version gdb/6.8-3

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Daniel Jacobowitz <[email protected]>:
Bug#519525; Package gdb. (Fri, 13 Mar 2009 10:21:09 GMT) (full text, mbox, link).


Acknowledgement sent to Thomas Richter <[email protected]>:
New Bug report received and forwarded. Copy sent to Daniel Jacobowitz <[email protected]>. (Fri, 13 Mar 2009 10:21:09 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Thomas Richter <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: gdb: TAB expansion for class members does not work
Date: Fri, 13 Mar 2009 11:20:38 +0100
Package: gdb
Version: 6.8-3
Severity: normal


gdb does not provide any useful TAB expansion for class members. That is, if you define a
name space like A::, pressing on TAB presents all useless symbols that are not even members
of the class. To reproduce, enter the following program:

#include <cstdio>

class A {
  int x;
public:
  A(int y);
  ~A();
  int getX() const;
};

A::A(int y)
  : x(y)
{ 
  std::printf("creating\n");
}

A::~A()
{
  std::printf("destroying\n");
}

int A::getX() const
{
  return x;
}

int main(int argc,char **argv)
{
  A a(5);

  std::printf("The value of a is %d\n",a.getX());
  return 0;
}

Compile this program with g++ -O0 -ggdb3 test.cpp and start debugging with gdb a.out.
Then enter the following:

break A:: (do not press return)

now press TAB. gdb shows now a lot of useless symbols that are not even members of
the class A, rendering TAB expansion useless.

-- System Information:
Debian Release: 5.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.iso-8859-1, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages gdb depends on:
ii  libc6                     2.7-18         GNU C Library: Shared libraries
ii  libexpat1                 2.0.1-4        XML parsing C library - runtime li
ii  libncurses5               5.7+20081213-1 shared libraries for terminal hand
ii  libreadline5              5.2-3.1        GNU readline and history libraries

gdb recommends no packages.

Versions of packages gdb suggests:
pn  gdb-doc                       <none>     (no description available)

-- no debconf information




Information forwarded to [email protected], Daniel Jacobowitz <[email protected]>:
Bug#519525; Package gdb. (Sun, 11 Oct 2009 21:51:05 GMT) (full text, mbox, link).


Acknowledgement sent to Daniel Jacobowitz <[email protected]>:
Extra info received and forwarded to list. Copy sent to Daniel Jacobowitz <[email protected]>. (Sun, 11 Oct 2009 21:51:05 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Daniel Jacobowitz <[email protected]>
To: Thomas Richter <[email protected]>, [email protected]
Subject: Re: Bug#519525: gdb: TAB expansion for class members does not work
Date: Sun, 11 Oct 2009 17:44:07 -0400
On Fri, Mar 13, 2009 at 11:20:38AM +0100, Thomas Richter wrote:
> Package: gdb
> Version: 6.8-3
> Severity: normal
> 
> 
> gdb does not provide any useful TAB expansion for class members. That is, if you define a
> name space like A::, pressing on TAB presents all useless symbols that are not even members
> of the class. To reproduce, enter the following program:

This is improved in GDB 7.0, but still not great.

(gdb) complete break A::
break A::A(int)
break A::getX() const
break A::~A()
(gdb) complete break A::A
break A::A(int)
(gdb) break A::A(int)
Breakpoint 1 at 0x4006eb: file 519525.cc, line 12. (2 locations)

Good so far.  But:

(gdb) break A::getX() const
Function "A::getX()" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) break A::getX()
Function "A::getX()" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) break 'A::getX() const'
Breakpoint 2 at 0x4006a4: file 519525.cc, line 24.

If the quotes are necessary, GDB should insert them for you; ideally
they shouldn't be necessary.

And:

(gdb) complete break A::~
break A::~<anonymous struct>
break A::~<anonymous struct>::<anonymous union>
break A::~A
break A::~A::A(int)
break A::~A::getX() const
break A::~A::~A()
break A::~FILE
...

Completion is not recognizing ~ as valid in the middle of a symbol.

-- 
Daniel Jacobowitz
CodeSourcery




Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Sun Sep 22 07:39:13 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.