================
@@ -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
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to