diff options
Diffstat (limited to 'gdb/dwarf2/read.h')
-rw-r--r-- | gdb/dwarf2/read.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h index 707dca9..fcf0cd7 100644 --- a/gdb/dwarf2/read.h +++ b/gdb/dwarf2/read.h @@ -353,11 +353,14 @@ public: void set_lang (enum language lang) { - /* We'd like to be more strict here, similar to what is done in - set_unit_type, but currently a partial unit can go from unknown to - minimal to ada to c. */ - if (m_lang != lang) + if (unit_type () == DW_UT_partial) + return; + if (m_lang == language_unknown) + /* Set if not set already. */ m_lang = lang; + else + /* If already set, verify that it's the same value. */ + gdb_assert (m_lang == lang); } /* Free any cached file names. */ |