aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2010-03-10 08:08:46 +0000
committerJoel Brobecker <brobecker@gnat.com>2010-03-10 08:08:46 +0000
commitaf6b7be16a1bf716a58ef692b175725b5acb561d (patch)
treebfe7a2e37e96b49de2b59294eb307e319fa98f98 /gdb
parent9982501a0db5863d24507f0e3de0cdd86da3a9b3 (diff)
downloadgdb-af6b7be16a1bf716a58ef692b175725b5acb561d.zip
gdb-af6b7be16a1bf716a58ef692b175725b5acb561d.tar.gz
gdb-af6b7be16a1bf716a58ef692b175725b5acb561d.tar.bz2
Adjust handling of Ada DIEs after dwarf2_physname patch.
* dwarf2read.c (dwarf2_compute_name): Add handling of Ada DIEs.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/dwarf2read.c16
2 files changed, 23 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d41f036..88187f1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-09 Joel Brobecker <brobecker@adacore.com>
+
+ Adjust handling of Ada DIEs after dwarf2_physname patch.
+ * dwarf2read.c (dwarf2_compute_name): Add handling of Ada DIEs.
+
2010-03-09 Christopher Faylor <me+cygwin@cgf.cx>
Pierre Muller <muller@ics.u-strasbg.fr>
@@ -127,8 +132,8 @@
* python/python-internal.h: Include symtab.h.
-2010-03-09 Joel Brobecker <brobecker@adacore.com>
- Pierre Muller <muller@ics.u-strasbg.fr>
+2010-03-09 Joel Brobecker <brobecker@adacore.com>
+ Pierre Muller <muller@ics.u-strasbg.fr>
* p-lang.c (is_pascal_string_type): Remove unneeded parentheses.
* p-valprint.c (pascal_val_print): Remove undeed block and fix
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 1f25a45..fd75c74 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -3324,6 +3324,9 @@ die_needs_namespace (struct die_info *die, struct dwarf2_cu *cu)
compute the physname for the object, which include a method's
formal parameters (C++/Java) and return type (Java).
+ For Ada, return the DIE's linkage name rather than the fully qualified
+ name. PHYSNAME is ignored..
+
The result is allocated on the objfile_obstack and canonicalized. */
static const char *
@@ -3396,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;
}