Author: emaste
Date: Tue Feb 18 09:12:35 2014
New Revision: 201577

URL: http://llvm.org/viewvc/llvm-project?rev=201577&view=rev
Log:
elf-core: support 32- and 64-bit x86 registers

This way the same RegisterContext class can support i386 and
amd64/x86_64 core files.

With some further refinement we should be able to merge all of the
processor-specific RegisterContextPOSIX_* classes into a single shared
one.

Modified:
    
lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp

Modified: 
lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp?rev=201577&r1=201576&r2=201577&view=diff
==============================================================================
--- 
lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp 
Tue Feb 18 09:12:35 2014
@@ -63,8 +63,16 @@ RegisterContextCorePOSIX_x86_64::WriteFP
 bool
 RegisterContextCorePOSIX_x86_64::ReadRegister(const RegisterInfo *reg_info, 
RegisterValue &value)
 {
-    value = *(uint64_t *)(m_gpregset + reg_info->byte_offset);
-    return true;
+    switch (reg_info->byte_size)
+    {
+        case 4:
+            value = *(uint32_t *)(m_gpregset + reg_info->byte_offset);
+            return true;
+        case 8:
+            value = *(uint64_t *)(m_gpregset + reg_info->byte_offset);
+            return true;
+    }
+    return false;
 }
 
 bool


_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to