[Lldb-commits] [lldb] [lldb] Add format eFormatEnumWithValues to ensure raw enum value is always shown (PR #90059)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Mon Jul 29 06:34:57 PDT 2024
DavidSpickett wrote:
> So instead of using enum for the field why not a union of enum and unsigned.
The union idea sort of works, but it's clunky enough I'm not going to pursue it. The most verbose version:
```
fpcr = 0x00000000
= {
<...>
RMode = (meaning = RN, value = 0)
```
Then you can set a decl printing helper and match on the generated type names to remove
some of it:
```
fpcr = 0x00000000
= {
<...>
RMode = {
RN
RMode = 0
}
```
With a typedef I could remove the final "RMode", right now it's "unsigned int:2" so the
helper doesn't kick in.
Seems to force vertical layout, and the two values will always be on separate lines.
This looks awkward enough that I'd rather just keep the existing format.
Now I'll see if I can use the existing dump code for all but the enums, as you suggested.
https://github.com/llvm/llvm-project/pull/90059
More information about the lldb-commits
mailing list