Fix libstdc++ data formatters for python3

Use floor-division for consistentcy across python versions. This fixes a
couple of libstdc++ data formatter tests.

llvm-svn: 356377
This commit is contained in:
Pavel Labath 2019-03-18 15:42:08 +00:00
parent 2bde5303c7
commit 22457e66c5

View File

@ -1,3 +1,4 @@
from __future__ import division
import re
import lldb.formatters.Logger
@ -195,7 +196,7 @@ class StdVectorSynthProvider:
if (num_children % self.data_size) != 0:
return 0
else:
num_children = num_children / self.data_size
num_children = num_children // self.data_size
return num_children
except:
return 0
@ -257,7 +258,7 @@ class StdVectorSynthProvider:
return None
element_type = self.start_p.GetType().GetPointeeType()
element_bits = 8 * element_type.GetByteSize()
element_offset = (index / element_bits) * \
element_offset = (index // element_bits) * \
element_type.GetByteSize()
bit_offset = index % element_bits
element = self.start_p.CreateChildAtOffset(