def to_string(self): typenode = g_type_to_typenode(self.val) if typenode != None: name = glib_gdb.g_quark_to_string(typenode["qname"]) s = ("0x%x [%s%s") % (long(self.val), self.hint, name) for i in range(1, int(typenode["n_supers"])): node = g_type_to_typenode(typenode["supers"][i]) if node: name = glib_gdb.g_quark_to_string(node["qname"]) else: name = "???" s += "/" + name return s + "]" else: return ("0x%x") % (long(self.val))
def to_string (self): typenode = g_type_to_typenode(self.val) if typenode != None: name = glib_gdb.g_quark_to_string (typenode["qname"]) s = ("0x%x [%s%s")% (long(self.val), self.hint, name) for i in range (1, int(typenode["n_supers"])): node = g_type_to_typenode(typenode["supers"][i]) if node: name = glib_gdb.g_quark_to_string(node["qname"]) else: name = "???" s += "/" + name return s + "]" else: return ("0x%x") % (long(self.val))
def get_detailed_signal_from_frame(self, frame, signal): detail = self.read_var (frame, "detail") detail = glib_gdb.g_quark_to_string (detail) if detail is not None: return signal + ":" + detail else: return detail
def g_type_to_name (gtype): def lookup_fundamental_type (typenode): if typenode == 0: return None val = read_global_var ("static_fundamental_type_nodes") if val == None: return None return val[typenode >> 2].address gtype = long(gtype) typenode = gtype - gtype % 4 if typenode > (255 << 2): typenode = gdb.Value(typenode).cast (gdb.lookup_type("TypeNode").pointer()) else: typenode = lookup_fundamental_type (typenode) if typenode != None: return glib_gdb.g_quark_to_string (typenode["qname"]) return None
def g_type_to_name (gtype): def lookup_fundamental_type (typenode): if typenode == 0: return None val = read_global_var ("static_fundamental_type_nodes") if val == None: return None return val[typenode >> 2].address() gtype = long(gtype) typenode = gtype - gtype % 4 if typenode > (255 << 2): typenode = gdb.Value(typenode).cast (gdb.lookup_type("TypeNode").pointer()) else: typenode = lookup_fundamental_type (typenode) if typenode != None: return glib_gdb.g_quark_to_string (typenode["qname"]) return None
def get_type_name(cls, typenode): return g_quark_to_string(typenode["qname"])
def g_type_to_name(gtype): typenode = g_type_to_typenode(gtype) if typenode != None: return glib_gdb.g_quark_to_string(typenode["qname"]) return None
def g_type_to_name (gtype): typenode = g_type_to_typenode(gtype) if typenode != None: return glib_gdb.g_quark_to_string (typenode["qname"]) return None