[Lldb-commits] [lldb] r181737 - Prevent convenience registers from being included in "read register" as they are derived registers.

Ashok Thirumurthi ashok.thirumurthi at intel.com
Mon May 13 14:45:50 PDT 2013


Author: athirumu
Date: Mon May 13 16:45:50 2013
New Revision: 181737

URL: http://llvm.org/viewvc/llvm-project?rev=181737&view=rev
Log:
Prevent convenience registers from being included in "read register" as they are derived registers.

- Also refactors TestRegisters.py because test_convenience_registers_with_process_attach now fails with an assert.

TODO: Cross-reference the skipOnLinux decorator with a bugzilla report after root-causing this issue.

Modified:
    lldb/trunk/source/Plugins/Process/POSIX/RegisterContext_x86_64.cpp
    lldb/trunk/test/functionalities/register/TestRegisters.py

Modified: lldb/trunk/source/Plugins/Process/POSIX/RegisterContext_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/POSIX/RegisterContext_x86_64.cpp?rev=181737&r1=181736&r2=181737&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/POSIX/RegisterContext_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/POSIX/RegisterContext_x86_64.cpp Mon May 13 16:45:50 2013
@@ -314,9 +314,12 @@ g_reg_sets[k_num_register_sets] =
     { #reg, alt, 0, 0, eEncodingUint,                              \
       eFormatHex, { kind1, kind2, kind3, kind4, gpr_##reg }, NULL, NULL }
 
+// Dummy data for RegisterInfo::value_regs as expected by DumpRegisterSet. 
+static uint32_t value_regs = LLDB_INVALID_REGNUM;
+
 #define DEFINE_GPR_i386(reg_i386, reg_x86_64, alt, kind1, kind2, kind3, kind4) \
     { #reg_i386, alt, GPR_i386_SIZE(reg_i386), 0, eEncodingUint,   \
-      eFormatHex, { kind1, kind2, kind3, kind4, gpr_##reg_i386 }, NULL, NULL }
+      eFormatHex, { kind1, kind2, kind3, kind4, gpr_##reg_i386 }, &value_regs, NULL }
 
 #define DEFINE_FPR(reg, kind1, kind2, kind3, kind4)                \
     { #reg, NULL, FPR_SIZE(reg), FPR_OFFSET(reg), eEncodingUint,   \

Modified: lldb/trunk/test/functionalities/register/TestRegisters.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/register/TestRegisters.py?rev=181737&r1=181736&r2=181737&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/register/TestRegisters.py (original)
+++ lldb/trunk/test/functionalities/register/TestRegisters.py Mon May 13 16:45:50 2013
@@ -45,7 +45,7 @@ class RegisterCommandsTestCase(TestBase)
         self.buildDefault()
         self.convenience_registers()
 
-    @expectedFailureLinux # bugzilla 14600 - Convenience registers not fully supported on Linux
+    @skipOnLinux # Expression evaluation fails after attach by pid
     def test_convenience_registers_with_process_attach(self):
         """Test convenience registers after a 'process attach'."""
         if not self.getArchitecture() in ['x86_64']:
@@ -202,10 +202,14 @@ class RegisterCommandsTestCase(TestBase)
         """Test convenience registers."""
         self.common_setup()
 
-        # The command "register read -a" does output a derived register like eax.
+        # The command "register read -a" does output a derived register like eax...
         self.expect("register read -a", matching=True,
             substrs = ['eax'])
 
+        # ...however, the vanilla "register read" command should not output derived registers like eax.
+        self.expect("register read", matching=False,
+            substrs = ['eax'])
+        
         # Test reading of rax and eax.
         self.expect("register read rax eax",
             substrs = ['rax = 0x', 'eax = 0x'])
@@ -231,12 +235,9 @@ class RegisterCommandsTestCase(TestBase)
         # Check that "register read eax" works.
         self.runCmd("register read eax")
 
-        # The vanilla "register read" command should not output derived registers like eax.
-        self.expect("register read", matching=False,
-            substrs = ['eax'])
-        
         self.expect("expr -- ($rax & 0xffffffff) == $eax",
             substrs = ['true'])
+
         self.expect("expr -- $ax == (($ah << 8) | $al)",
             substrs = ['true'])
 





More information about the lldb-commits mailing list