aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r--gdb/dwarf2/cooked-index-shard.c3
-rw-r--r--gdb/dwarf2/cooked-index.c19
2 files changed, 7 insertions, 15 deletions
diff --git a/gdb/dwarf2/cooked-index-shard.c b/gdb/dwarf2/cooked-index-shard.c
index e440d85..58a0231 100644
--- a/gdb/dwarf2/cooked-index-shard.c
+++ b/gdb/dwarf2/cooked-index-shard.c
@@ -224,7 +224,8 @@ cooked_index_shard::finalize (const parent_map_map *parent_maps)
}
/* Note that this code must be kept in sync with
- language_requires_canonicalization. */
+ cooked_index::get_main -- if canonicalization is required
+ here, then a check might be required there. */
gdb_assert (entry->canonical == nullptr);
if ((entry->flags & IS_LINKAGE) != 0)
entry->canonical = entry->name;
diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c
index 6209590..fbcfe8f 100644
--- a/gdb/dwarf2/cooked-index.c
+++ b/gdb/dwarf2/cooked-index.c
@@ -32,19 +32,6 @@
here, and then these are all waited for before exit proceeds. */
static gdb::unordered_set<cooked_index *> active_vectors;
-/* Return true if LANG requires canonicalization. This is used
- primarily to work around an issue computing the name of "main".
- This function must be kept in sync with
- cooked_index_shard::finalize. */
-
-static bool
-language_requires_canonicalization (enum language lang)
-{
- return (lang == language_ada
- || lang == language_c
- || lang == language_cplus);
-}
-
cooked_index::cooked_index (cooked_index_worker_up &&worker)
: m_state (std::move (worker))
{
@@ -201,7 +188,11 @@ cooked_index::get_main () const
{
if ((entry->flags & IS_MAIN) != 0)
{
- if (!language_requires_canonicalization (entry->lang))
+ /* This should be kept in sync with
+ cooked_index_shard::finalize. Note that there, C
+ requires canonicalization -- but that is only for
+ types, 'main' doesn't count. */
+ if (entry->lang != language_ada && entry->lang != language_cplus)
{
/* There won't be one better than this. */
return entry;