[Lldb-commits] [lldb] [lldb] New expedited register specfication for unavailable regs (PR #193894)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Mon May 4 23:02:14 PDT 2026


================
@@ -274,23 +295,31 @@ bool GDBRemoteRegisterContext::ReadRegisterBytes(const RegisterInfo *reg_info) {
           success = false;
         else {
           // Read the containing register if it hasn't already been read
-          if (!GetRegisterIsValid(prim_reg))
+          if (GetRegisterIsUnfetched(prim_reg))
             success = GetPrimordialRegister(prim_reg_info, gdb_comm);
----------------
JDevlieghere wrote:

I think this is what we talked about last week, but IIUC, `GetPrimordialRegister` returns false in two cases:

1. Debugserver replied with `E20` which is what this PR is optimizing. In this calling `SetRegisterIsUnavailable` is correct.
2. The response was short or malformed. This is already handled by `PrivateSetRegisterValue` which says:
```
  } else if (data.size() > 0) {
    // Only set register is valid to false if we copied some bytes, else leave
    // it as it was.
    SetRegisterIsValid(reg, false);
  }
```
but now we're immediately calling `SetRegisterIsUnavailable` after marking it as unavailable. It seems like we should distinguish the two failure modes and only call `SetRegisterIsUnavailable` after (1).

https://github.com/llvm/llvm-project/pull/193894


More information about the lldb-commits mailing list