Skip to content

LLDB SVE predicate variables displayed incorrectly #159291

@yury-khrustalev

Description

@yury-khrustalev

LLDB does not display SVE predicate variables (of type svbool_t) correctly:

  1. Even with DW_AT_bit_stride set correctly for svbool_t (see clang DWARF SVE predicate type does not have DW_AT_bit_stride #159285), LLDB reads 1 byte for an element of the predicate vector.
  2. LLDB always reads 64 bits for a predicate vector implying vector length 512 bits.

For code

svbool_t pred16 = svwhilelt_b16_u32 (0u, 5u);

For VL = 512 bits:

(lldb) p/t *(uint64_t*)&pred16
(uint64_t) 0b0000000000000000000000000000000000000000000000000000000101010101
(lldb) p pred16
(bool __attribute__((ext_vector_type(8)))) (true, true, false, false, false, false, false, false)

For VL = 256 bits:

(lldb) p/t *(uint64_t*)&pred16
(uint64_t) 0b1010101010101010000001111011010000000000000000000000000101010101
(lldb) p pred16
(bool __attribute__((ext_vector_type(8)))) (true, true, false, false, true, true, true, true)

Notice that LLDB treats 1st byte 01010101 as true and then 2nd byte 00000001 as true while this was supposed to be several elements.

In the second example (for VL = 256 bits) LLDB reads memory beyond 32 bits of the predicate vector.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions