Set language for Ada minimal symbols.
authorJoel Brobecker <brobecker@adacore.com>
Thu, 7 Nov 2013 04:35:35 +0000 (08:35 +0400)
committerJoel Brobecker <brobecker@adacore.com>
Tue, 10 Dec 2013 11:16:47 +0000 (12:16 +0100)
commit036e93dfdadd23ac73d3bd7f98f1640ded740cc0
tree66624c6993134e63a1bd2db73a16142b52db2153
parent72bfa06c56ec662b4262cc264f45462ccda6a5d6
Set language for Ada minimal symbols.

This helps with the following issue: Given an Ada program defining
a global variable:

    package Pck is
       Watch : Integer := 1974;
    end Pck;

When printing the address of this variable, GDB also tries to print
the associated symbol name:

    (gdb) p watch'address
    $1 = (access integer) 0x6139d8 <pck__watch>
                                       ^^
                                       ||

The problem is that GDB prints the variable's linkage name, instead
of its natural name. This is because the language of the associated
minimal symbol never really gets set.

This patch adds handling for Ada symbols in symbol_find_demangled_name.
After this patch, we now get:

    (gdb) p watch'address
    $1 = (access integer) 0x6139d8 <pck.watch>
                                       ^
                                       |

gdb/ChangeLog:

        * symtab.c (symbol_find_demangled_name): Add handling of
        Ada symbols.

gdb/testsuite/ChangeLog:

        * gdb.ada/int_deref.exp: Add test verifying that we print
        the decoded symbol name when printing the address of Ada
        symbols.
gdb/ChangeLog
gdb/symtab.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/int_deref.exp