This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/22670] regressions in Ada caused by introduction of wild matching in C++ patch series


https://sourceware.org/bugzilla/show_bug.cgi?id=22670

--- Comment #12 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Pedro Alves <palves@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d4c2a405cb7535d25b88e9b8dad0e557242950ca

commit d4c2a405cb7535d25b88e9b8dad0e557242950ca
Author: Pedro Alves <palves@redhat.com>
Date:   Wed Jan 10 20:38:07 2018 +0000

    Fix gdb.ada/complete.exp's "complete break ada" test (PR gdb/22670)

    This patch fixes the regression covered by the test added by:

        commit 344420da6beac1e0b2f7964e7101f8dcdb509b0d
        Date: Thu Jan 4 03:30:37 2018 -0500
        Subject: Add "complete break ada" test to gdb.ada/complete.exp

    The regression had been introduced by:

        commit b5ec771e60c1a0863e51eb491c85c674097e9e13
        Date:   Wed Nov 8 14:22:32 2017 +0000
        Subject: Introduce lookup_name_info and generalize Ada's FULL/WILD name
matching

    The gist of it is that linespec completion in Ada mode is generating
    additional matches that should not appear in the match list
    (internally generated symbols, or symbols that should be enclosed
    between "<...>").  These extraneous entries have uppercase characters, such
as:

        break ada__stringsS
        break ada__strings__R11s
        [etc]

    These matches come from minimal symbols.  The problem is that Ada
    minsyms end up with no language set (language_auto), and thus we end
    up using the generic symbol name matcher for those instead of Ada's.
    We already had a special case for in compare_symbol_name to handle
    this, but it was limited to expressions, while the case at hand is
    completing a linespec.  Fix this by applying the special case to
    linespec completion as well.  I.e., remove the EXPRESSION check from
    compare_symbol_name.  That alone turns out to not be sufficient still
    -- GDB would still show a couple entries that shouldn't be there:

    ~~
        break ada__exceptions__exception_data__append_info_exception_name__2Xn
        break ada__exceptions__exception_data__exception_name_length__2Xn
    ~~

    The reason is that these minimal symbols end up with their language
    set to language_cplus / C++, because those encoded names manage to
    demangle successfully as C++ symbols (using an old C++ mangling
    scheme):

      $ echo ada__exceptions__exception_data__append_info_exception_name__2Xn |
c++filt
      Xn::ada__exceptions__exception_data__append_info_exception_name(void)

    It's unfortunate that Ada's encoding scheme doesn't start with some
    unique prefix like "_Z" in the C++ Itanium ABI mangling scheme.  For
    now, paper over that by treating C++ minsyms as Ada minsyms.

    gdb/ChangeLog:
    2018-01-10  Pedro Alves  <palves@redhat.com>

            PR gdb/22670
        * ada-lang.c (ada_collect_symbol_completion_matches): If the
        minsym's language is language_auto or language_cplus, pass down
        language_ada instead.
        * symtab.c (compare_symbol_name): Don't frob symbol language here.

    gdb/testsuite/ChangeLog:
    2018-01-10  Pedro Alves  <palves@redhat.com>

            PR gdb/22670
        * gdb.ada/complete.exp ("complete break ada"): Replace kfail with
        a fail.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]