[Lldb-commits] [PATCH] D109876: [lldb] [ABI/AArch64] Add pseudo-regs if missing

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 11 04:51:30 PDT 2021


labath accepted this revision.
labath added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp:112-118
+  for (int i = 0; i < 32; i++) {
+    x_regs[i] = LLDB_INVALID_REGNUM;
+    v_regs[i] = LLDB_INVALID_REGNUM;
+    have_w_regs[i] = false;
+    have_s_regs[i] = false;
+    have_d_regs[i] = false;
+  }
----------------
This might be reason enough to make me replace array<uint32_t> with array<Optional<uint32_t> and array<bool> with std::bitset


================
Comment at: lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp:149-153
+  for (int i = 0; i < 32; i++) {
+    if (!have_w_regs[i])
+      addPartialRegister(regs, x_regs[i], 8, llvm::formatv("w{0}", i), 4,
+                         lldb::eEncodingUint, lldb::eFormatHex);
+  }
----------------
It might be worth making a utility function for this as well (or maybe moving the for loop into the existing utility function).


================
Comment at: lldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py:383
             def writeRegisters(self, reg_hex):
+                reg_data[:] = [reg_hex]
                 return "OK"
----------------
what's up with the [:]? Can we just drop that?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109876/new/

https://reviews.llvm.org/D109876



More information about the lldb-commits mailing list