[Lldb-commits] [PATCH] D12677: Bug 24733: TestRegisters.py for Clang inferiors

Abhishek via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 7 08:44:22 PDT 2015


abhishek.aggarwal updated this revision to Diff 34161.
abhishek.aggarwal added a comment.

Clang/GCC generate different assembly for same inferior.

Changed a.cpp to remove dependency of TestRegisters.py on assembly
instructions generated by Clang/GCC.

Changed TestRegisters.py to write a generic test vector for testing
Bug 24457.


http://reviews.llvm.org/D12677

Files:
  test/functionalities/register/TestRegisters.py
  test/functionalities/register/a.cpp

Index: test/functionalities/register/a.cpp
===================================================================
--- test/functionalities/register/a.cpp
+++ test/functionalities/register/a.cpp
@@ -13,6 +13,7 @@
 {
     float a=2, b=4,c=8, d=16, e=32, f=64, k=128, l=256, add=0;
     __asm__ (
+        "int3 ;"
         "flds %1 ;"
         "flds %2 ;"
         "flds %3 ;"
Index: test/functionalities/register/TestRegisters.py
===================================================================
--- test/functionalities/register/TestRegisters.py
+++ test/functionalities/register/TestRegisters.py
@@ -36,7 +36,6 @@
         self.buildDefault()
         self.fp_register_write()
 
-    @expectedFailureClang("llvm.org/pr24733")
     def test_fp_special_purpose_register_read(self):
         """Test commands that read fpu special purpose registers."""
         if not self.getArchitecture() in ['amd64', 'i386', 'x86_64']:
@@ -168,15 +167,14 @@
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
 
-        # Find the line number to break inside a.cpp.
-        self.line = line_number('a.cpp', '// Set break point at this line.')
-
-        # Set breakpoint
-        lldbutil.run_break_set_by_file_and_line (self, "a.cpp", self.line, num_expected_locations=1, loc_exact=True)
-
         # Launch the process, and do not stop at the entry point.
         self.runCmd ("run", RUN_SUCCEEDED)
 
+        # Check stop reason; Should be SIGTRAP
+        stop_reason = 'stop reason = signal SIGTRAP'
+        self.expect("thread list", STOPPED_DUE_TO_SIGNAL,
+                      substrs = ['stopped', stop_reason])
+
         process = target.GetProcess()
         self.assertTrue(process.GetState() == lldb.eStateStopped,
                         PROCESS_STOPPED)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12677.34161.patch
Type: text/x-patch
Size: 1801 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150907/0b7abf33/attachment.bin>


More information about the lldb-commits mailing list