[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 07:23:23 PDT 2024
DavidSpickett wrote:
Custom printing code for just enums for registers would be possible but it means copying a lot of existing code. A callback reduces that to a copy of `DumpEnumValue` only. Or you can iterate the value object yourself but then you have to provide the surrounding format too for example the `{}` around a struct and so on.
I found I can modify the summary by changing `TypeFormatImpl_Format::FormatObject`, but this has the problem that it does not know if the enum value will match an enumerator ahead of time. So it works well for `<value> <unconditional extra stuff>`, but not if you only sometimes want the extra stuff. So another lookahead or callback needed here.
None of the options are great and this is not a required feature so I'm going to drop this for now. Maybe one of them will stand out when I look again later.
https://github.com/llvm/llvm-project/pull/90059
More information about the lldb-commits
mailing list