[Lldb-commits] [lldb] [lldb] Scope XML register type IDs to features (PR #216384)
Bar Soloveychik via lldb-commits
lldb-commits at lists.llvm.org
Mon Aug 17 10:23:45 PDT 2026
================
@@ -5043,8 +5046,20 @@ static void ParseEnums(
LLDB_LOG(log,
"ProcessGDBRemote::ParseEnums Found enum type \"{0}\"",
id);
- registers_enum_types.insert_or_assign(
- id, std::make_unique<RegisterTypeEnum>(id, enumerators));
+ auto enum_type =
+ std::make_unique<RegisterTypeEnum>(id, enumerators);
+ const RegisterTypeEnum *enum_type_ptr = enum_type.get();
+ auto [it, inserted] = register_types.try_emplace(id, enum_type_ptr);
+ if (inserted || llvm::isa<RegisterTypeEnum>(it->second)) {
----------------
barsolo2000 wrote:
You’re right. Replacing it is intentional: duplicate enum IDs use the last valid definition. This is safe because enums are parsed before flags. I split the cases and added a comment explaining it.
https://github.com/llvm/llvm-project/pull/216384
More information about the lldb-commits
mailing list