/* See cooked-index.h. */
const char *
-cooked_index_entry::full_name (struct obstack *storage, bool for_main) const
+cooked_index_entry::full_name (struct obstack *storage, bool for_main,
+ const char *default_sep) const
{
const char *local_name = for_main ? name : canonical;
if ((flags & IS_LINKAGE) != 0 || get_parent () == nullptr)
return local_name;
- const char *sep = nullptr;
+ const char *sep = default_sep;
switch (lang)
{
case language_cplus:
break;
default:
- return local_name;
+ if (sep == nullptr)
+ return local_name;
+ break;
}
get_parent ()->write_scope (storage, sep, for_main);
gdb_printf (" [%zu] ((cooked_index_entry *) %p)\n", i++, entry);
gdb_printf (" name: %s\n", entry->name);
gdb_printf (" canonical: %s\n", entry->canonical);
- gdb_printf (" qualified: %s\n", entry->full_name (&temp_storage, false));
+ gdb_printf (" qualified: %s\n",
+ entry->full_name (&temp_storage, false, "::"));
gdb_printf (" DWARF tag: %s\n", dwarf_tag_name (entry->tag));
gdb_printf (" flags: %s\n", to_string (entry->flags).c_str ());
gdb_printf (" DIE offset: %s\n", sect_offset_str (entry->die_offset));
STORAGE. FOR_MAIN is true if we are computing the name of the
"main" entry -- one marked DW_AT_main_subprogram. This matters
for avoiding name canonicalization and also a related race (if
- "main" computation is done during finalization). */
- const char *full_name (struct obstack *storage, bool for_main = false) const;
+ "main" computation is done during finalization). If the language
+ doesn't prescribe a separator, one can be specified using
+ DEFAULT_SEP. */
+ const char *full_name (struct obstack *storage, bool for_main = false,
+ const char *default_sep = nullptr) const;
/* Comparison modes for the 'compare' function. See the function
for a description. */