Introducing a temporary work-around for a register mapping problem with 32-bit Linux...
authorAndrew Kaylor <andrew.kaylor@intel.com>
Wed, 21 Aug 2013 22:46:02 +0000 (22:46 +0000)
committerAndrew Kaylor <andrew.kaylor@intel.com>
Wed, 21 Aug 2013 22:46:02 +0000 (22:46 +0000)
llvm-svn: 188954

lldb/source/Target/RegisterContext.cpp

index 0d89db7..b422ef3 100644 (file)
@@ -456,6 +456,15 @@ RegisterContext::CalculateExecutionContext (ExecutionContext &exe_ctx)
 bool
 RegisterContext::ConvertBetweenRegisterKinds (int source_rk, uint32_t source_regnum, int target_rk, uint32_t& target_regnum)
 {
+    // FIXME: This works around a problem with 32-bit register mapping on Linux.
+    // A more general fix is needed.
+    if (target_rk == eRegisterKindLLDB)
+    {
+        target_regnum = ConvertRegisterKindToRegisterNumber(source_rk, source_regnum);
+        if (target_regnum != LLDB_INVALID_REGNUM)
+            return true;
+    }
+
     const uint32_t num_registers = GetRegisterCount();
     for (uint32_t reg = 0; reg < num_registers; ++reg)
     {