def summarize_text_fragment(valobj, internal_dict): content_union = valobj.GetChildAtIndex(0) state_union = valobj.GetChildAtIndex(1).GetChildMemberWithName("mState") length = state_union.GetChildMemberWithName("mLength").GetValueAsUnsigned(0) if state_union.GetChildMemberWithName("mIs2b").GetValueAsUnsigned(0): field = "m2b" else: field = "m1b" ptr = content_union.GetChildMemberWithName(field) return utils.format_string(ptr, length)
def summarize_text_fragment(valobj, internal_dict): content_union = valobj.GetChildAtIndex(0) state_union = valobj.GetChildAtIndex(1).GetChildMemberWithName("mState") length = state_union.GetChildMemberWithName("mLength").GetValueAsUnsigned( 0) if state_union.GetChildMemberWithName("mIs2b").GetValueAsUnsigned(0): field = "m2b" else: field = "m1b" ptr = content_union.GetChildMemberWithName(field) return utils.format_string(ptr, length)
def summarize_string(valobj, internal_dict): data = valobj.GetChildMemberWithName("mData") length = valobj.GetChildMemberWithName("mLength").GetValueAsUnsigned(0) return utils.format_string(data, length)
def summarize_atom(valobj, internal_dict): target = lldb.debugger.GetSelectedTarget() length = valobj.GetChildMemberWithName("mLength").GetValueAsUnsigned() string = target.EvaluateExpression("(char16_t*)%s.GetUTF16String()" % valobj.GetName()) return utils.format_string(string, length)