diff options
author | Pedro Alves <palves@redhat.com> | 2017-07-14 16:50:35 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2017-07-14 16:50:35 +0100 |
commit | 8f14146e1317b7b416ce298fad1a4f3d1ccbeb2b (patch) | |
tree | ca6f9294c66d0f349b97473c09858af07b960789 /gdb/testsuite/gdb.linespec/base | |
parent | 0f6329bd7fcc8952aed5a386617d12529771415d (diff) | |
download | gdb-8f14146e1317b7b416ce298fad1a4f3d1ccbeb2b.zip gdb-8f14146e1317b7b416ce298fad1a4f3d1ccbeb2b.tar.gz gdb-8f14146e1317b7b416ce298fad1a4f3d1ccbeb2b.tar.bz2 |
Fix gdb.base/completion.exp with --target_board=dwarf4-gdb-index
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.
Diffstat (limited to 'gdb/testsuite/gdb.linespec/base')
-rw-r--r-- | gdb/testsuite/gdb.linespec/base/one/thefile.cc | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.linespec/base/two/thefile.cc | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.linespec/base/one/thefile.cc b/gdb/testsuite/gdb.linespec/base/one/thefile.cc index 0417b7a..34bc547 100644 --- a/gdb/testsuite/gdb.linespec/base/one/thefile.cc +++ b/gdb/testsuite/gdb.linespec/base/one/thefile.cc @@ -23,3 +23,8 @@ int NameSpace::overload(int x) { return x + 23; } + +int z1 () +{ + return 0; +} diff --git a/gdb/testsuite/gdb.linespec/base/two/thefile.cc b/gdb/testsuite/gdb.linespec/base/two/thefile.cc index 88188a5..264ae97 100644 --- a/gdb/testsuite/gdb.linespec/base/two/thefile.cc +++ b/gdb/testsuite/gdb.linespec/base/two/thefile.cc @@ -24,3 +24,8 @@ int NameSpace::overload(double x) { return (int) x - 23; } + +int z2 () +{ + return 0; +} |