[Lldb-commits] [lldb] 4283320 - [LLDB] Fix SVE offset calculation in NativeRegisterContextLinux_arm64

Muhammad Omair Javaid via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 24 16:42:56 PDT 2020


Author: Muhammad Omair Javaid
Date: 2020-08-25T03:54:41+05:00
New Revision: 4283320b7286dc94367b22df09499dc934e1fbf9

URL: https://github.com/llvm/llvm-project/commit/4283320b7286dc94367b22df09499dc934e1fbf9
DIFF: https://github.com/llvm/llvm-project/commit/4283320b7286dc94367b22df09499dc934e1fbf9.diff

LOG: [LLDB] Fix SVE offset calculation in NativeRegisterContextLinux_arm64

There was typo left from changes in CalculateSVEOffset where we moved
FPSR/FPCR offset calculation into WriteRegister and ReadRegister.

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

Added: 
    

Modified: 
    lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
index f7b398ce620d..0aef36c7e231 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
@@ -118,7 +118,7 @@ NativeRegisterContextLinux_arm64::ReadRegister(const RegisterInfo *reg_info,
                                                : "<unknown register>");
 
   uint8_t *src;
-  uint32_t offset;
+  uint32_t offset = LLDB_INVALID_INDEX32;
   uint64_t sve_vg;
   std::vector<uint8_t> sve_reg_non_live;
 
@@ -172,7 +172,6 @@ NativeRegisterContextLinux_arm64::ReadRegister(const RegisterInfo *reg_info,
         offset = CalculateSVEOffset(GetRegisterInfoAtIndex(sve_reg_num));
       }
 
-      offset = CalculateSVEOffset(reg_info);
       assert(offset < GetSVEBufferSize());
       src = (uint8_t *)GetSVEBuffer() + offset;
     }
@@ -234,7 +233,7 @@ Status NativeRegisterContextLinux_arm64::WriteRegister(
                                                : "<unknown register>");
 
   uint8_t *dst;
-  uint32_t offset;
+  uint32_t offset = LLDB_INVALID_INDEX32;
   std::vector<uint8_t> sve_reg_non_live;
 
   if (IsGPR(reg)) {
@@ -291,7 +290,6 @@ Status NativeRegisterContextLinux_arm64::WriteRegister(
         offset = CalculateSVEOffset(GetRegisterInfoAtIndex(sve_reg_num));
       }
 
-      offset = CalculateSVEOffset(reg_info);
       assert(offset < GetSVEBufferSize());
       dst = (uint8_t *)GetSVEBuffer() + offset;
       ::memcpy(dst, reg_value.GetBytes(), reg_info->byte_size);


        


More information about the lldb-commits mailing list