+2019-08-25 Simon Marchi <simon.marchi@efficios.com>
+
+ * dwarf2read.c (dw2_debug_names_iterator::next): Use enum to
+ represent whether the symbol is static, dynamic, or we don't
+ know.
+
2019-08-25 Yoshinori Sato <ysato@users.sourceforge.jp>
* gdb/rx-tdep.c (rx_register_names): New.
return NULL;
}
const mapped_debug_names::index_val &indexval = indexval_it->second;
- gdb::optional<bool> is_static;
+ enum class symbol_linkage {
+ unknown,
+ static_,
+ extern_,
+ } symbol_linkage = symbol_linkage::unknown;
dwarf2_per_cu_data *per_cu = NULL;
for (const mapped_debug_names::index_val::attr &attr : indexval.attr_vec)
{
case DW_IDX_GNU_internal:
if (!m_map.augmentation_is_gdb)
break;
- is_static = true;
+ symbol_linkage = symbol_linkage::static_;
break;
case DW_IDX_GNU_external:
if (!m_map.augmentation_is_gdb)
break;
- is_static = false;
+ symbol_linkage = symbol_linkage::extern_;
break;
}
}
goto again;
/* Check static vs global. */
- if (is_static.has_value () && m_block_index.has_value ())
+ if (symbol_linkage != symbol_linkage::unknown && m_block_index.has_value ())
{
const bool want_static = *m_block_index == STATIC_BLOCK;
- if (want_static != *is_static)
+ const bool symbol_is_static = symbol_linkage == symbol_linkage::static_;
+ if (want_static != symbol_is_static)
goto again;
}