+2011-03-31 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * dwarf2read.c (dwarf2_name): Initialize DEMANGLED. Avoid demangling
+ struct linkage name twice.
+
2011-03-31 Tom Tromey <tromey@redhat.com>
* python/py-prettyprint.c (print_stack_unless_memory_error): Add
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47510. */
if (!attr || DW_STRING (attr) == NULL)
{
- char *demangled;
+ char *demangled = NULL;
attr = dwarf2_attr (die, DW_AT_linkage_name, cu);
if (attr == NULL)
if (attr == NULL || DW_STRING (attr) == NULL)
return NULL;
- demangled = cplus_demangle (DW_STRING (attr), DMGL_TYPES);
+ /* Avoid demangling DW_STRING (attr) the second time on a second
+ call for the same DIE. */
+ if (!DW_STRING_IS_CANONICAL (attr))
+ demangled = cplus_demangle (DW_STRING (attr), DMGL_TYPES);
if (demangled)
{