[Lldb-commits] [lldb] [lldb] Print "0x0" for bitfield like enums where the value is 0 (PR #97557)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 3 04:23:45 PDT 2024


DavidSpickett wrote:

There is a comment in this function:
```
  // Try to find an exact match for the value.
  // At the same time, we're applying a heuristic to determine whether we want
  // to print this enum as a bitfield. We're likely dealing with a bitfield if
  // every enumerator is either a one bit value or a superset of the previous
  // enumerators. Also 0 doesn't make sense when the enumerators are used as
  // flags.
```
The last sentence is ambiguous, but I think it refers to *enumerators* of 0, not the value being 0. If I'm wrong, I haven't found any other clues as to why printing nothing for a value of 0x0 makes sense. I think it's just an oversight.

https://github.com/llvm/llvm-project/pull/97557


More information about the lldb-commits mailing list