[Lldb-commits] [lldb] [lldb] Add value to enumerator dump (PR #69815)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 16 02:09:53 PST 2023


DavidSpickett wrote:

I would be interested in at least having a way to opt into this style, it would be useful for registers for example here where I am experimenting with defining `TCF` as an enum:
```
(lldb) register read mte_ctrl
mte_ctrl = 0x000000000007fffb
         = (TAGS = 65535, TCF = TCF_SYNC(1), TAGGED_ADDR_ENABLE = 1)
```
Having the numerical value is really useful and saves a trip to the manual (or in this case, kernel sources).

For this use case I'm setting options in `lldb_private::DumpValueObjectOptions` down in C++ but I'm not sure if those directly map to what a formatter would have access to.

Assuming they do somehow have the same control, would it be viable to add an option that a formatter could pass when it knows it wants the name plus the value? Instead of changing the global behaviour.

@Endilll would that work for the types you're working with?

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


More information about the lldb-commits mailing list