[all-commits] [llvm/llvm-project] 6ea45e: [lldb] Add RegisterFlags class

David Spickett via All-commits all-commits at lists.llvm.org
Thu Apr 13 03:55:07 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6ea45e3007b8a489afa56af13a2b8bfcec201a93
      https://github.com/llvm/llvm-project/commit/6ea45e3007b8a489afa56af13a2b8bfcec201a93
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2023-04-13 (Thu, 13 Apr 2023)

  Changed paths:
    A lldb/include/lldb/Target/RegisterFlags.h
    M lldb/source/Target/CMakeLists.txt
    A lldb/source/Target/RegisterFlags.cpp
    M lldb/unittests/Target/CMakeLists.txt
    A lldb/unittests/Target/RegisterFlagsTest.cpp

  Log Message:
  -----------
  [lldb] Add RegisterFlags class

This models the "flags" node from GDB's target XML:
https://sourceware.org/gdb/onlinedocs/gdb/Target-Description-Format.html

This node is used to describe the fields of registers like cpsr on AArch64.

RegisterFlags is a class that contains a list of register fields.
These fields will be extracted from the XML sent by the remote.

We assume that there is at least one field, that the fields are
sorted in descending order and do not overlap. That will be
enforced by the XML processor (the GDB client code in our case).

The fields may not cover the whole register. To account for this
RegisterFields will add anonymous padding fields so that
sizeof(all fields) == sizeof(register). This will save a lot
of hasssle later.

Reviewed By: jasonmolenda, JDevlieghere

Differential Revision: https://reviews.llvm.org/D145566




More information about the All-commits mailing list