[Lldb-commits] [lldb] r354273 - Fix TestLinuxCore for python3

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 18 07:04:34 PST 2019


Author: labath
Date: Mon Feb 18 07:04:33 2019
New Revision: 354273

URL: http://llvm.org/viewvc/llvm-project?rev=354273&view=rev
Log:
Fix TestLinuxCore for python3

- dictionaries don't have iteritems()
- division returns floats

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py?rev=354273&r1=354272&r2=354273&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py Mon Feb 18 07:04:33 2019
@@ -2,7 +2,7 @@
 Test basics of linux core file debugging.
 """
 
-from __future__ import print_function
+from __future__ import division, print_function
 
 import shutil
 import struct
@@ -190,7 +190,7 @@ class LinuxCoreTestCase(TestBase):
         values["xmm6"] = "{0xf8 0xf1 0x8b 0x4f 0xf8 0xf1 0x8b 0x4f 0xf8 0xf1 0x8b 0x4f 0xf8 0xf1 0x8b 0x4f}"
         values["xmm7"] = "{0x13 0xf1 0x30 0xcd 0x13 0xf1 0x30 0xcd 0x13 0xf1 0x30 0xcd 0x13 0xf1 0x30 0xcd}"
 
-        for regname, value in values.iteritems():
+        for regname, value in values.items():
             self.expect("register read {}".format(regname), substrs=["{} = {}".format(regname, value)])
 
 
@@ -201,7 +201,7 @@ class LinuxCoreTestCase(TestBase):
 
         values["fioff"] = "0x080480cc"
 
-        for regname, value in values.iteritems():
+        for regname, value in values.items():
             self.expect("register read {}".format(regname), substrs=["{} = {}".format(regname, value)])
 
     @expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
@@ -260,7 +260,7 @@ class LinuxCoreTestCase(TestBase):
             # Test an address in the middle of a region returns it's enclosing
             # region.
             middle_address = (region.GetRegionBase() +
-                              region.GetRegionEnd()) / 2
+                              region.GetRegionEnd()) // 2
             region_at_middle = lldb.SBMemoryRegionInfo()
             error = process.GetMemoryRegionInfo(
                 middle_address, region_at_middle)




More information about the lldb-commits mailing list