commit 0a992b13eb758bf26c172a67240022a9d1e1226f Author: Joel Brobecker Date: Mon Mar 8 09:56:21 2010 +0400 Compute the name of Ada entities using the MIPS_linkage_name first. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index d8629e4..9e4334a 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -3399,6 +3399,19 @@ dwarf2_compute_name (char *name, struct die_info *die, struct dwarf2_cu *cu, } } } + else if (cu->language == language_ada) + { + /* For Ada unit, we prefer the linkage name over the name, as + the former contains the exported name, which the user expects + to be able to reference. Ideally, we want the user to be able + to reference this entity using either natural or linkage name, + but we haven't started looking at this enhancement yet. */ + struct attribute *attr; + + attr = dwarf2_attr (die, DW_AT_MIPS_linkage_name, cu); + if (attr && DW_STRING (attr)) + name = DW_STRING (attr); + } return name; }