diff options
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r-- | gdb/ada-lang.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 3c04554..d9b46c6 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -5871,28 +5871,21 @@ ada_iterate_over_symbols (const struct block *block, } /* If NAME is the name of an entity, return a string that should - be used to look that entity up in Ada units. This string should - be deallocated after use using xfree. + be used to look that entity up in Ada units. NAME can have any form that the "break" or "print" commands might recognize. In other words, it does not have to be the "natural" name, or the "encoded" name. */ -char * +std::string ada_name_for_lookup (const char *name) { - char *canon; int nlen = strlen (name); if (name[0] == '<' && name[nlen - 1] == '>') - { - canon = (char *) xmalloc (nlen - 1); - memcpy (canon, name + 1, nlen - 2); - canon[nlen - 2] = '\0'; - } + return std::string (name + 1, nlen - 2); else - canon = xstrdup (ada_encode (ada_fold_name (name))); - return canon; + return ada_encode (ada_fold_name (name)); } /* The result is as for ada_lookup_symbol_list with FULL_SEARCH set |