Skip to content

Commit 3898939

Browse files
Rollup merge of rust-lang#157298 - Walnut356:msvc_enum, r=jieyouxu
Use alternate means of detecting enums in `is_udt` This fixes a small regression from rust-lang#155336 Flat enums are excluded from `is_udt` since LLDB natively handles them correctly. The previous logic (`SBType.IsScopedEnumerationType()`) behaved correctly for non-msvc targets, but for some reason on msvc enums don't count as scoped enumerations? The new logic checks the type returned by `SBType.GetEnumerationIntegerType()`. If the queried type isn't an enum, the returned type is invalid. This behaves correctly on both msvc and non-msvc targets, and its behavior doesn't conflict with sum-type enums. As always, testing on msvc isn't really possible atm. That should change soon though =) --- try-job: aarch64-apple
2 parents 0a79d4d + 4362cc3 commit 3898939

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/etc/lldb_lookup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ def arc_synthetic(valobj: lldb.SBValue, _dict: LLDBOpaque) -> object:
395395
def is_udt(type: lldb.SBType, _dict: LLDBOpaque) -> bool:
396396
return (
397397
type.GetBasicType() == lldb.eBasicTypeInvalid
398-
and not type.IsScopedEnumerationType()
398+
and not type.GetEnumerationIntegerType().IsValid()
399399
and not type.IsPointerType()
400400
and not type.IsArrayType()
401401
)

0 commit comments

Comments
 (0)