Go to file
Pedro Alves a22ecf7026 Fix regression: expression completer and scope operator (PR gdb/22584)
I noticed this regression in the expression completer:

 "(gdb) p std::[TAB]" => "(gdb) p std::std::"

obviously we should have not completed to "std::std::".

The problem is that in the earlier big completer rework, I missed
taking into account the fact that with expressions, the completion
word point is not always at the start of the symbol name (it is with
linespecs).

The fix is to run the common prefix / LCD string (what readline uses
to expand the input line) through make_completion_match_str too.

New testcase included, exercising both TAB completion and the complete
command.

gdb/ChangeLog:
2017-12-13  Pedro Alves  <palves@redhat.com>

	* completer.c (completion_tracker::maybe_add_completion): New
	'text' and 'word' parameters.  Use make_completion_match_str.
	(completion_tracker::add_completion): New 'text' and 'word'
	parameters.  Pass down.
	(completion_tracker::recompute_lowest_common_denominator): Change
	parameter type to gdb::unique_xmalloc_ptr rval ref.  Adjust.
	* completer.h (completion_tracker::add_completion): New 'text' and
	'word' parameters.
	(completion_tracker::recompute_lowest_common_denominator): Change
	parameter type to gdb::unique_xmalloc_ptr rval ref.
	(completion_tracker::recompute_lowest_common_denominator): Change
	parameter type to gdb::unique_xmalloc_ptr rval ref.
	* symtab.c (completion_list_add_name): Pass down 'text' and 'word'
	as well.

gdb/testsuite/ChangeLog:
2017-12-13  Pedro Alves  <palves@redhat.com>

	* gdb.cp/cpcompletion.exp: Load completion-support.exp.
	("expression with namespace"): New set of tests.
	* gdb.cp/pr9594.cc (Test_NS::foo, Test_NS::bar)
	(Nested::Test_NS::qux): New.
	* lib/completion-support.exp (test_gdb_complete_cmd_multiple): Add
	defaults to 'start_quote_char' and 'end_quote_char' parameters.
2017-12-13 16:38:50 +00:00
bfd [BFD][AARCH64]Disallow R_AARCH64_ABS32(LP64) & R_AARCH64_ABS16 in const section of shared object. 2017-12-13 15:15:50 +00:00
binutils [Binutils][Objdump]Check symbol section information while search a mapping symbol backward. 2017-12-11 15:42:47 +00:00
config
cpu
elfcpp
etc
gas This patch enables disassembler_needs_relocs for PRU. It is needed to print correct symbols when disassembling arguments of "call" instructions with a relocation. 2017-12-13 13:09:59 +00:00
gdb Fix regression: expression completer and scope operator (PR gdb/22584) 2017-12-13 16:38:50 +00:00
gold Add plugin API for processing plugin-added input files 2017-12-11 14:58:38 -08:00
gprof Support --localedir, --datarootdir and --datadir 2017-11-29 20:10:52 +10:30
include Add plugin API for processing plugin-added input files 2017-12-11 14:58:38 -08:00
intl Require ngettext in test of system gettext implementation 2017-11-07 15:56:44 +10:30
ld [BFD][AARCH64]Disallow R_AARCH64_ABS32(LP64) & R_AARCH64_ABS16 in const section of shared object. 2017-12-13 15:15:50 +00:00
libdecnumber
libiberty
opcodes This patch enables disassembler_needs_relocs for PRU. It is needed to print correct symbols when disassembling arguments of "call" instructions with a relocation. 2017-12-13 13:09:59 +00:00
readline
sim sim: testsuite: add testsuite for or1k sim 2017-12-12 23:49:57 +09:00
texinfo
zlib
.cvsignore
.gitattributes
.gitignore
ChangeLog Add gdb for or1k build 2017-12-12 23:39:28 +09:00
compile
config-ml.in
config.guess
config.rpath
config.sub
configure Add gdb for or1k build 2017-12-12 23:39:28 +09:00
configure.ac Add gdb for or1k build 2017-12-12 23:39:28 +09:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.LIBGLOSS
COPYING.NEWLIB
depcomp
djunpack.bat
install-sh
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS
Makefile.def
Makefile.in
Makefile.tpl
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
README
README-maintainer-mode
setup.com
src-release.sh
symlink-tree
ylwrap

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README;  if with a libg++ release,
see libg++/README, etc.  That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.