# Path: symsynd/exceptions.py
# class SymbolicationError(Exception):
# class DebugInfoError(SymbolicationError):
# class DwarfLookupError(DebugInfoError):
# class NoSuchArch(DwarfLookupError):
# class NoSuchSection(DwarfLookupError):
# class NoSuchAttribute(DwarfLookupError):
#     def __init__(self, message):
#     def __str__(self):
#     def __unicode__(self):
# 
# Path: symsynd/_compat.py
# PY2 = sys.version_info[0] == 2
# def to_bytes(x):


import os
import uuid
from symsynd import exceptions
from symsynd._debug import ffi as _ffi
from symsynd._compat import to_bytes, text_type
        _lib.debug_buffer_free(err[0].message)
    raise exc


class Variant(object):

    def __init__(self, struct):
        self.cpu_name = str_from_slice(struct.cpu_name)
        self.uuid = uuid.UUID(bytes=struct.uuid)
        self.name = str_from_slice(struct.name)
        self.vmaddr = struct.vmaddr
        self.vmsize = struct.vmsize

    def __repr__(self):
        return '<Variant %r (%s)>' % (
            self.cpu_name,
            self.uuid,
        )


def get_cpu_name(type, subtype):
    try:
        return str_from_slice(rustcall(_lib.debug_get_cpu_name, type, subtype))
    except exceptions.NoSuchArch:
        pass


def get_cpu_type_tuple(name):
    try:
        struct = rustcall(_lib.debug_get_cpu_type, to_bytes(name))

# Path: symsynd/exceptions.py
# class SymbolicationError(Exception):
# class DebugInfoError(SymbolicationError):
# class DwarfLookupError(DebugInfoError):
# class NoSuchArch(DwarfLookupError):
# class NoSuchSection(DwarfLookupError):
# class NoSuchAttribute(DwarfLookupError):
#     def __init__(self, message):
#     def __str__(self):
#     def __unicode__(self):
# 
# Path: symsynd/_compat.py
# PY2 = sys.version_info[0] == 2
# def to_bytes(x):


# Path: symsynd/libdebug.py
import os
import uuid
from symsynd import exceptions
from symsynd._debug import ffi as _ffi
from symsynd._compat import to_bytes, text_type

        _lib.debug_buffer_free(err[0].message)
    raise exc


class Variant(object):

    def __init__(self, struct):
        self.cpu_name = str_from_slice(struct.cpu_name)
        self.uuid = uuid.UUID(bytes=struct.uuid)
        self.name = str_from_slice(struct.name)
        self.vmaddr = struct.vmaddr
        self.vmsize = struct.vmsize

    def __repr__(self):
        return '<Variant %r (%s)>' % (
            self.cpu_name,
            self.uuid,
        )


def get_cpu_name(type, subtype):
    try:
        return str_from_slice(rustcall(_lib.debug_get_cpu_name, type, subtype))
    except exceptions.NoSuchArch:
        pass


def get_cpu_type_tuple(name):
    try:
        struct = rustcall(_lib.debug_get_cpu_type, to_bytes(name))

        return (struct.cputype, struct.cpusubtype)