[RFC] Showing register fields in LLDB

| DavidSpickett
August 18 |

  • | - |

GDB can show register fields generated from XML, I want to add that to LLDB

(lldb) register read cpsr
    cpsr = 0x60001000
> N | Z | C | V | TCO | DIT | UAO | PAN | SS | IL | SSBS | BTYPE | D | A | I | F | nRW | EL | SP |
> 0 | 1 | 1 | 0 |  0  |  0  |  0  |  0  | 0  | 0  |  1   |   0   | 0 | 0 | 0 | 0 |  0  | 0  | 0  |

(formatting very much TBC, suggestions welcome!)

Would it be much harder to read if we treated the cpsr as a “fake structure” and presented the fields as we would any other structure? The reason I ask is that all our register printing is done by getting the register value into a ValueObject, and then printing that. So the most natural implementation in lldb would be to make a synthetic child provider that we attach by hand to these register ValueObjects that knows how to chop up the fields (using your XML description presumably). We also have intended for most of llldb’s history to add a “set value” capability to the Synthetic Child providers, so using the child provider will lead naturally to a way of setting the values as well. Plus, the disclosure form is going to work better in a GUI register display…

Jim