Not-so-smart autocomplete

Bug #1230253 reported by Avio
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gdb (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

gdb seems to have several bugs in command line autocomplete.

Whenever I want to insert a breakpoint and I start typing the file name, if the filename contains a dash '-' instead of an underscore '_', gdb doesn't autocomplete correctly. It seems that it only considers the string after the dash. Example:

(gdb) break hmi-con
connection_ptr hmi-connection.hpp
construction vtable for std::istream-in-boost::process::pistream hmi-connection-state.cpp
construction vtable for std::ostream-in-boost::process::postream hmi-connection-state.h
hmi-connection.cpp
(gdb) break hmi-conn
connection_ptr hmi-connection.cpp hmi-connection.hpp hmi-connection-state.cpp hmi-connection-state.h
(gdb) break hmi-conn

and so on.

If I just write "break hmi-"[TAB][TAB], gdb will output the whole list of symbols for the executable (and ctrl+c is the only way out).
If I reach the "." ("break hmi-connection."[TAB][TAB]), gdb will again output the whole list of symbols for the executable.

This happens quite often, whenever a filename with dash '-' is involved.

This is a quite severe bug: gdb should (almost) never output the whole list of symbols because this simply makes no sense in most of real-life situations. It may make sense in a one-file project where the list of symbols is just one or two pages long, but for sure it shouldn't be printed out with the [TAB][TAB] sequence.

The sum of these two bugs is devastating: trying to autocomplete a filename with a dash often result in a very long wait possibly followed by wrong autocomplete suggestions. If the autocomplete is successful, however, it may happen that one has pressed [TAB] more than two times (due to the latency), and then the full symbol list printout kicks in. This is really frustrating and makes gdb autocomplete quite unusable.

Finally, gdb autocomplete is mostly context-free. Whenever I break in a function, I'll probably want to inspect some local variable, but gdb prints out every possible match, also including library symbols from STL, boost, etc.. Some priority to local symbols should be added (maybe expanding the search context according to the number of times [TAB] is pressed?).

I'm using GNU gdb (GDB) 7.6-ubuntu under Ubuntu 13.04 Raring.

Revision history for this message
Matthias Klose (doko) wrote :

closing this rather old issue. sorry for not addressing this earlier. Please could you recheck with the recent 14.04 LTS or 14.10 releases and reopen the issue if the problem persists?

Changed in gdb (Ubuntu):
status: New → Invalid
Revision history for this message
Gene Snider (gene-4) wrote :

This is still occurring on 14.04.2.

Changed in gdb (Ubuntu):
status: Invalid → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.