[Lldb-commits] [PATCH] D96460: [LLDB] Arm64/Linux Add MTE and Pointer Authentication registers

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 16 08:46:55 PST 2021


DavidSpickett added inline comments.


================
Comment at: lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp:1198
+
+  if (m_mte_ctrl_is_valid)
+    return error;
----------------
omjavaid wrote:
> DavidSpickett wrote:
> > Just to confirm I understand this logic.
> > 
> > If `m_mte_ctrl_is_valid` would mean that our cached value of the register is valid. So if something tries to read a new copy of it we fail because they should have used the cached version?
> > 
> > Then if `m_mte_ctrl_is_valid` is false, our cache is out of date so we do the read.
> > 
> > Seems odd to error on asking for a read of a value that is cached but then again I don't know the surrounding code too well. If that pattern is already established no point disturbing it now.
> Status is used to hold error codes and default error code is 'success'. If we have a valid cache value that means we dont need to read and return success thats why returning error without setting the error code.
> 
> If we need to read then we call ReadRegisterSet which will set the error code in case of failure.
Doh, yes I missed that that "error" will not be a failure at that point.


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

https://reviews.llvm.org/D96460



More information about the lldb-commits mailing list