[PATCH] D26617: add FreeBSD elf-core test

Ed Maste via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 14 09:42:16 PST 2016


emaste created this revision.
emaste added a reviewer: labath.
emaste added a subscriber: llvm-commits.

https://reviews.llvm.org/D26617

Files:
  packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py


Index: packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py
===================================================================
--- packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py
+++ packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py
@@ -26,29 +26,37 @@
     _x86_64_regions = 5
     _s390x_regions = 2
 
+    _freebsd_x86_64_pid = 0
+    _freebsd_x86_64_tid = 100283
+    _freebsd_x86_64_regions = 2
+
     @skipIf(oslist=['windows'])
     @skipIf(triple='^mips')
     def test_i386(self):
         """Test that lldb can read the process information from an i386 linux core file."""
-        self.do_test("linux-i386", self._i386_pid, self._i386_regions)
+        self.do_test("linux-i386", self._i386_pid, self._i386_pid,
+          self._i386_regions)
 
     @skipIf(oslist=['windows'])
     @skipIf(triple='^mips')
     def test_x86_64(self):
         """Test that lldb can read the process information from an x86_64 linux core file."""
-        self.do_test("linux-x86_64", self._x86_64_pid, self._x86_64_regions)
+        self.do_test("linux-x86_64", self._x86_64_pid, self._x86_64_pid,
+          self._x86_64_regions)
 
     # This seems to hang on non-s390x platforms for some reason.  Disabling
     # for now.
     @skipIf(archs=no_match(['s390x']))
     @skipIf(triple='^mips')
     def test_s390x(self):
         """Test that lldb can read the process information from an s390x linux core file."""
-        self.do_test("linux-s390x", self._s390x_pid, self._s390x_regions)
+        self.do_test("linux-s390x", self._s390x_pid, self._s390x_pid,
+          self._s390x_regions)
 
     def test_freebsd_x86_64(self):
         """Test that lldb can read the process information from an x86_64 FreeBSD core file."""
-        self.do_test("freebsd-x86_64", self._x86_64_pid, self._x86_64_regions)
+        self.do_test("freebsd-x86_64", self._freebsd_x86_64_pid,
+            self._freebsd_x86_64_tid, self._freebsd_x86_64_regions)
 
     @skipIf(oslist=['windows'])
     @skipIf(triple='^mips')
@@ -74,7 +82,8 @@
                     # works.
                     f.seek(pid_offset)
                     f.write(struct.pack("<I", os.getpid()))
-            self.do_test("linux-x86_64-pid", os.getpid(), self._x86_64_regions)
+            self.do_test("linux-x86_64-pid", os.getpid(), os.getpid(),
+              self._x86_64_regions)
         finally:
             self.RemoveTempFile("linux-x86_64-pid.out")
             self.RemoveTempFile("linux-x86_64-pid.core")
@@ -106,7 +115,8 @@
 
         # without destroying this process, run the test which opens another core file with the
         # same pid
-        self.do_test("linux-x86_64", self._x86_64_pid, self._x86_64_regions)
+        self.do_test("linux-x86_64", self._x86_64_pid, self._x86_64_pid,
+          self._x86_64_regions)
 
     def check_memory_regions(self, process, region_count):
         region_list = process.GetMemoryRegions()
@@ -176,16 +186,16 @@
             end_region.GetRegionBase())
         self.assertEqual(end_region.GetRegionEnd(), lldb.LLDB_INVALID_ADDRESS)
 
-    def do_test(self, filename, pid, region_count):
+    def do_test(self, filename, pid, tid, region_count):
         target = self.dbg.CreateTarget(filename + ".out")
         process = target.LoadCore(filename + ".core")
         self.assertTrue(process, PROCESS_IS_VALID)
         self.assertEqual(process.GetNumThreads(), 1)
         self.assertEqual(process.GetProcessID(), pid)
 
         thread = process.GetSelectedThread()
         self.assertTrue(thread)
-        self.assertEqual(thread.GetThreadID(), pid)
+        self.assertEqual(thread.GetThreadID(), tid)
         backtrace = ["bar", "foo", "_start"]
         self.assertEqual(thread.GetNumFrames(), len(backtrace))
         for i in range(len(backtrace)):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26617.77827.patch
Type: text/x-patch
Size: 3882 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161114/e48f3738/attachment.bin>


More information about the llvm-commits mailing list