[Lldb-commits] [PATCH] Fix StdVBoolImplementation to handle large vectors

Tamas Berghammer tberghammer at google.com
Tue Mar 24 08:22:03 PDT 2015


Hi sivachandra,

Fix StdVBoolImplementation to handle large vectors

The previous implementation only read out the first element of the underlying storage array. Because of it only the first 32 (on x86) or the first 64 (on x86_64) element was displayed.

http://reviews.llvm.org/D8585

Files:
  examples/synthetic/gnu_libstdcpp.py

Index: examples/synthetic/gnu_libstdcpp.py
===================================================================
--- examples/synthetic/gnu_libstdcpp.py
+++ examples/synthetic/gnu_libstdcpp.py
@@ -233,8 +233,9 @@
 				return None
 			byte_offset = index / 8
 			bit_offset = index % 8
-			data = self.start_p.GetPointeeData()
-			bit = data.GetUnsignedInt8(lldb.SBError(), byte_offset) & (1 << bit_offset)
+			element_size = self.start_p.GetType().GetPointeeType().GetByteSize()
+			data = self.start_p.GetPointeeData(byte_offset / element_size)
+			bit = data.GetUnsignedInt8(lldb.SBError(), byte_offset % element_size) & (1 << bit_offset)
 			if bit != 0:
 				value_expr = "(bool)true"
 			else:

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8585.22576.patch
Type: text/x-patch
Size: 697 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150324/b21bb3e4/attachment.bin>


More information about the lldb-commits mailing list