Issue 234225
Summary LLDB does not correctly handle QEMU's description of AArch64 SVE's predicate registers
Labels new issue
Assignees
Reporter DavidSpickett
    Example code from https://github.com/llvm/llvm-project/issues/87471#issuecomment-5729159625.

A predicate register has 1 bit for each byte of the vector length. I think QEMU is trying its best to describe this as basically `std::vector<bool>`:
```
<vector id="svep" type="uint8" count="256"/>
<reg name="p0" bitsize="256" regnum="68" type="svep"/>
```
The problem is that the smallest type it can use is `uint8`, so for a vector length of 256 bytes we have a type that is 256 bytes rather than 256 bits.
```
lldb             ID: "svep" Element type: "uint8" Count: 256
<...>
lldb ProcessGDBRemote::ParseRegisters Size of register type svep (256 bytes) for register p0 does not match the register size (32 bytes). Ignoring this type.
```
Which lldb quite correctly ignores:
```
(lldb) register read vg p0
  vg = 0x0000000000000020
  p0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 <...>}
```
GDB seems to be using the type. Even when stopped with vector length 64 (8*8), it shows a 256 byte p0:
```
(gdb) info registers vg p0
vg             0x8                 8
p0 {0x0 <repeats 32 times>, 0x88, 0xc6, 0xb7, <...>}
```
The values are not all 0 or 1, so it's not converting each bit into a byte.

The ideal view is something like this.
```
  p0 = {0, 0, 0, 1, 1, 1, 0, .....}
```
 Which can then be indexed easily like `p0[1]`. The indexing part should "just work" if we had the right type description, but I don't think we have a way to describe a "bit vector".
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to