'Display detail information of address/registers
Usage:
MYNAME address
MYNAME register [reg1 reg2]'

def xinfo(self, *arg):

    (address, regname) = normalize_argv(arg, 2)
    if (address is None):
        self._missing_argument()
    text = ''
    if (not self._is_running()):
        return
    def get_reg_text(r, v):
        text = (green(('%s' % r.upper().ljust(3))) + ':    ')
        chain = peda.examine_mem_reference(v)
        text += format_reference_chain(chain)
        text += '\n'
        return text
    (arch, bits) = peda.getarch()
    if str(address).startswith('r'):
        regs = peda.getregs('    '.join(arg[1:]))
        if (regname is None):
            for r in REGISTERS[bits]:
                if (r in regs):
                    text += get_reg_text(r, regs[r])
        else:
            for (r, v) in sorted(regs.items()):
                text += get_reg_text(r, v)
        if text:
            msg(text.strip())
        if ((regname is None) or ('eflags' in regname)):
            self.eflags()
        return
    elif (to_int(address) is None):
        warning_msg('not    a    register    nor    an    address')
    else:
        chain = peda.examine_mem_reference(address, depth=0)
        text += (format_reference_chain(chain) + '\n')
        vmrange = peda.get_vmrange(address)
        if vmrange:
            (start, end, perm, name) = vmrange
            text += 'Virtual    memory    mapping:\n'
            text += green(('Start    :    %s\n' % to_address(start)))
            text += green(('End            :    %s\n' % to_address(end)))
            text += yellow(('Offset:    0x%x\n' % (address - start)))
            text += red(('Perm        :    %s\n' % perm))
            text += blue(('Name        :    %s' % name))
    msg(text)
    return
