[Lldb-commits] [lldb] r356377 - Fix libstdc++ data formatters for python3
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon Mar 18 08:42:08 PDT 2019
Author: labath
Date: Mon Mar 18 08:42:08 2019
New Revision: 356377
URL: http://llvm.org/viewvc/llvm-project?rev=356377&view=rev
Log:
Fix libstdc++ data formatters for python3
Use floor-division for consistentcy across python versions. This fixes a
couple of libstdc++ data formatter tests.
Modified:
lldb/trunk/examples/synthetic/gnu_libstdcpp.py
Modified: lldb/trunk/examples/synthetic/gnu_libstdcpp.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/synthetic/gnu_libstdcpp.py?rev=356377&r1=356376&r2=356377&view=diff
==============================================================================
--- lldb/trunk/examples/synthetic/gnu_libstdcpp.py (original)
+++ lldb/trunk/examples/synthetic/gnu_libstdcpp.py Mon Mar 18 08:42:08 2019
@@ -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(
More information about the lldb-commits
mailing list