Issue 234215
Summary lldb should have a way to print all levels of a register type
Labels lldb
Assignees
Reporter DavidSpickett
    This comes up with QEMU's description of SVE registers which are a union of unions of vectors with different element sizes and types. Example program from https://github.com/llvm/llvm-project/issues/87471#issuecomment-5729159625.
```
(lldb) register read z0
<...>
     = {
         q = {
           u =
```
Here I see the inner field names, though with so much output it's very hard to pick out anything beyond the first. If I print the first union:
```
(lldb) register read z0.q
  z0.q = {
  (36346553384763581871632909800112128, <...>)
  (36346553384763581871632909800112128, <...>)
}
```
I do not get the `u =` and `s =`, which would be nice to see. That way I could build up the _expression_ step by step by looking at the outputs. But assume I know about `u` from the first output, I can use that:
```
(lldb) register read z0.q.u
  z0.q.u = (36346553384763581871632909800112128,
```
This looks like an array, so I can do:
```
(lldb) register read z0.q.u[0]
  z0.q.u[0] = 36346553384763581871632909800112128
```
And now I've built my _expression_.

`register info` is a natural place to list all the types, currently we get only the first level of the union:
```
(lldb) register info z0
       Name: z0
       Size: 256 bytes (2048 bits)
Invalidates: v0, s0, d0
    In sets: general (index 0)

  Union members:
    q (svevnq, 256 bytes)
    d (svevnd, 256 bytes)
    s (svevns, 256 bytes)
 h (svevnh, 256 bytes)
    b (svevnb, 256 bytes)
```
This should print the nested types.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to