@validate_busy
        @validate_target
        @lock_host
        def dereference(self, pointer, target_id=0):
            """
            Recursively dereference a pointer for display
            `target_id` is ignored.
            """
            fmt = ('<' if self.get_byte_order() == 'little' else '>') + {2: 'H', 4: 'L', 8: 'Q'}[self.get_addr_size()]

            addr = pointer
            chain = []

            # recursively dereference
            while True:
                try:
                    mem = self.memory(addr, self.get_addr_size())
                except FailedToReadMemoryError:
                    break
                except Exception as e:
                    print(e)
                    print(type(e))
                    print(e.__class__.__name__)
                    break
                log.debug("read mem: {}".format(mem))
                (ptr,) = struct.unpack(fmt, mem)
                if ptr in chain:
                    break
                chain.append(('pointer', addr))
                addr = ptr

            # get some info for the last pointer
            # first try to resolve a symbol context for the address
            p, addr = chain[-1]
            output = self._vdb.reprPointer(addr)
            if "Who knows?!?!!?" not in output:
                chain.append(('symbol', output))
                log.debug("symbol context: {}".format(str(chain[-1])))
            else:
                log.debug("no symbol context")
                try:
                    chain.append(("string", self._get_ascii_string(addr)))
                except NotAStringError:
                    try:
                        chain.append(("string", self._get_unicode_string(addr)))
                    except NotAStringError:
                        pass

            log.debug("chain: {}".format(chain))
            return chain
dataset/ETHPy150Open snare/voltron/voltron/plugins/debugger/dbg_vdb.py/VDBAdaptor.dereference/original