mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-12 12:16:04 +08:00
8f14146e13
This is the same patch as posted at <https://sourceware.org/ml/gdb-patches/2017-02/msg00644.html>, with the test at <https://sourceware.org/ml/gdb-patches/2017-02/msg00687.html> squashed in. This patch fixes: -FAIL: gdb.base/completion.exp: tab complete break break.c:ma (timeout) -FAIL: gdb.base/completion.exp: complete break break.c:ma +PASS: gdb.base/completion.exp: tab complete break break.c:ma +PASS: gdb.base/completion.exp: delete breakpoint for tab complete break break.c:ma +PASS: gdb.base/completion.exp: complete break break.c:ma When run with --target_board=dwarf4-gdb-index. The issue here is that make_file_symbol_completion_list_1, used when completing a symbol restricted to a given source file, uses lookup_symtab to look up the symtab with the given name, and search for matching symbols inside. This assumes that there's only one symtab for the given source file. This is an incorrect assumption with (for example) -fdebug-types-section, where we'll have an extra extra symtab containing the types. lookup_symtab finds that symtab, and inside that symtab there are no functions... gdb/ChangeLog: 2017-07-14 Pedro Alves <palves@redhat.com> * symtab.c (make_file_symbol_completion_list_1): Iterate over symtabs matching all symtabs with SRCFILE as file name instead of only considering the first hit, with lookup_symtab. gdb/testsuite/ChangeLog: 2017-07-14 Pedro Alves <palves@redhat.com> * gdb.linespec/base/one/thefile.cc (z1): New function. * gdb.linespec/base/two/thefile.cc (z2): New function. * gdb.linespec/linespec.exp: Add tests.
31 lines
323 B
C++
31 lines
323 B
C++
/* The commented line must have the same line number in the other
|
|
"thefile.c". */
|
|
|
|
#define WANT_F1
|
|
#include "../../lspec.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int twodup ()
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
int m(int x)
|
|
{
|
|
return x + 23 + twodup (); /* thefile breakpoint */
|
|
}
|
|
|
|
int NameSpace::overload(int x)
|
|
{
|
|
return x + 23;
|
|
}
|
|
|
|
int z1 ()
|
|
{
|
|
return 0;
|
|
}
|