3 # This file contains debug dumpers / helpers / visualizers so that certain voglcore
4 # classes can be more easily inspected by gdb and QtCreator.
6 def qdump__vogl__dynamic_string(d, value):
8 small = value["m_small"]
10 small_flag = small["m_flag"]
11 d.putAddress(value.address)
15 strPrefix = "[%d] " % int(len)
16 str = "'" + buf.string(length=len) + "'"
17 d.putValue(strPrefix + str)
20 d.putSubItem("m_len", len)
21 with SubItem(d, "m_small"):
22 d.putValue( str if small_flag == 1 else "<ignored>")
25 d.putSubItem("m_flag", small_flag)
26 with SubItem(d, "m_buf"):
27 d.putValue(str if small_flag == 1 else "<ignored>")
28 with SubItem(d, "m_dyn"):
29 d.putValue("<ignored>" if small_flag == 1 else str)
32 with SubItem(d, "m_buf_size"):
33 d.putValue("<ignored>" if small_flag == 1 else dyn["m_buf_size"])
34 with SubItem(d, "m_pStr"):
35 d.putValue("<ignored>" if small_flag == 1 else str)
37 def qdump__vogl__vector(d, value):
38 size = value["m_size"]
39 capacity = value["m_capacity"]
42 innerType = d.templateArgument(value.type, 0)
44 d.putAddress(value.address)
45 d.putValue("[%d]" % size)
49 d.putSubItem("m_capacity", capacity)
50 d.putSubItem("m_size", size)
51 with SubItem(d, "m_p"):
54 numDisplayItems = min(maxDisplayItems, size)
55 with Children(d, size, maxNumChild=numDisplayItems, childType=innerType, addrBase=p, addrStep=p.dereference().__sizeof__):
56 for i in range(0,numDisplayItems):
57 d.putSubItem(i, p.dereference())