================ @@ -0,0 +1,190 @@ +Using LLDB On AArch64 Linux +=========================== + +This page explains the details of debugging certain AArch64 extensions using +LLDB. If something is not mentioned here, it likely works as you would expect. + +This is not a replacement for ptrace and Linux Kernel documentation. This covers +how LLDB has chosen to use those things and how that effects your experience as +a user. + +Scalable Vector Extension (SVE) +------------------------------- + +See `here <https://developer.arm.com/Architectures/Scalable%20Vector%20Extensions>`__ +to learn about the extension and `here <https://kernel.org/doc/html/latest/arch/arm64/sve.html>`__ +for the Linux Kernel's handling of it. + +In LLDB you will be able to see the following new registers: + +* ``z0-z31`` vector registers, each one has size equal to the vector length. +* ``p0-p15`` predicate registers, each one containing 1 bit per byte in the vector + length. Making each one vector length / 8 sized. +* ``ffr`` the first fault register, same size as a predicate register. +* ``vg``, the vector length in "granules". Each granule is 8 bytes. + +.. code-block:: + + Scalable Vector Extension Registers: + vg = 0x0000000000000002 + z0 = {0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 <...> } + <...> + p0 = {0xff 0xff} + <...> + ffr = {0xff 0xff} + +The example above has a vector length of 16 bytes. Within LLDB you will always +see "vg" as in the ``vg`` register, which is 2 in this case (8*2 = 16). +Elsewhere you may see "vq" which is the vector length in quadwords (16 bytes) +elsewhere. Where you see "vl", it is in bytes. + +Changing the Vector Length +.......................... + +While you can count the size of a P or Z register, it is intended that ``vg`` be +used to find the current vector length. + +vg can be written. Writing the current vector length changes nothing. If you +increase the vector length, the registers will likely be reset to 0. If you +decrease it, LLDB will truncate the Z registers but everything else will be reset +to 0. + +Generally you should not assume that SVE state after changing the vector length ---------------- DavidSpickett wrote:
I've clarified that users should not trust the content after a length change, from either lldb or the debugee. Same rule applies. https://github.com/llvm/llvm-project/pull/66767 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits