'Returns a list of all xrefs to ad.'

def xrefsto(self, ad):

    lst = []
    if (ad in self.__db.data_sub_xrefs):
        for x in self.__db.data_sub_xrefs[ad]:
            lst += self.__db.xrefs[x]
        for (i, x) in enumerate(lst):
            ad = self.__db.mem.get_head_addr(x)
            if (ad != x):
                lst[i] = ad
        return set(lst)
    if (ad in self.__db.xrefs):
        lst = set(self.__db.xrefs[ad])
    return lst
