Fix regression in gnu_libstdcpp.py introduced by r266313
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Thu, 14 Apr 2016 18:31:12 +0000 (18:31 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Thu, 14 Apr 2016 18:31:12 +0000 (18:31 +0000)
CreateChildAtOffset needs a byte offset, not an element number.

llvm-svn: 266352

lldb/examples/synthetic/gnu_libstdcpp.py

index fe60edc..9f26282 100644 (file)
@@ -239,7 +239,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('['+str(index)+']',element_offset,element_type)
                        bit = element.GetValueAsUnsigned(0) & (1 << bit_offset)