diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-03-31 19:37:54 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-03-31 19:37:54 +0000 |
commit | df5c6c503133136c5d6e5c5eea6f43d276a8eda0 (patch) | |
tree | 14e5cb4481baa711c8b6c22b337209bb8105f519 | |
parent | 1dae3efc56ac9f71907df4a22a6148eb2d51a80f (diff) | |
download | gdb-df5c6c503133136c5d6e5c5eea6f43d276a8eda0.zip gdb-df5c6c503133136c5d6e5c5eea6f43d276a8eda0.tar.gz gdb-df5c6c503133136c5d6e5c5eea6f43d276a8eda0.tar.bz2 |
gdb/
* dwarf2read.c (dwarf2_name): Initialize DEMANGLED. Avoid demangling
struct linkage name twice.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cae0cd6..2476919 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +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 diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index df8f863..64c9da0 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -12043,7 +12043,7 @@ dwarf2_name (struct die_info *die, struct dwarf2_cu *cu) 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) @@ -12052,7 +12052,10 @@ dwarf2_name (struct die_info *die, struct dwarf2_cu *cu) 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) { |