[Lldb-commits] [lldb] 9ead4e7 - [lldb] [Process/FreeBSDRemote] Replace GetRegisterSetCount()

Michał Górny via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 17 09:02:10 PST 2020


Author: Michał Górny
Date: 2020-12-17T18:01:14+01:00
New Revision: 9ead4e7b4a68d162122d861f5d5b6a3baf8d23c1

URL: https://github.com/llvm/llvm-project/commit/9ead4e7b4a68d162122d861f5d5b6a3baf8d23c1
DIFF: https://github.com/llvm/llvm-project/commit/9ead4e7b4a68d162122d861f5d5b6a3baf8d23c1.diff

LOG: [lldb] [Process/FreeBSDRemote] Replace GetRegisterSetCount()

Replace the wrong code in GetRegisterSetCount() with a constant return.
The original code passed register index in place of register set index,
effectively getting always true.  Correcting the code to check for
register set existence is not possible as LLDB supports only eliminating
last register sets.  Just return the full number for now which should
be NFC.

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

Added: 
    

Modified: 
    lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
index 8f1ba2eb4137..740ac522d303 100644
--- a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
+++ b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
@@ -288,13 +288,7 @@ NativeRegisterContextFreeBSD_x86_64::NativeRegisterContextFreeBSD_x86_64(
 }
 
 uint32_t NativeRegisterContextFreeBSD_x86_64::GetRegisterSetCount() const {
-  uint32_t sets = 0;
-  for (uint32_t set_index = 0; set_index < k_num_register_sets; ++set_index) {
-    if (GetSetForNativeRegNum(set_index))
-      ++sets;
-  }
-
-  return sets;
+  return k_num_register_sets;
 }
 
 const RegisterSet *


        


More information about the lldb-commits mailing list