[Lldb-commits] [lldb] r185947 - Change TestRegisters.py attach case to attach to a.out and enable that test case

Andrew Kaylor andrew.kaylor at intel.com
Tue Jul 9 09:48:30 PDT 2013


Author: akaylor
Date: Tue Jul  9 11:48:30 2013
New Revision: 185947

URL: http://llvm.org/viewvc/llvm-project?rev=185947&view=rev
Log:
Change TestRegisters.py attach case to attach to a.out and enable that test case

Modified:
    lldb/trunk/test/functionalities/register/TestRegisters.py
    lldb/trunk/test/functionalities/register/main.cpp

Modified: lldb/trunk/test/functionalities/register/TestRegisters.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/register/TestRegisters.py?rev=185947&r1=185946&r2=185947&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/register/TestRegisters.py (original)
+++ lldb/trunk/test/functionalities/register/TestRegisters.py Tue Jul  9 11:48:30 2013
@@ -45,7 +45,6 @@ class RegisterCommandsTestCase(TestBase)
         self.buildDefault()
         self.convenience_registers()
 
-    @skipIfLinux # llvm.org/pr16301 LLDB occasionally exits with SIGABRT 
     def test_convenience_registers_with_process_attach(self):
         """Test convenience registers after a 'process attach'."""
         if not self.getArchitecture() in ['x86_64']:
@@ -236,14 +235,14 @@ class RegisterCommandsTestCase(TestBase)
 
     def convenience_registers_with_process_attach(self, test_16bit_regs):
         """Test convenience registers after a 'process attach'."""
-        exe = self.lldbHere
+        exe = os.path.join(os.getcwd(), "a.out")
 
         # Spawn a new process
         pid = 0
         if sys.platform.startswith('linux'):
-            pid = self.forkSubprocess(exe, [self.lldbOption])
+            pid = self.forkSubprocess(exe, ['wait_for_attach'])
         else:
-            proc = self.spawnSubprocess(exe, [self.lldbOption])
+            proc = self.spawnSubprocess(exe, ['wait_for_attach'])
             pid = proc.pid
         self.addTearDownHook(self.cleanupSubprocesses)
 

Modified: lldb/trunk/test/functionalities/register/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/register/main.cpp?rev=185947&r1=185946&r2=185947&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/register/main.cpp (original)
+++ lldb/trunk/test/functionalities/register/main.cpp Tue Jul  9 11:48:30 2013
@@ -7,11 +7,21 @@
 //
 //===----------------------------------------------------------------------===//
 #include <stdio.h>
+#include <unistd.h>
 
 int main (int argc, char const *argv[])
 {
     char my_string[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 0};
     double my_double = 1234.5678;
+
+    // For simplicity assume that any cmdline argument means wait for attach.
+    if (argc > 1)
+    {
+        volatile int wait_for_attach=1;
+        while (wait_for_attach)
+            usleep(1);
+    }
+
     printf("my_string=%s\n", my_string);
     printf("my_double=%g\n", my_double);
     return 0;





More information about the lldb-commits mailing list