<commit_before>import pwndbg.commands
import pwndbg.regs
import errno as _errno
import struct

_errno.errorcode[0] = 'OK'

@pwndbg.commands.ParsedCommand
def errno(err=None):
    if err is None:
        err = pwndbg.regs.retval
        err = pwndbg.regs[err]

    err = abs(int(err))

    if err >> 63:
        err -= (1<<64)
    elif err >> 31:
        err -= (1<<32)

    msg = _errno.errorcode.get(int(err), "Unknown error code")
    print "Errno %i: %s" % (err, msg)<commit_msg>Python3<commit_after>import pwndbg.commands
import pwndbg.regs
import errno as _errno
import struct

_errno.errorcode[0] = 'OK'

@pwndbg.commands.ParsedCommand
def errno(err=None):
    if err is None:
        err = pwndbg.regs.retval
        err = pwndbg.regs[err]

    err = abs(int(err))

    if err >> 63:
        err -= (1<<64)
    elif err >> 31:
        err -= (1<<32)

    msg = _errno.errorcode.get(int(err), "Unknown error code")
    print("Errno %i: %s" % (err, msg))
{'fraction_non_alphanumeric': 0.14389989572471323, 'fraction_numerical': 0.023983315954118872, 'mean_word_length': 2.75, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4085253', 'n_tokens_mistral': 383, 'n_tokens_neox': 348, 'n_words': 90}