[Lldb-commits] [PATCH] D93396: [lldb] [Process/FreeBSDRemote] Replace GetRegisterSetCount()

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Dec 16 06:54:09 PST 2020


mgorny created this revision.
mgorny added reviewers: labath, emaste, krytarowski.
mgorny requested review of this revision.

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.


https://reviews.llvm.org/D93396

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


Index: lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
===================================================================
--- lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
+++ lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
@@ -288,13 +288,7 @@
 }
 
 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 *


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93396.312199.patch
Type: text/x-patch
Size: 672 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20201216/770689af/attachment.bin>


More information about the lldb-commits mailing list