[all-commits] [llvm/llvm-project] 310152: [lldb] Print "0x0" for bitfield like enums where t...
David Spickett via All-commits
all-commits at lists.llvm.org
Wed Jul 3 06:49:09 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 31015240d366e4bf6f114856caa6e9ce90742b7f
https://github.com/llvm/llvm-project/commit/31015240d366e4bf6f114856caa6e9ce90742b7f
Author: David Spickett <david.spickett at linaro.org>
Date: 2024-07-03 (Wed, 03 Jul 2024)
Changed paths:
M lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
M lldb/unittests/ValueObject/DumpValueObjectOptionsTests.cpp
Log Message:
-----------
[lldb] Print "0x0" for bitfield like enums where the value is 0 (#97557)
Enums like this one are treated as bitfield like enums: enum FlagsLike
{B=2, C=4};
lldb recognises them as collections of flags, so you can have "B | C".
If there's any values not covered that's printed as hex "B | C | 0x1".
What happened if the value was 0 was we would not match any of the
enumerators, then the remainder check requires that the remainder is
non-zero. So lldb would print nothing at all.
Which I assume is a bug because knowing that no flags are set is useful,
just as much as knowing that some unkown bit was set to make it
non-zero.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list