public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11543] New: using-directive does not autocomplete
@ 2010-04-26 21:18 jan dot kratochvil at redhat dot com
  2010-04-27 16:47 ` [Bug c++/11543] " cmoller at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2010-04-26 21:18 UTC (permalink / raw)
  To: gdb-prs

namespace A { int variablex = 1; }
int main (void)
{
  int variabley = 2;
  using namespace A;
  return 0; /* break-here */
}
-------------------------------------------------------------------------------
(gdb) p variablex
$1 = 1
(gdb) p variabley
$2 = 2
But when I type
(gdb) p vari<tab>
it autocompletes to:
(gdb) p variabley
without any trace of "variablex" being also available.

I am not completely sure it is the right behavior but I believe so.

-- 
           Summary: using-directive does not autocomplete
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: jan dot kratochvil at redhat dot com
                CC: gdb-prs at sourceware dot org,swagiaal at redhat dot com
GCC target triplet: x86_64-unknown-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=11543

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/11543] using-directive does not autocomplete
  2010-04-26 21:18 [Bug c++/11543] New: using-directive does not autocomplete jan dot kratochvil at redhat dot com
@ 2010-04-27 16:47 ` cmoller at redhat dot com
  2010-04-28 15:30 ` swagiaal at redhat dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: cmoller at redhat dot com @ 2010-04-27 16:47 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From cmoller at redhat dot com  2010-04-27 16:47 -------
The problem is that in symtab.c:completion_list_add_name(), qualified names show
up as "A::variablex" and the first test is a trivial reject of strcmp(..., ...)
that matches the beginning of the symname with the beginning of the target,
thereby comparing the target to the qualifier and failing.

Trivial to fix by skipping past the qualifier in the symname.

Two questions:

  1.  Should skipping the qualifier be the default behaviour?  Or should doing
that be some kind of option?

  2.  Are multiple qualifiers like "A::B::variablex" possible?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at sourceware dot|cmoller at redhat dot com
                   |org                         |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1


http://sourceware.org/bugzilla/show_bug.cgi?id=11543

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/11543] using-directive does not autocomplete
  2010-04-26 21:18 [Bug c++/11543] New: using-directive does not autocomplete jan dot kratochvil at redhat dot com
  2010-04-27 16:47 ` [Bug c++/11543] " cmoller at redhat dot com
@ 2010-04-28 15:30 ` swagiaal at redhat dot com
  2010-04-28 17:27 ` cmoller at redhat dot com
  2010-07-22 15:38 ` swagiaal at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: swagiaal at redhat dot com @ 2010-04-28 15:30 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From swagiaal at redhat dot com  2010-04-28 15:30 -------
The question is whether symtab.c:completion_list_add_name
looks at current import statements (using namespace A).
To add support for something like that would require duplicating a lot of the
code that currently does namespace lookup in completion_list_add_name.

IMO the right thing to do is to modify the lookup_* functions to optionally
return a list of all matching names so that the code can be reused. The same
thing applies to the lookup procedure performed during overload resolution.
Seems like a lot of work but it is the right thing to do.



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11543

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/11543] using-directive does not autocomplete
  2010-04-26 21:18 [Bug c++/11543] New: using-directive does not autocomplete jan dot kratochvil at redhat dot com
  2010-04-27 16:47 ` [Bug c++/11543] " cmoller at redhat dot com
  2010-04-28 15:30 ` swagiaal at redhat dot com
@ 2010-04-28 17:27 ` cmoller at redhat dot com
  2010-07-22 15:38 ` swagiaal at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: cmoller at redhat dot com @ 2010-04-28 17:27 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|cmoller at redhat dot com   |unassigned at sourceware dot
                   |                            |org


http://sourceware.org/bugzilla/show_bug.cgi?id=11543

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/11543] using-directive does not autocomplete
  2010-04-26 21:18 [Bug c++/11543] New: using-directive does not autocomplete jan dot kratochvil at redhat dot com
                   ` (2 preceding siblings ...)
  2010-04-28 17:27 ` cmoller at redhat dot com
@ 2010-07-22 15:38 ` swagiaal at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: swagiaal at redhat dot com @ 2010-07-22 15:38 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |11832


http://sourceware.org/bugzilla/show_bug.cgi?id=11543

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-07-22 15:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-26 21:18 [Bug c++/11543] New: using-directive does not autocomplete jan dot kratochvil at redhat dot com
2010-04-27 16:47 ` [Bug c++/11543] " cmoller at redhat dot com
2010-04-28 15:30 ` swagiaal at redhat dot com
2010-04-28 17:27 ` cmoller at redhat dot com
2010-07-22 15:38 ` swagiaal at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).